Trailing-Edge
-
PDP-10 Archives
-
decuslib20-06
-
decus/20-158/clsact.mac
There are no other files named clsact.mac in the archive.
00100 TITLE CLSACT
00200 SEARCH MONSYM,MACSYM
00300 .REQUIRE SYS:MACREL
00400 SALL
00500
00600 COMMENT \
00700
00800 This program closes the system accounting file and renames
00900 it to the date which its contents represent - a filename of the form
01000 nnmmmyy.BIN. If the system accounting file has already been closed
01100 this day, the procedure is bypassed.
01200
01300 The logic for the process is:
01400 1) lookup the file PS:<ACCOUNTS>SYSTEM-DATA.BIN
01500 2) use the current date as the name of a daily accounting file
01600 with the form nnmmmyy.BIN.
01700 3) see if the daily accounting file exists (ie, the JFN has
01800 generation number not equal to 1); if so, stop. If not,
01900 close the system accounting file and rename it to be the
02000 daily file.
02100
02200 Written by H. D. Todd for use by the
02300 Wesleyan Computing Center, August, 1980.
02400 \
02500
02600
02700 VMAJOR==1
02800 VMINOR==1
02900 VEDIT==1
03000 VWHO==1
03100 VCLSAC==<VWHO>B2 + <VMAJOR>B11 + <VMINOR>B17 + VEDIT
03200
03300 T0==0
03400 T1==1
03500 T2==2
03600 T3==3
03700 T4==4
03800 A5==5
03900 A6==6
04000 A7==7
04100 A8==8
04200 A9==9
04300 P==17
04400
04500 PDLEN==50
04600
04700 CLSACT: RESET
04800 MOVE P,[IOWD PDLEN,PDLIST]
04900 MOVX T1,GJ%SHT!GJ%OLD ;GET JFN FOR SYSTEM-DATA FILE
05000 HRROI T2,[ASCIZ/PS:<ACCOUNTS>SYSTEM-DATA.BIN.0/]
05100 ; HRROI T2,[ASCIZ/PS:<WCC.D-TODD>SYSTEM-DATA.BIN.0/]
05200 GTJFN%
05300 JRST [ TMSG<?CLSACT: Are you enabled?>
05400 JSHLT]
05500 MOVE A5,T1 ;SAVE JFN
05600 SETO T2,
05700 ODCNV% ;GET SEPARATE MON, DAY, YR
05800 HLRZM T2,A6 ;YEAR
05900 SUBI A6,^D1900 ; AS TWO DIGITS
06000 HRRZM T2,A7 ;MONTH (>= 0)
06100 HLRZM T3,A8 ;DAY OF MONTH (>= 0)
06200 AOS A8 ; (>= 1)
06300 MOVE T1,[POINT 7,NEWFIL] ;NOW CREATE STRING FOR NAME
06400 HRROI T2,[ASCIZ/PS:<ACCOUNTS>/]
06500 ; HRROI T2,[ASCIZ/PS:<WCC.D-TODD>/]
06600 SETZB T3,T4
06700 SOUT
06800 MOVE T2,A8
06900 MOVX T3,<FLD(1,NO%LFL)+FLD(2,NO%COL)+FLD(1,NO%ZRO)+^D10>
07000 NOUT
07100 JRST [ TMSG<?CLSACT: Can't write day field>
07200 JSHLT]
07300 MOVE T2,[POINT 7,MONTAB(A7)]
07400 SETZB T3,T4
07500 SOUT
07600 MOVE T2,A6
07700 MOVX T3,<FLD(2,NO%COL)+FLD(1,NO%ZRO)+^D10>
07800 NOUT
07900 JRST [ TMSG<?CLSACT: Can't write year>
08000 JSHLT]
08100 FMSG <.BIN.-1>
08200 SETZB T3,T4
08300 SETZ T3,
08400 IDPB T3,T1
08500 HRROI T2,NEWFIL ;NOW LOOKUP THE DAILY FILE
08600 MOVX T1,<GJ%FOU!GJ%SHT+777777>
08700 GTJFN%
08800 JRST [ TMSG<?CLSACT: Daily filename invalid>
08900 JSHLT]
09000 MOVEM T1,A6 ;SAVE JFN OF DAILY FILE
09100 MOVE T2,T1 ;NOW FIND ITS GENERATION NUMBER
09200 MOVE T1,[POINT 7,GEN]
09300 MOVX T3,FLD(.JSAOF,JS%GEN)
09400 SETZ T4,
09500 JFNS%
09600 MOVE A7,GEN ;GET FIRST WORD OF GEN STRING
09700 CAME A7,[ASCIZ/1/] ;IS IT FIRST?
09800 JRST [HRROI T1,[ASCIZ/[CLSACT: File /]
09900 PSOUT
10000 HRROI T1,NEWFIL
10100 PSOUT
10200 TMSG < already exists]>
10300 HALTF
10400 JRST .-1]
10500 MOVEI T1,1 ;OK, CLOSE THE SYSTEM FILE
10600 SETZ T2,
10700 USAGE
10800 ERJMP [ TMSG<?CLSACT: Usage JSYS failed>
10900 JSHLT]
11000 MOVE T1,A5 ;GET JFN OF SYSTEM FILE
11100 MOVE T2,A6 ;AND JFN OF DAILY FILE
11200 RNAMF ;AND DO RENAME
11300 JRST [ TMSG<?CLSACT: Rename failed>
11400 JSHLT]
11500 HRROI T1,[ASCIZ/[CLSACT /]
11600 PSOUT
11700 HRROI T1,NEWFIL
11800 PSOUT
11900 TMSG < has been created as daily accounting file]>
12000 STOPER: SETO T1, ;ALL DONE ... CLOSE JFN'S AND HALT
12100 CLOSF%
12200 JSERR
12300 HALTF
12400 JRST .-1
12500 PDLIST: BLOCK PDLEN
12600 NEWFILE: BLOCK 30
12700 DEFINE TABGEN(A)<
12800 IRP A,<ASCIZ /A/>
12900 >
13000 MONTAB: TABGEN(<JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC>)
13100 GEN: BLOCK 3
13200 END CLSACT