PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 1 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0001 character*3 month,months(12),yesno,filtyp 0002 character*9 actuic,loguic,newuic,olduic,uicon(0:40,4),DUIC 0003 character*8 acttim,logtim,timeon(0:40,4) 0004 character*9 actdat,logdat,dateon(0:40,4),actbgn,logbgn 0005 character*9 actend,logend 0006 character*2 acttty,logtty 0007 character*20 actbil,billng(0:40,4),accnam,accnm2 0008 character*30 filnam 0009 character*120 actbuf,logbuf,savbuf 0010 integer hr,hron,sec,secon,min,minon 0011 integer rltn 0012 real hours 0013 common /chars/ uicon,timeon,dateon,billng,accnam(30),accnm2(30) 0014 common /nums/ accnum,rate(30),hours(30) 0015 data months/'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG', + 'SEP','OCT','NOV','DEC'/ 0016 open(unit=1,name='[1,4]accounts.dat',organization='sequential', + form='formatted',recordtype='variable',type='old', + readonly,carriagecontrol='list',access='sequential') 0017 i=1 0018 50 read(1,55,end=60) accnam(i) 0019 read(1,55) accnm2(i) 0020 read(1,56) rate(i) 0021 55 format(a) 0022 56 format(f5.2) 0023 110 format(a) ! input for character 0024 111 format(q,a) ! input for character with transfer count 0025 115 format(1x,a) ! output for character 0026 1151 format(1x,a,x,a) 0027 116 format(/,'0',a,2x,a,2x,a) ! output for character with triple c space and with multiple outputs 0028 117 format(' ',a,2x,f6.2,' mins') 0029 i=i+1 0030 goto 50 0031 60 accnum=i-1 0032 close(unit=1,dispose='save') 0033 open(unit=5,name='ti:',recl=250,status='new') 0034 type 90 0035 90 format('$What month (3 letters) ? ') 0036 accept 110,filtyp 0037 type 95 0038 95 format('$Default file assignments (Y/N) ? ') 0039 accept 110,yesno 0040 if (yesno(1:1) .eq. 'y' .or. yesno(1:1) .eq. 'Y') then 0041 filnam(1:17) = '[1,4]acctlog.' 0042 filnam(18:20) = filtyp(1:3) 0043 filnam(21:30) = ' ' 0044 else 0045 type 100 0046 100 format('$What is the Billing Account file name? ') 0047 accept 110,filnam 0048 endif c open syslogin.cmd file to find billing accounts 0049 open(unit=1,name=filnam,readonly,type='old') 0050 if (yesno(1:1) .eq. 'y' .or. yesno(1:1) .eq. 'Y') then PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 2 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0051 filnam(1:16) = '[1,4]cumlog.' 0052 filnam(17:19) = filtyp(1:3) 0053 filnam(20:30) = ' ' 0054 else 0055 type 120 0056 120 format('$What is the Log file name? ') 0057 accept 110,filnam 0058 endif c open console log file to find login, logout times 0059 open(unit=2,name=filnam,readonly,type='old') c c logerr.xxx will hold all tktn and other messages 0060 filnam(1:16) = '[1,4]logerr.' 0061 filnam(17:19) = filtyp(1:3) 0062 filnam(20:30) = ' ' 0063 open(unit=3,recl=250,name=filnam,type='new') c logunk.xxx will hold all unknown messages 0064 filnam(1:16) = '[1,4]logunk.' 0065 filnam(17:19) = filtyp(1:3) 0066 filnam(20:30) = ' ' 0067 open(unit=4,recl=250,name=filnam,type='new') c smrylg.xxx will list all completed transactions 0068 filnam(1:16) = 'sy:[1,4]smrylg.' 0069 filnam(17:19) = filtyp(1:3) 0070 filnam(20:30) = ' ' 0071 type 101 0072 101 format('$Do you want the summary log (Y/N) ? ') 0073 accept 110,yesno 0074 if (yesno(1:1) .eq. 'y' .or. yesno(1:1) .eq. 'Y') then 0075 open(unit=6,recl=250,name=filnam,type='new') 0076 else 0077 open(unit=6,recl=250,name='nl:dummy.dmp',type='new') 0078 endif c billing.xxx will list all the accounts with amount used 0079 filnam(1:17) = '[1,4]billing.' 0080 filnam(18:20) = filtyp(1:3) 0081 filnam(21:30) = ' ' 0082 open(unit=7,recl=250,name=filnam,type='new') c c 0083 act1st = 1 ! set for first account read 0084 log1st = 1 ! set for first log read c c c 0085 hldlog=0 ! read logbuf first time through 0086 do 125 i=0,40 0087 do 125 j=1,4 ! j = term type , 1-tt 2-ht 3-vt 4-rt 0088 uicon(i,j)='idle ttxx' 0089 dateon(i,j)='date' 0090 timeon(i,j)='time' 0091 billng(i,j)='none' 0092 125 continue 0093 130 continue D TYPE *,'READY TO READ ACTBUF' PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 3 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0094 read(1,111,end=150) j,actbuf d TYPE 115,ACTBUF(1:J) 0095 if (index(actbuf,'Init').ne.0 + .or. + index(actbuf,'INIT').ne.0 + .or. + index(actbuf,'init').ne.0 + .or. + j.lt.7) goto 130 ! if this is the init mssg or c a blank line, skip it 0096 i=index(actbuf,'Login') 0097 i1=index(actbuf,'LOGIN') 0098 if (i.eq.0 .and. i1.eq.0) then ! this is not a login message 0099 i=index(actbuf,'Relog') ! is it a relog message? 0100 i1=index(actbuf,'RELOG') 0101 if (i.eq.0 .and. i1.eq.0) + stop 'TIMELOG -- ERROR #1 IN ACCOUNT FILE' 0102 irelog=1 0103 else ! this is a login message 0104 irelog=0 0105 endif 0106 i=index(actbuf,'-') 0107 actdat=actbuf(i-2:i+6) 0108 i=index(actbuf,':') 0109 acttim=actbuf(i-2:i+5) 0110 i=index(actbuf,'.') 0111 acttty=actbuf(i-2:i-1) d TYPE *,'PROCESSING ACTBUF[I-4:I-1] = ',ACTBUF(I-4:I-1) 0112 if (acttty(1:1) .eq. 'T') acttty(1:1) = ' ' 0113 iterm = 1 0114 if (actbuf(i-4:i-3) .eq. 'VT') iterm = 3 0115 if (actbuf(i-3:i-2) .eq. 'VT') iterm = 3 0116 if (actbuf(i-3:i-2) .eq. 'HT') iterm = 2 0117 if (actbuf(i-4:i-3) .eq. 'HT') iterm = 2 0118 if (actbuf(i-3:i-2) .eq. 'RT') iterm = 4 0119 if (actbuf(i-4:i-3) .eq. 'RT') iterm = 4 d TYPE *,'ITERM',ITERM 0120 read(1,111) j,actbuf d TYPE 115,ACTBUF(1:J) 0121 i=index(actbuf,'USER IS') 0122 i1=index(actbuf,'User is') 0123 i2=index(actbuf,'Changing') 0124 i3=index(actbuf,'CHANGING') 0125 if ( (i.eq.0 .and. i1.eq.0 .and. irelog.eq.0) + .or. + (i2.eq.0 .and. i3.eq.0 .and. irelog.eq.1) ) + stop 'TIMELOG -- ERROR #2 IN ACCOUNT FILE' 0126 i=index(actbuf,'[') 0127 j=index(actbuf(i:),']') 0128 actuic=' ' ! pad with zero's for compatibilty 0129 actuic(1:j) = actbuf(i:j+i) ! get named uic or ggg,mmm uic d write(5,3939) i,j,'test','string' d type *,'using actbuf - ' d type 3939,i,j,actbuf(i:i+j),actuic PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 4 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0130 3939 format(2x,'---------i: ',i2,' j: ',i2 + ,' xxxbuf(i:i+j):',a,': xxxuic:',a,':') c 0131 if (irelog.eq.1) then 0132 oldi=i 0133 olduic=actuic 0134 i=index(actbuf(oldi:),'[') 0135 j=index(actbuf(i:),']') c actuic='000,000' ! pad with zero's for compatibilty 0136 actuic(1:j) = actbuf(i:i+j) ! get named uic or ggg,mmm uic 0137 newuic=actuic 0138 endif c 0139 read(1,111) j,actbuf d TYPE 115,ACTBUF(1:J) 0140 if (index(actbuf,'Billing').eq.0 + .and. + index(actbuf,'BILLING').eq.0) + stop 'TIMELOG -- ERROR #3 IN ACCOUNT FILE' 0141 i=index(actbuf,'CONTINUE') 0142 i1=index(actbuf,'Continue') 0143 if (irelog.eq.1 + .and. + (i1.ne.0 .or. i.ne.0) ) then c for 'continue with current billing account' 0144 decode(2,135,acttty) itty ! get terminal as an integer 0145 135 format(i2) 0146 actbil=billng(itty,iterm) ! get current billing account 0147 else ! for new billing accounts 0148 i=index(actbuf,'is') 0149 if (i.eq.0) i=index(actbuf,'IS') 0150 j2=index(actbuf,'.') 0151 actbil=actbuf(i+3:j2-1) 0152 endif 0153 if (irelog.eq.1) then ! relog an account d TYPE 137,'RELOG: ',ACTTTY,ACTDAT,ACTTIM,OLDUIC,ACTBIL 0154 137 FORMAT(1X,A,A,A,A,A,A) 0155 call logout(acttty,actdat,acttim,olduic,iterm) 0156 call login(acttty,actdat,acttim,newuic,actbil,iterm) 0157 if (act1st.eq.1) then 0158 actbgn = actdat 0159 act1st = 0 0160 endif 0161 goto 130 ! back for a new account file entry 0162 endif c ! here with a valid new account login c check for saving start 0163 if (act1st.eq.1) then 0164 actbgn = actdat 0165 act1st = 0 0166 endif c c 0167 140 if (hldlog.ne.1) then d type *,'ready to read logbuf' PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 5 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0168 9140 read(2,111,end=160) j,logbuf ! if new account and d TYPE 141,LOGBUF(1:J) 0169 141 FORMAT(1X,A) 0170 if (index(logbuf,'Init').ne.0 + .or. + index(logbuf,'INIT').ne.0 + .or. + index(logbuf,'init').ne.0 + .or. + j.lt.7) goto 9140 ! if this is the init mssg or c a blank line, skip it 0171 endif 0172 hldlog=0 c same log 0173 145 call type(logbuf,itype) ! find out what type of entry 0174 if (itype.eq.0) then ! unknown entry type 0175 write(4,115) logbuf(1:j) 0176 else if (itype.eq.1) then ! COT -- Date is ... 0177 i=index(logbuf,'Date') 0178 j=index(logbuf(i:),'-') 0179 j=j+i-1 0180 logdat=logbuf(j-2:j+6) 0181 if (logdat(1:1).eq.' ') logdat(1:1)='0' 0182 logtim=logbuf(1:8) 0183 if (log1st.eq.1) then 0184 logbgn = logdat 0185 log1st = 0 0186 endif 0187 call tsttim(acttim,actdat,logtim,logdat,rltn) c rltn = 1 -> log entry is prior to account entry (OK) c rltn = 0 -> log entry is at same time as account c entry (OK) c rltn = -1 -> log entry is after account entry; this c implies no corresponging log entry for c the account entry (ERROR) C*************************** 0188 TYPE 69696,'COT',LOGDAT ! ,RLTN 0189 69696 FORMAT(1X,A,' DATE IS ~',A,'~') ! ,2X,'RLTN IS ',I2) C*************************** 0190 if (rltn.lt.0) then 0191 hldlog=1 ! don't read a new log entry 0192 goto 130 ! but get a new account entry 0193 endif 0194 else if (itype.eq.2 .or. itype.eq.3) then ! ERRLOG or TKTN 0195 write(3,9115) logdat,logbuf(1:j) 0196 9115 format(1x,a,2x,a) 0197 else if (itype.eq.6) then ! broadcast 0198 logtim=logbuf(1:8) 0199 i=index(logbuf,'-') 0200 logdat=logbuf(i-2:i+6) 0201 if (logdat(1:1).eq.' ') logdat(1:1)='0' 0202 if (log1st.eq.1) then 0203 logbgn = logdat 0204 log1st = 0 0205 endif PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 6 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0206 read(2,110) logbuf ! get message 0207 call tsttim(acttim,actdat,logtim,logdat,rltn) c rltn = 1 -> log entry is prior to account entry (OK) c rltn = 0 -> log entry is at same time as account c entry (OK) c rltn = -1 -> log entry is after account entry; this c implies no corresponging log entry for c the account entry (ERROR) C*************************** d TYPE 69696,'BRO',LOGDAT,RLTN C*************************** 0208 if (rltn.lt.0) then 0209 hldlog=1 ! don't read a new log entry 0210 goto 130 ! but get a new account entry 0211 endif 0212 if (index(logbuf,'START-UP').ne.0) then c start everyone off... 0213 duic='1,377' 0214 call clenup(logdat,logtim,duic) c log on the console user for start-up activities 0215 duic='1,377' 0216 call login(' 0',logdat,logtim,duic, + 'sys maint ',1) 0217 else if (index(logbuf,'SHUT-DOWN').ne.0) then 0218 call logout('ff',logdat,logtim,loguic,1) 0219 else 0220 write(3,115) logbuf(1:j) 0221 endif 0222 else if (itype.eq.4 .or. itype.eq.-4) then ! login d TYPE *,' STARTING LOGON PROCEDURE' 0223 if(itype.eq.4) then 0224 logtim=logbuf(1:8) 0225 i=index(logbuf,'[') 0226 j1=index(logbuf(i:),']') 0227 loguic=' ' ! pad with zero's for compatibilty 0228 loguic(1:j1) = logbuf(i:i+j1) ! get uic or ggg,mmm d type 3939,i,j1,logbuf(i:i+j1),loguic 0229 if ( index(logbuf,'TT') .ne. 0) then 0230 i = index(logbuf,'TT') 0231 iterml = 1 0232 else if ( index(logbuf,'HT') .ne. 0) then 0233 i = index(logbuf,'HT') 0234 iterml = 2 0235 else 0236 i = index(logbuf,'RT') 0237 iterml = 4 0238 endif 0239 j1=index(logbuf(i:),':') 0240 j1=j1+i-1 0241 logtty=' ' 0242 logtty(5-j1+i:2)=logbuf(i+2:j1-1) 0243 else 0244 logtim=logbuf(1:8) 0245 loguic = 'batch job' ! no uic for vt login 0246 i=index(logbuf,'VT') PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 7 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0247 j1=index(logbuf(i:),':') 0248 j1=j1+i-1 0249 logtty=' ' 0250 logtty(5-j1+i:2)=logbuf(i+2:j1-1) 0251 iterml = 3 0252 endif d TYPE 153,'LOGGING IN',LOGDAT,LOGTIM,LOGUIC,LOGTTY,iterml 0253 call tsttim(acttim,actdat,logtim,logdat,rltn) d IF (ITYPE.LT.0) TYPE *,'BACK FROM TSTTIM RLTN = ',RLTN c rltn = 1 -> log entry is prior to account entry (OK) c rltn = 0 -> log entry is at same time as account c entry (OK) c rltn = -1 -> log entry is after account entry; this c implies no corresponging log entry for c the account entry (ERROR) 0254 if (rltn.lt.0) then 0255 hldlog=1 ! don't read a new log entry 0256 goto 130 ! but get a new account entry 0257 endif 0258 if (actdat.eq.'00-end-00') then 0259 write(6,116) + 'TIMELOG --',logdat, + 'CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0260 write(6,115) + ' END OF ACCOUNT FILE' 0261 type *, + 'TIMELOG -- CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0262 type *,' END OF ACCOUNT FILE' 0263 actbil='LOST REVENUE' 0264 call login(logtty,logdat,logtim,loguic,actbil,iterml) 0265 else if (actdat.ne.logdat) then ! wrong day.... 0266 type *, + 'TIMELOG -- CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0267 type *,' DATE IS TOO EARLY' 0268 write(6,116) + 'TIMELOG --',logdat, + 'CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0269 write(6,115) + ' DATE IS TOO EARLY' 0270 write(6,1151) + ' ACCOUNT DATE: ',ACTDAT 0271 actbil='LOST REVENUE' 0272 call login(logtty,logdat,logtim,loguic,actbil,iterml) 0273 if (isave.eq.1) then ! we have a saved log entry 0274 logbuf=savbuf ! pull it out 0275 hldlog=1 ! don't read a new log entry 0276 jsave=2 ! indicate using saved entry D type *,'TIMELOG -- RESTORING SAVED LOG ENTRY' D type *,' -- ',logbuf 0277 else if (isave.eq.2) then ! just used a saved log entry 0278 jsave=0 ! indicate no saved entries 0279 hldlog=0 ! get a new log entry D type *,'TIMELOG -- USED SAVED LOG ENTRY' D type *,' -- ',logbuf 0280 endif PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 8 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR c 0281 isave=jsave d if (isave.ne.0) TYPE *,'ISAVE:',ISAVE 0282 goto 140 0283 endif c c find time difference between logtim and acttim c 0284 decode(8,9145,logtim) hron,minon,secon 0285 9145 format(i2,1x,i2,1x,i2) 0286 decode(8,9145,acttim) hr,min,sec 0287 rlgtim=float(hron)*60.+float(minon)+float(secon)/60. 0288 ractim=float(hr)*60.+float(min)+float(sec)/60. 0289 delta=ractim-rlgtim c d TYPE *,'LOGON ACTTTY:',ACTTTY,' LOGTTY:',LOGTTY 0290 if (acttty.eq.logtty) then ! account entry and log entry c match - same terminal 0291 if (delta .gt. 4.01) then 0292 type *, + 'TIMELOG -- CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0293 type *,' TIME IS TOO EARLY:',DELTA 0294 type *,logbuf 0295 write(6,1161) + 'TIMELOG --',logdat, + 'CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY ON TT',LOGTTY,':' 0296 1161 FORMAT('0',a,2x,a,2x,a,a,a) 0297 write(6,117) + ' TIME IS TOO EARLY, DELTA: ',delta 0298 Write(6,115) logbuf d type *,hron,minon,secon,hr,min,sec,delta 0299 actbil='LOST REVENUE' 0300 call login(logtty,logdat,logtim,loguic,actbil,iterml) 0301 if (isave.eq.1) then ! we have a saved log entry 0302 logbuf=savbuf ! pull it out 0303 hldlog=1 ! don't read a new log entry 0304 jsave=2 ! indicate using saved entry D type *,'TIMELOG -- RESTORING SAVED LOG ENTRY' D type *,' -- ',logbuf 0305 else if (isave.eq.2) then ! just used a saved log entry 0306 jsave=0 ! indicate no saved entries 0307 hldlog=0 ! get a new log entry D type *,'TIMELOG -- USED SAVED LOG ENTRY' D type *,' -- ',logbuf 0308 endif c 0309 isave=jsave d if (isave.ne.0) TYPE *,'ISAVE:',ISAVE 0310 goto 140 0311 else if (delta.lt.0.0) then 0312 stop 'TIMELOG -- ERROR WITH TSTTIM: -''VE DELTA' 0313 endif c 0314 if (actuic.ne.loguic .and. itype.eq.4) then d type *,'TIMELOG -- MISMATCHED UIC''S ON LOGIN' PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 9 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR d type *,' -- loguic: ',loguic,' actuic:', d + actuic d type *,' -- using console log UIC' 0315 write(6,116) 'TIMELOG --',logdat, + 'MISMATCHED UIC''S ON LOGIN' 0316 write(6,115) + ' -- using console log UIC' 0317 endif c 0318 i=index(actbuf,'is') 0319 if (i.eq.0) i=index(actbuf,'IS') 0320 j2=index(actbuf,'.') 0321 actbil=actbuf(i+3:j2-1) d TYPE 137,'LOGIN--',ACTTTY,LOGDAT,LOGTIM,LOGUIC,ACTBIL 0322 if (itype.eq.-4) loguic=actuic 0323 call login(acttty,logdat,logtim,loguic,actbil,iterm) 0324 jsave=0 c 0325 if (isave.eq.1) then ! we have a saved log entry 0326 logbuf=savbuf ! pull it out 0327 hldlog=1 ! don't read a new log entry 0328 jsave=2 ! indicate using saved entry D type *,'TIMELOG -- RESTORING SAVED LOG ENTRY' D type *,' -- ',logbuf 0329 else if (isave.eq.2) then ! just used a saved log entry 0330 jsave=0 ! indicate no saved entries 0331 hldlog=0 ! get a new log entry D type *,'TIMELOG -- USED SAVED LOG ENTRY' D type *,' -- ',logbuf 0332 endif c 0333 isave=jsave d if (isave.ne.0) TYPE *,'ISAVE:',ISAVE 0334 goto 130 ! used this account entry c go back for a new one c c ! woops, not the same terminal 0335 else ! more account entries d TYPE *,'WOOPS......WRONG TERMINAL' 0336 if (delta.gt.6.0) then ! only save 6 mins back 0337 type *, + 'TIMELOG -- CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0338 type *,' TOO EARLY TO SAVE' 0339 type *,' ',logbuf 0340 write(6,116) + 'TIMELOG --',logdat, + 'CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0341 write(6,117) + ' TOO EARLY FOR SAVE, DELTA: ',delta 0342 write(6,115)logbuf d type *,hron,minon,secon,hr,min,sec,delta 0343 actbil='LOST REVENUE' 0344 call login(logtty,logdat,logtim,loguic,actbil,iterml) 0345 if (isave.eq.1) then ! we have a saved log entry 0346 logbuf=savbuf ! pull it out PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 10 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0347 hldlog=1 ! don't read a new log entry 0348 jsave=2 ! indicate using saved entry D type *,'TIMELOG -- RESTORING SAVED LOG ENTRY' D type *,' -- ',logbuf 0349 else if (isave.eq.2) then ! just used a saved log entry 0350 jsave=0 ! indicate no saved entries 0351 hldlog=0 ! get a new log entry D type *,'TIMELOG -- USED SAVED LOG ENTRY' D type *,' -- ',logbuf 0352 endif c 0353 isave=jsave d if (isave.ne.0) TYPE *,'ISAVE:',ISAVE 0354 else if (isave.eq.0) then 0355 savbuf=logbuf 0356 isave=1 D type *,'TIMELOG -- SAVING LOG ENTRY' D type *,' ',logbuf 0357 goto 140 0358 else if (isave.eq.1) then 0359 type *, + 'TIMELOG -- ACCOUNT FILE ENTRY WITHOUT CONSOLE LOGIN' 0360 type *,' -- two console logins tried' 0361 type *,' -- Current: ',logbuf 0362 type *,' -- Saved: ',savbuf 0363 write(6,116) + 'TIMELOG --',logdat, + 'ACCOUNT FILE ENTRY WITHOUT CONSOLE LOGIN' 0364 write(6,1162)' --','Saved:',savbuf 0365 write(6,1162)' --','Current:',logbuf 0366 1162 format(' ',a,x,a,x,a) 0367 backspace 1 ! back to current actbuf 0368 backspace 1 ! back to last actbuf (user is) 0369 backspace 1 ! back to last last one (login) 0370 read(1,111) j,actbuf 0371 write(4,115) actbuf(1:j) 0372 write(6,115) actbuf(1:j) 0373 read(1,111) j,actbuf 0374 write(4,115) actbuf(1:j) 0375 write(6,115) actbuf(1:j) 0376 read(1,111) j,actbuf 0377 write(4,115) actbuf(1:j) 0378 write(6,115) actbuf(1:j) 0379 backspace 2 ! go back to get current logbuf c ! after retrying saved entry c ! with a new account entry 0380 logbuf=savbuf 0381 isave=2 0382 hldlog=1 0383 goto 130 0384 else if (isave.eq.2) then 0385 type *, + 'TIMELOG -- CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0386 type *,' AFTER RESTORE FROM SAVE' 0387 type *,logbuf PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 11 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0388 write(6,116) + 'TIMELOG --',logdat, + 'CONSOLE LOGIN WITHOUT ACCOUNT FILE ENTRY' 0389 write(6,115) + ' AFTER RESTORE FROM SAVE' 0390 write(6,115) logbuf 0391 actbil='LOST REVENUE' 0392 call login(logtty,logdat,logtim,loguic,actbil,iterml) 0393 hldlog=0 0394 isave=0 0395 endif d if (isave.ne.0) TYPE *,'ISAVE:',ISAVE 0396 endif 0397 else if (itype.eq.5 .or. itype.eq.-5) then ! logout d TYPE *,'STARTING LOGOUT PROCEDURE, ITYPE = ',ITYPE 0398 if (itype.eq.5) then d TYPE *,'STANDARD LOGOUT PROCEDURE, ITYPE = ',ITYPE 0399 logtim=logbuf(1:8) 0400 i=index(logbuf,'[') 0401 j=index(logbuf(i:),']') 0402 loguic=' ' ! pad with zero's for compatibilty 0403 loguic(1:j) = logbuf(i:i+j) ! get group number d type 3939,i,j,logbuf(i:i+j),loguic 0404 if (index(logbuf,'HT') .ne. 0) then 0405 i = index(logbuf,'HT') 0406 iterml = 2 0407 else if (index(logbuf,'RT') .ne. 0) then 0408 i = index(logbuf,'RT') 0409 iterml = 4 0410 else 0411 i = index(logbuf,'TT') 0412 iterml = 1 0413 endif 0414 j=index(logbuf(i:),':') 0415 j=j+i-1 0416 logtty=' ' 0417 logtty(5-j+i:2)=logbuf(i+2:j-1) 0418 else d TYPE *,'VIRTUAL LOGOUT PROCEDURE, ITYPE = ',ITYPE 0419 logtim = logbuf(1:8) 0420 loguic = 'batch job' 0421 i=index(logbuf,'VT') 0422 j=index(logbuf(i:),':') 0423 j=j+i-1 0424 logtty=' ' 0425 logtty(5-j+i:2)=logbuf(i+2:j-1) 0426 iterml = 3 0427 endif d TYPE 153,'LOGOUT--',LOGTTY,LOGDAT,LOGTIM,LOGUIC,iterml 0428 153 FORMAT(1X,A,4X,4(':',A,':'),i2) 0429 call logout(logtty,logdat,logtim,loguic,iterml) 0430 else ! ???? 0431 write(4,115) logbuf(1:j) 0432 endif 0433 goto 140 ! get a new log entry PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 12 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0434 150 actend = actdat ! save last account date 0435 actdat='00-end-00' ! set end of account file 0436 acttty='99' 0437 hldlog=0 0438 goto 140 ! get a new log entry 0439 160 logend = logdat ! save last log date 0440 call date(logdat) 0441 write (7,165) logdat,actbgn,actend,logbgn,logend 0442 165 format('0 Summary of Accounts, compiled on ',a,//, + ' Account file from ',a,' to ',a,'.',/, + ' Logging file from ',a,' to ',a,'.',///, + t10,'Account Name',t30,'Hours',t40,'Rate',t50,'Charges',/, + t10,'------------',t30,'-----',t40,'----',t50,'-------',/) 0443 do 170 i=1,accnum 0444 if (hours(i).eq.0) goto 170 0445 write(7,175) accnam(i),hours(i),rate(i),rate(i)*hours(i) 0446 170 continue 0447 175 format(1x,t10,a,t29,f6.2,t39,f5.2,t49,f8.2) 0448 close(unit=1,dispose='save') 0449 close(unit=2,dispose='save') 0450 close(unit=3,dispose='save') 0451 close(unit=4,dispose='save') 0452 close(unit=6,dispose='save') 0453 close(unit=7,dispose='save') 0454 end PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 13 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR PROGRAM SECTIONS Number Name Size Attributes 1 $CODE1 022004 4610 RW,I,CON,LCL 2 $PDATA 005104 1314 RW,D,CON,LCL 3 $IDATA 000140 48 RW,D,CON,LCL 4 $VARS 001202 321 RW,D,CON,LCL 5 $TEMPS 000004 2 RW,D,CON,LCL 8 CHARS 021050 4372 RW,D,OVR,GBL 9 NUMS 000364 122 RW,D,OVR,GBL VARIABLES Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address ACCNUM R*4 9-000000 ACTBGN CHR 4-000174 ACTBIL CHR 4-000244 ACTBUF CHR 4-000326 ACTDAT CHR 4-000152 ACTEND CHR 4-000216 ACTTIM CHR 4-000132 ACTTTY CHR 4-000240 ACTUIC CHR 4-000055 ACT1ST R*4 4-001116 DELTA R*4 4-001176 DUIC CHR 4-000121 FILNAM CHR 4-000270 FILTYP CHR 4-000052 HLDLOG R*4 4-001124 HR I*2 4-001076 HRON I*2 4-001100 I I*2 4-001114 IRELOG I*2 4-001134 ISAVE I*2 4-001162 ITERM I*2 4-001136 ITERML I*2 4-001160 ITTY I*2 4-001150 ITYPE I*2 4-001154 I1 I*2 4-001132 I2 I*2 4-001140 I3 I*2 4-001142 J I*2 4-001130 JSAVE I*2 4-001164 J1 I*2 4-001156 J2 I*2 4-001152 LOGBGN CHR 4-000205 LOGBUF CHR 4-000516 LOGDAT CHR 4-000163 LOGEND CHR 4-000227 LOGTIM CHR 4-000142 LOGTTY CHR 4-000242 LOGUIC CHR 4-000066 LOG1ST I*2 4-001122 MIN I*2 4-001106 MINON I*2 4-001110 MONTH CHR 4-000000 NEWUIC CHR 4-000077 OLDI R*4 4-001144 OLDUIC CHR 4-000110 RACTIM R*4 4-001172 RLGTIM R*4 4-001166 RLTN I*2 4-001112 SAVBUF CHR 4-000706 SEC I*2 4-001102 SECON I*2 4-001104 YESNO CHR 4-000047 ARRAYS Name Type Address Size Dimensions ACCNAM CHR 8-016570 001130 300 (30) ACCNM2 CHR 8-017720 001130 300 (30) BILLNG CHR 8-010250 006320 1640 (0:40,4) DATEON CHR 8-005344 002704 738 (0:40,4) HOURS R*4 9-000174 000170 60 (30) MONTHS CHR 4-000003 000044 18 (12) RATE R*4 9-000004 000170 60 (30) TIMEON CHR 8-002704 002440 656 (0:40,4) UICON CHR 8-000000 002704 738 (0:40,4) LABELS Label Address Label Address Label Address Label Address Label Address 50 1-000054 55' 2-000000 56' 2-000002 60 1-000344 90' 2-000064 95' 2-000122 100' 2-000170 101' 2-000304 110' 2-000006 111' 2-000010 115' 2-000014 116' 2-000030 117' 2-000044 120' 2-000244 125 ** 130 1-002774 135' 2-000354 137' ** 140 1-006120 141' ** 145 ** 150 1-021036 153' ** 160 1-021166 165' 2-000456 170 1-021642 175' 2-001022 1151' 2-000020 1161' 2-000430 1162' 2-000444 PDP-11 FORTRAN-77 V5.0-0 13:47:35 10-Apr-86 Page 14 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 3939' ** 9115' 2-000404 9140 1-006144 9145' 2-000414 69696' 2-000360 FUNCTIONS AND SUBROUTINES REFERENCED CLENUP CLOS$ DATE LOGIN LOGOUT OPEN$ TSTTIM TYPE $INDEX Total Space Allocated = 052112 10789 PDP-11 FORTRAN-77 V5.0-0 13:48:33 10-Apr-86 Page 15 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR c c c 0001 subroutine login(tty,date,time,uic,accnt,iterm) 0002 character*2 tty 0003 character*9 uic,uicon(0:40,4) 0004 character*8 time,timeon(0:40,4) 0005 character*9 date,dateon(0:40,4) 0006 character*20 accnt,billng(0:40,4),accnam 0007 common /chars/ uicon,timeon,dateon,billng,accnam(30) 0008 decode (2,100,tty) itty 0009 100 format(i2) 0010 if ( uicon(itty,iterm).ne.'idle ttxx' ) then D type *,'TIMELOG -- LOGIN TO LOGGED IN TERMINAL' 0011 call logout(tty,date,time,uic,iterm) 0012 endif d TYPE *,'LOGIN: ',ITTY,iterm 0013 uicon(itty,iterm)=uic 0014 timeon(itty,iterm)=time 0015 dateon(itty,iterm)=date 0016 billng(itty,iterm)=accnt d TYPE 110,UIC,TIME,DATE,ACCNT d TYPE 110,UICON(ITTY,iterm),TIMEON(ITTY,iterm),DATEON(ITTY,iterm) d + ,BILLNG(ITTY,iterm) 0017 110 FORMAT(1X,4(':',A,':')) 0018 return 0019 end PDP-11 FORTRAN-77 V5.0-0 13:48:33 10-Apr-86 Page 16 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR PROGRAM SECTIONS Number Name Size Attributes 1 $CODE1 000534 174 RW,I,CON,LCL 2 $PDATA 000016 7 RW,D,CON,LCL 3 $IDATA 000064 26 RW,D,CON,LCL 4 $VARS 000002 1 RW,D,CON,LCL 8 CHARS 017720 4072 RW,D,OVR,GBL ENTRY POINTS Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address LOGIN 1-000000 VARIABLES Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address ACCNT CHR F-000012* DATE CHR F-000004* ITERM I*2 F-000014* ITTY I*2 4-000000 TIME CHR F-000006* TTY CHR F-000002* UIC CHR F-000010* ARRAYS Name Type Address Size Dimensions ACCNAM CHR 8-016570 001130 300 (30) BILLNG CHR 8-010250 006320 1640 (0:40,4) DATEON CHR 8-005344 002704 738 (0:40,4) TIMEON CHR 8-002704 002440 656 (0:40,4) UICON CHR 8-000000 002704 738 (0:40,4) LABELS Label Address Label Address Label Address Label Address Label Address 100' 2-000000 110' ** FUNCTIONS AND SUBROUTINES REFERENCED LOGOUT Total Space Allocated = 020560 4280 No FPP Instructions Generated PDP-11 FORTRAN-77 V5.0-0 13:48:36 10-Apr-86 Page 17 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR c c c 0001 subroutine clenup(date,time,uic) 0002 character*2 tty,dtty 0003 character*9 uic,uicon(0:40,4),duic 0004 character*8 time,timeon(0:40,4) 0005 character*9 date,dateon(0:40,4) 0006 character*20 accnt,billng(0:40,4),accnam,accnm2 0007 common /chars/ uicon,timeon,dateon,billng,accnam(30),accnm2(30) 0008 common /nums/ accnum,rate(30),hours(30) 0009 do 105 i=0,40 0010 do 105 j=1,4 0011 if (uicon(i,j).ne.'idle ttxx') then 0012 do 9105 i9105=5,6 0013 write(i9105,9101) + 'TIMELOG -- IMPROPER SHUTDOWN: TERMINAL ',i, + ' STILL ACTIVE.' 0014 9101 format('0',a,i2,a) 0015 write(6,9102) dateon(i,j),timeon(i,j),billng(i,j) 0016 9102 format(' ON AT:',2x,a,2x,a,' ; BILLING TO: ',a) 0017 9105 continue 0018 if (date.eq.dateon(i,j)) then 0019 write(5,9107) 0020 write(6,9107) 0021 9107 format(' SYSTEM CRASH ASSUMED: IMPLIED LOGOFF AT' + ,' START-UP') 0022 100 format(i2) 0023 encode(2,100,dtty) i 0024 duic=uicon(i,j) 0025 call logout(dtty,date,time,duic,j) 0026 endif 0027 endif 0028 uicon(i,j)='idle ttxx' 0029 dateon(i,j)=date 0030 timeon(i,j)=time 0031 billng(i,j)='none' 0032 105 continue 0033 return 0034 end PDP-11 FORTRAN-77 V5.0-0 13:48:36 10-Apr-86 Page 18 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR PROGRAM SECTIONS Number Name Size Attributes 1 $CODE1 001314 358 RW,I,CON,LCL 2 $PDATA 000276 95 RW,D,CON,LCL 3 $IDATA 000114 38 RW,D,CON,LCL 4 $VARS 000050 20 RW,D,CON,LCL 8 CHARS 021050 4372 RW,D,OVR,GBL 9 NUMS 000364 122 RW,D,OVR,GBL ENTRY POINTS Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address CLENUP 1-000000 VARIABLES Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address ACCNT CHR 4-000015 ACCNUM R*4 9-000000 DATE CHR F-000002* DTTY CHR 4-000002 DUIC CHR 4-000004 I I*2 4-000042 I9105 I*2 4-000046 J I*2 4-000044 TIME CHR F-000004* TTY CHR 4-000000 UIC CHR F-000006* ARRAYS Name Type Address Size Dimensions ACCNAM CHR 8-016570 001130 300 (30) ACCNM2 CHR 8-017720 001130 300 (30) BILLNG CHR 8-010250 006320 1640 (0:40,4) DATEON CHR 8-005344 002704 738 (0:40,4) HOURS R*4 9-000174 000170 60 (30) RATE R*4 9-000004 000170 60 (30) TIMEON CHR 8-002704 002440 656 (0:40,4) UICON CHR 8-000000 002704 738 (0:40,4) LABELS Label Address Label Address Label Address Label Address Label Address 100' 2-000170 105 ** 9101' 2-000000 9102' 2-000010 9105 ** 9107' 2-000066 FUNCTIONS AND SUBROUTINES REFERENCED LOGOUT PDP-11 FORTRAN-77 V5.0-0 13:48:36 10-Apr-86 Page 19 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR Total Space Allocated = 023432 5005 No FPP Instructions Generated PDP-11 FORTRAN-77 V5.0-0 13:48:40 10-Apr-86 Page 20 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR c c c 0001 subroutine logout(tty,date,time,uic,iterm) 0002 character*2 tty,typ(4) 0003 character*3 month,months(12) 0004 character*9 uic,uicon(0:40,4) 0005 character*8 time,timeon(0:40,4) 0006 character*9 date,dateon(0:40,4) 0007 character*20 accnt,accnt1,billng(0:40,4),accnam,accnm2 0008 real hours 0009 integer hr,hron,sec,secon,min,minon 0010 common /chars/ uicon,timeon,dateon,billng,accnam(30),accnm2(30) 0011 common /nums/ accnum,rate(30),hours(30) 0012 data months/'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG', + 'SEP','OCT','NOV','DEC'/ 0013 data typ /'TT','HT','VT','RT'/ 0014 if (tty.eq.'ff') then 0015 istrt = 0 0016 iend = 40 0017 itrms = 1 0018 itrme = 4 0019 else 0020 decode (2,100,tty) itty 0021 100 format(i2) 0022 istrt=itty 0023 iend=itty 0024 itrms = iterm 0025 itrme = iterm 0026 endif d type *,'in logout, tty:',tty 0027 do 200 j200=itrms,itrme 0028 do 200 i200=istrt,iend 0029 if ( uicon(i200,j200).eq.'idle ttxx') then 0030 if (tty.ne.'ff') type *,'TIMELOG -- TERMINAL ALREADY IDLE' d type *,' idle on tty: ',i200,' type ',j200 0031 else 0032 if ( uic.ne.uicon(i200,j200) .and. uic.ne.'batch job' ) then 0033 write(6,110) date,time,uic,uicon(i200,j200) d write(5,110) date,time,uic,uicon(i200,j200) 0034 110 format('0','TIMELOG -- ',a,x,a,x,'LOGOUT FROM ',a, + ':',3x,'LOGIN ONTO ',a,'.') 0035 endif 0036 uicon(i200,j200)='idle ttxx' 0037 acct=0 0038 accnt=billng(i200,j200) 0039 accnt1=accnt 0040 115 do 120 i120=1,accnum 0041 120 if ( accnt.eq.accnam(i120) + .or. + accnt.eq.accnm2(i120) ) acct=i120 0042 if (acct.eq.0) then 0043 if (index(accnt,'CLASS WORK') .ne. 0) then 0044 accnt1=accnt 0045 accnt='CLASS WORK' PDP-11 FORTRAN-77 V5.0-0 13:48:40 10-Apr-86 Page 21 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0046 else 0047 type *,'TIMELOG -- INVALID BILLING ACCOUNT: ',accnt 0048 write(6,116) 'TIMELOG -- INVALID BILLING ACCOUNT:',accnt 0049 116 format('0',a,x,a:,x,a:,x,a:) 0050 accnt='unknown account' 0051 accnt1=accnt 0052 endif 0053 goto 115 0054 endif 0055 if ( date.ne.dateon(i200,j200) ) then 0056 decode(9,125,dateon(i200,j200) ) iday,month,iyear 0057 125 format(i2,1x,a,1x,i2) 0058 do 130 i130=1,12 0059 130 if ( month.eq.months(i130) ) imonth=i130 0060 decode(9,125,date) idayx,month,iyearx 0061 do 135 i135=1,12 0062 135 if ( month.eq.months(i135) ) imnthx=i135 0063 if ( imonth.ne.imnthx + .or. + iyear.ne.iyearx ) then d TYPE *,IMONTH,IMNTHX,IYEAR,IYEARX 0064 type 140,dateon(i200,j200),date 0065 140 format('$TIMELOG -- HOW MANY DAYS', + ' BETWEEN: ',A,' AND ',A,'? ') 0066 accept 143,idays 0067 143 format(i3) 0068 else 0069 idays=iday-idayx 0070 endif 0071 else 0072 idays=0 0073 endif 0074 decode(8,145,timeon(i200,j200)) hron,minon,secon 0075 145 format(i2,1x,i2,1x,i2) 0076 decode(8,145,time) hr,min,sec 0077 rhours=idays*24. 0078 rhours=rhours + float(hr-hron) 0079 rhours=rhours + (float(min-minon))/60. 0080 rhours=rhours + (float(sec-secon))/3600. 0081 if (rhours.lt.0.005) rhours=0.0 0082 rcost=rhours * rate(acct) d TYPE *,'LOGOUT: ',i200,j200 d TYPE *,' ON AT: ',HRON,MINON,SECON d TYPE *,' OFF AT: ',HR,MIN,SEC d TYPE *,' DELTA: ',RHOURS 0083 write(6,150) dateon(i200,j200),timeon(i200,j200),typ(j200),i200, + date,time, + uic,accnt1, + rhours,rate(acct), + rcost 0084 150 format('0',3x,a,2x,a,2x,'Start of user session on ',a ,i2 + ,/,4x,a,2x,a,2x,'End of user session:' + ,/,25x,' Account number ',a,'; Bill to ',a + ,/,25x,' Connect time: ',f8.4,' @Rate' + ,' of $',f5.2,'/hr.' PDP-11 FORTRAN-77 V5.0-0 13:48:40 10-Apr-86 Page 22 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR + ,/,25x,' Total cost: ',f6.2) 0085 hours(acct)=hours(acct)+rhours 0086 endif 0087 200 continue 0088 210 continue 0089 return 0090 end PDP-11 FORTRAN-77 V5.0-0 13:48:40 10-Apr-86 Page 23 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR PROGRAM SECTIONS Number Name Size Attributes 1 $CODE1 004066 1051 RW,I,CON,LCL 2 $PDATA 000776 255 RW,D,CON,LCL 3 $IDATA 000120 40 RW,D,CON,LCL 4 $VARS 000222 73 RW,D,CON,LCL 5 $TEMPS 000010 4 RW,D,CON,LCL 8 CHARS 021050 4372 RW,D,OVR,GBL 9 NUMS 000364 122 RW,D,OVR,GBL ENTRY POINTS Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address LOGOUT 1-000000 VARIABLES Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address ACCNT CHR 4-000057 ACCNT1 CHR 4-000103 ACCNUM R*4 9-000000 ACCT R*4 4-000162 DATE CHR F-000004* HR I*2 4-000130 HRON I*2 4-000132 IDAY I*2 4-000170 IDAYS I*2 4-000210 IDAYX I*2 4-000200 IEND I*2 4-000146 IMNTHX I*2 4-000206 IMONTH I*2 4-000176 ISTRT I*2 4-000144 ITERM I*2 F-000012* ITRME I*2 4-000152 ITRMS I*2 4-000150 ITTY I*2 4-000154 IYEAR I*2 4-000172 IYEARX I*2 4-000202 I120 I*2 4-000166 I130 I*2 4-000174 I135 I*2 4-000204 I200 I*2 4-000160 J200 I*2 4-000156 MIN I*2 4-000140 MINON I*2 4-000142 MONTH CHR 4-000010 RCOST R*4 4-000216 RHOURS R*4 4-000212 SEC I*2 4-000134 SECON I*2 4-000136 TIME CHR F-000006* TTY CHR F-000002* UIC CHR F-000010* ARRAYS Name Type Address Size Dimensions ACCNAM CHR 8-016570 001130 300 (30) ACCNM2 CHR 8-017720 001130 300 (30) BILLNG CHR 8-010250 006320 1640 (0:40,4) DATEON CHR 8-005344 002704 738 (0:40,4) HOURS R*4 9-000174 000170 60 (30) MONTHS CHR 4-000013 000044 18 (12) RATE R*4 9-000004 000170 60 (30) TIMEON CHR 8-002704 002440 656 (0:40,4) TYP CHR 4-000000 000010 4 (4) UICON CHR 8-000000 002704 738 (0:40,4) LABELS Label Address Label Address Label Address Label Address Label Address 100' 2-000000 110' 2-000004 115 1-001202 116' 2-000076 120 ** 125' 2-000116 130 ** 135 ** 140' 2-000130 143' 2-000216 PDP-11 FORTRAN-77 V5.0-0 13:48:40 10-Apr-86 Page 24 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 145' 2-000222 150' 2-000236 200 ** 210 ** FUNCTIONS AND SUBROUTINES REFERENCED $INDEX Total Space Allocated = 027072 5917 PDP-11 FORTRAN-77 V5.0-0 13:48:50 10-Apr-86 Page 25 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR c c c 0001 subroutine type(logbuf,itype) 0002 character*120 logbuf 0003 if (index(logbuf,'COT -- Date').ne.0) then 0004 itype=1 0005 else if (index(logbuf,'ERRLOG').ne.0) then 0006 itype=2 0007 else if (index(logbuf,'***').ne.0) then 0008 itype=3 0009 else if (index(logbuf,'terminated').ne.0) then 0010 itype=3 0011 else if (index(logbuf,'Login').ne.0) then 0012 itype=4 0013 else if (index(logbuf,'Logout').ne.0) then 0014 itype=5 0015 else if (index(logbuf,'CBDLAB::').ne.0) then 0016 itype=6 0017 else if (index(logbuf,'CEDLAB::').ne.0) then 0018 itype=6 0019 else if (index(logbuf,'Batch job').ne.0) then 0020 if (index(logbuf,'started').ne.0) then 0021 itype = -4 0022 else if (index(logbuf,'comp').ne.0) then 0023 itype = -5 0024 endif 0025 else 0026 itype=0 0027 endif 0028 return 0029 end PDP-11 FORTRAN-77 V5.0-0 13:48:50 10-Apr-86 Page 26 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR PROGRAM SECTIONS Number Name Size Attributes 1 $CODE1 001062 281 RW,I,CON,LCL 2 $PDATA 000172 61 RW,D,CON,LCL 3 $IDATA 000102 33 RW,D,CON,LCL ENTRY POINTS Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address TYPE 1-000000 VARIABLES Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address ITYPE I*2 F-000004* LOGBUF CHR F-000002* FUNCTIONS AND SUBROUTINES REFERENCED $INDEX Total Space Allocated = 001356 375 No FPP Instructions Generated PDP-11 FORTRAN-77 V5.0-0 13:48:53 10-Apr-86 Page 27 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR c c c 0001 subroutine tsttim(acttim,actdat,logtim,logdat,rltn) 0002 character*120 actbuf 0003 character*9 actdat,logdat 0004 character*8 acttim,logtim 0005 character*3 month,months(12) 0006 integer rltn 0007 integer hr,hron,sec,secon,min,minon 0008 data months/'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG', + 'SEP','OCT','NOV','DEC'/ 0009 if (actdat.ne.logdat) then 0010 decode(9,125,actdat) iday,month,iyear 0011 125 format(i2,1x,a,1x,i2) 0012 do 130 i130=1,12 0013 130 if ( month.eq.months(i130) ) imonth=i130 d TYPE 133,LOGDAT d133 FORMAT('0:',A,':') 0014 decode(9,125,logdat) idayx,month,iyearx 0015 do 135 i135=1,12 0016 135 if ( month.eq.months(i135) ) imnthx=i135 0017 if ( iyearx.gt.iyear ) then 0018 rltn=-1 0019 else if ( iyearx.lt.iyear ) then 0020 rltn=1 0021 else if ( imnthx.gt.imonth) then 0022 rltn=-1 0023 else if ( imnthx.lt.imonth) then 0024 rltn=1 0025 else if ( idayx.gt.iday) then 0026 rltn=-1 0027 else if ( idayx.lt.iday) then 0028 rltn=1 0029 else 0030 type *,'TIMELOG -- TSTTIM - LOGDAT = ACTDAT :' 0031 type *,' ',logdat,actdat 0032 endif 0033 else if (acttim.ne.logtim) then 0034 decode(8,145,acttim) hron,minon,secon 0035 145 format(i2,1x,i2,1x,i2) 0036 decode(8,145,logtim) hr,min,sec 0037 timact=float(secon) + 60. * ( float(minon) + 60. * float(hron) ) 0038 timlog=float(sec) + 60. * ( float(min) + 60. * float(hr) ) 0039 if (timact.gt.timlog) rltn=1 c 0040 if (timact.lt.timlog) then 0041 rltn=-1 0042 type *, + 'TIMELOG -- ACCOUNT FILE ENTRY WITHOUT CONSOLE LOGIN' 0043 write(6,116) + 'TIMELOG --',logdat, + 'ACCOUNT FILE ENTRY WITHOUT CONSOLE LOGIN' 0044 backspace 1 ! back to current actbuf 0045 backspace 1 ! back to last actbuf (user is) PDP-11 FORTRAN-77 V5.0-0 13:48:53 10-Apr-86 Page 28 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR 0046 backspace 1 ! back to last last one (login) 0047 read(1,111) j,actbuf 0048 write(4,115) actbuf(1:j) 0049 write(6,115) actbuf(1:j) 0050 read(1,111) j,actbuf 0051 write(4,115) actbuf(1:j) 0052 write(6,115) actbuf(1:j) 0053 read(1,111) j,actbuf 0054 write(4,115) actbuf(1:j) 0055 write(6,115) actbuf(1:j) 0056 110 format(a) ! input for character 0057 111 format(q,a) ! input for character with transfer count 0058 115 format(1x,a) ! output for character 0059 116 format('0',a,2x,a,2x,a) ! output for character with double spacing c and multiple outputs 0060 endif c 0061 if (timact.eq.timlog) then 0062 type *,'TIMELOG -- TSTTIM - LOGTIM = ACTTIM :' 0063 type *,' ',logtim,acttim 0064 endif c 0065 else 0066 rltn=0 0067 endif 0068 return 0069 end PDP-11 FORTRAN-77 V5.0-0 13:48:53 10-Apr-86 Page 29 TIMELOG.FTN;75 /CK/F77/OP/TR:ALL/WR PROGRAM SECTIONS Number Name Size Attributes 1 $CODE1 002516 679 RW,I,CON,LCL 2 $PDATA 000352 117 RW,D,CON,LCL 3 $IDATA 000010 4 RW,D,CON,LCL 4 $VARS 000306 99 RW,D,CON,LCL ENTRY POINTS Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address TSTTIM 1-000000 VARIABLES Name Type Address Name Type Address Name Type Address Name Type Address Name Type Address ACTBUF CHR 4-000000 ACTDAT CHR F-000004* ACTTIM CHR F-000002* HR I*2 4-000240 HRON I*2 4-000242 IDAY I*2 4-000254 IDAYX I*2 4-000264 IMNTHX I*2 4-000272 IMONTH I*2 4-000262 IYEAR I*2 4-000256 IYEARX I*2 4-000266 I130 I*2 4-000260 I135 I*2 4-000270 J I*2 4-000304 LOGDAT CHR F-000010* LOGTIM CHR F-000006* MIN I*2 4-000250 MINON I*2 4-000252 MONTH CHR 4-000170 RLTN I*2 F-000012* SEC I*2 4-000244 SECON I*2 4-000246 TIMACT R*4 4-000274 TIMLOG R*4 4-000300 ARRAYS Name Type Address Size Dimensions MONTHS CHR 4-000173 000044 18 (12) LABELS Label Address Label Address Label Address Label Address Label Address 110' ** 111' 2-000026 115' 2-000032 116' 2-000036 125' 2-000000 130 ** 135 ** 145' 2-000012 Total Space Allocated = 003406 899