program quota c+ c c QUOTA Take file with USER accounting records in it and c produce disk charging output. (This is an example c program that will need to be modified to produce c the specific output for the computer site.) c c Author: Thomas J. Linscomb c Computation Center c The University of Texas at Austin c Austin, Texas 78712 c c Input file: quota$input - assigned to file containing user records c (acc /binary/type=user) c c Output file: quota$output - assigned to output listing c c- implicit none include 'agldef.inc/nolist' ! AGL subcode defs include '($foriosdef)' ! iostat defs integer*4 allcat integer*4 dskuse integer*4 nnn integer*2 status integer*2 usrcod byte buf(0:1023) character*8 acct character*12 name ! username integer*4 ioerr ! input error codes (iostat) integer*4 i ! do loop index data nnn/1/ cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c open files c open (unit=1,name='quota$input',type='old',form='unformatted', 1 recordtype='variable') open (unit=2,name='quota$output',type='new') c c process each record c 100 continue DO i = 0, 1023 ! zero out last record buf(i) = 0 ENDDO read(1,end=8000,iostat=ioerr) buf if( ioerr .ne. 0 .and. 1 ioerr .ne. for$ios_inpstareq ) goto 7000 ! real error c c check for a good (ours) user buffer and figure out c what kind it is c call fubuff(buf,status,usrcod) ! find user buffer if( status .le. 0 ) goto 1000 ! bad if( usrcod .eq. -1 ) goto 1000 ! bad c c handle test records inserted in the accounting system c IF( usrcod .eq. agl$k_test ) THEN write(*,9020) 9020 format(1x,'accuser>test record') goto 100 ENDIF c c Handle the records for disk charging c IF( usrcod .eq. agl$k_disk ) THEN call dskbuf(buf(status),acct,name,allcat,dskuse) c c write(2,9000) nnn,acct,name,dskuse,allcat 9000 format(i8,2x,a8,2x,a12,3x,'Usage: ', 1 i10,3x,'Allocation: ',i10) nnn=nnn+1 goto 100 ENDIF c c The record was not one that we recognize, dump it out c 1000 continue write (*,1010) status,usrcod,buf 1010 format(1x,'accuser>bad user rec:',i8,2x,i8,/,(32(1x,z2)/)) go to 100 c c an error occured on the read that we couldnt handle c 7000 continue write(*,7010) ioerr 7010 format(' Unrecoverable read error, iostat code =',i) call exit(4) c c end c 8000 continue call exit(1) end