program qsl cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c QST - 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 c c Author: Don Rubin Version: 1.0 May 1981 c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c integer*2 ibuf(13),nmdays(12),today(3),stdate(3),stpdat(3) integer*2 curtim(3),curdat(3),uics(2,50),zero(3) integer*4 iqios,cputim logical*1 lfile(24),totals,sumday,termid(2),uic(2),q,ok logical*1 uichel(50),uicbye(50) 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 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 c see if stop date is greater than or equal to start date c do 22 j=3,1,-1 if(stpdat(j).lt.stdate(j))goto 3 !branch if error 22 continue goto 10 3 stop 'Stop day must be <= start day' c c prompt for and open input file c 10 type 92 92 format('$Enter input filename ') accept 81,j,lfile if(j.le.0)call exit lfile(J+1)=0 c open(unit=2,name='QSL.OUT',type='NEW') open(unit = 1, - name = lfile, - form = 'UNFORMATTED', - type = 'OLD', - shared, - readonly, - access = 'SEQUENTIAL', - err = 9000) 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(t18,'TermID Acct UIC CPU ATcnt QIO1 QIO2', - ' Runs Ins'/) goto 101 c c loop for each record in the input file c 100 nrec=nrec+1 !bump number of records read 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 c 101 if(irec.le.1)type 909,(ibuf(j),j=1,7) if(irec.le.1)write(2,909)(ibuf(j),j=1,7) 909 format(1x,i2,t5,i2,':',i2,':',i2,t15,i4,'/',i2'/',i2/) if(irec.gt.1)type 999,(ibuf(j),j=1,13) if(irec.gt.1)write(2,999)(ibuf(j),j=1,13) 999 format(1x,i2,t5,i2,':',i2,':',i2,t15,9i7) goto 100 c c end of file c 150 type 911,nrec 911 format(1x,'Number of records=',i5) 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