program qso cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c QSO - Accounting file listing program c c This program scans the accounting file created by the KMS c accounting system and lists it on the terminal in a form to c allow verification of logon/logoff times for each user. c c Author: Don Rubin Version: 1.0 September 1981 c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c integer*2 ibuf(13),nmdays(12),today(3),stdate(3),stpdat(3) integer*2 curtim(3),curdat(3),zero(3) integer*4 iqios,cputim logical*1 lfile(24),totals,sumday,termid(2),uic(2),q,ok c common uics c c -- start record c equivalence (irec,ibuf(1)) equivalence (ihr,ibuf(2)) equivalence (imin,ibuf(3)) equivalence (isec,ibuf(4)) equivalence (iyear,ibuf(5)) equivalence (imonth,ibuf(6)) equivalence (iday,ibuf(7)) c c -- hel/bye record c equivalence (termid,ibuf(5)) equivalence (iacnt,ibuf(6)) equivalence (uic,ibuf(7)) equivalence (cputim,ibuf(8)) ! i*4 word matches 2 bfr words equivalence (iqios,ibuf(10)) ! i*4 word matches 2 bfr words equivalence (irunct,ibuf(12)) equivalence (insct,ibuf(13)) c call idate(today(1),today(2),today(3)) c c prompt for and open input file c type 92 92 format('$Enter input filename ') accept 81,j,lfile if(j.le.0)call exit lfile(J+1)=0 c type 90 90 format('$Enter start date in the form DD,MM,YY [default 1,1,80] ') accept 80,stdate if(stdate(1).eq.0)stdate(1)=1 !default day if(stdate(2).eq.0)stdate(2)=1 !default month if(stdate(3).eq.0)stdate(3)=80 !default year c type 91 91 format('$Enter stop date in the form DD,MM,YY [default today] ') accept 80,stpdat if(stpdat(1).eq.0)stpdat(1)=today(2) !default day if(stpdat(2).eq.0)stpdat(2)=today(1) !default month if(stpdat(3).eq.0)stpdat(3)=today(3) !default year c 10 open(unit = 1, - name = lfile, - form = 'UNFORMATTED', - type = 'OLD', - shared, - readonly, - access = 'SEQUENTIAL', - err = 9000) open(unit=2,name='QSO.OUT',type='NEW') c c position file to the start date c 11 read(1,err=9100,end=9990) ibuf if(irec.ne.1)goto 11 call daybeg(ibuf,stdate,ok) !check date if(.not.ok)goto 11 !branch if not at start date yet c call dayend(ibuf,stpdat,ok) !check to see if past stop date if(.not.ok)goto 150 c write(2,9123) type 9123 9123 format('1',t14,'Time TermID Acct UIC'/) goto 101 c c loop for each record in the input file c 100 read(1,end=150,err=9100)ibuf c if(irec.ne.1)goto 101 call dayend(ibuf,stpdat,ok) !check to see if past stop date if(.not.ok)goto 150 goto 102 c 101 if(iday.eq.0.and.imonth.eq.0)goto 100 !bad record 102 continue if(irec.eq.1)write(2,909)'startup at ',(ibuf(j),j=2,7) if(irec.eq.-1)write(2,909)'shut down at',(ibuf(j),j=2,7) if(irec.eq.1)type 909,'startup at ',(ibuf(j),j=2,7) if(irec.eq.-1)type 909,'shut down at',(ibuf(j),j=2,7) 909 format(' System ',a12,1x,i2,':',i2,':',i2,' on',i4,'/',i2'/',i2/) if(irec.eq.6.and.lasrec.ne.1)then type 999,'Logout',(ibuf(j),j=2,4),termid,iacnt !,uic(2),uic(1) write(2,999)'Logout',(ibuf(j),j=2,4),termid,iacnt !,uic(2),uic(1) endif if(irec.eq.5)then type 999,'Login ',(ibuf(j),j=2,4),termid,iacnt,uic(2),uic(1) write(2,999)'Login ',(ibuf(j),j=2,4),termid,iacnt,uic(2),uic(1) 999 format(1x,a6,t12,i2,':',i2,':',i2,t22,a1,'T',i2,t30,i5:,t40 * ,'[',o3,',',o3,']') endif lasrec=irec goto 100 c c end of file c 150 close (unit=2) close (unit=1) call exit 80 format(3i5) 81 format(q,24a1) 9100 stop 'error during read' 9000 stop 'error during open' 9990 stop 'requested date not in file' end