*-----------------------* * JOHN'S FIRST PROGRAM *-----------------------* CS=@(-1) ; CR=@(-3) ; CL=@(-4) ; RV=@(-13) ; ERV=@(-14) VM=CHAR(253) ; SVM=CHAR(252) ; AM=CHAR(254) ; BEEP=CHAR(7) PROMPT " " * OPEN 'CLOCKFILE' TO CLOCKFILE ELSE ABORT OPEN 'USER' TO USER.FILE ELSE ABORT * CRT CS CRT @(0,0):"CLOCK.AUDIT" CRT @(10,10):"DEPARTMENT ": INPUT DEPT CRT @(10,12):"START DATE ": INPUT SDATE CRT @(10,14):"LAST DATE ": INPUT LDATE * EXECUTE \SSELECT CLOCKFILE WITH DEPT "\:DEPT:\" AND WITH DATE GE "\:SDATE:\" AND WITH DATE LE "\:LDATE:\" BY USER BY DATE (R,10\ LOOP READNEXT ID ELSE ID = 'EOF' UNTIL ID = 'EOF' DO READ REC FROM CLOCKFILE,ID THEN ERROR='' VCT=DCOUNT(REC<1>,VM) IF REM(VCT,2) # 0 THEN ERROR='MISSING ENTRY' END ELSE FOR V=VCT TO 2 STEP -1 IF REC<1,V> >= REC<1,V-1> ELSE ERROR='INVALID TIME' END NEXT V END IF ERROR # '' THEN USER=OCONV(ID,"G0|1") READ UREC FROM USER.FILE,USER THEN NAME=UREC<2>:", ":UREC<1>[1,1]:"." END DATE=OCONV(ID,"G1|1") CRT CS LN= USER : " ": DATE:" " :ERROR PRINT LN INPUT ANY END END REPEAT