Table of Contents

DFSORT

Table Of Contents

Source Code

DFSORT.txt
  1. *** THE *DFSORT* CONTROL STATEMENT SORTS THE *OUTPUT* FROM
  2. * THE DAYFILE DUMPING UTILITIES TO THE FILE SPECIFIED.
  3. *
  4. * THE CONTROL STATEMENT FORMAT IS -
  5. *
  6. * DFSORT(D=LFN1,L=LFN2,S=AAA,F=999,TN=NAME)
  7. *
  8. * LFN1 - NAME OF THE FILE TO SORT FROM. IF THIS
  9. * PARAMETER IS OMITTED, FILE *DAYFILE* IS
  10. * ASSUMED.
  11. *
  12. * LFN2 - NAME OF THE FILE TO WRITE TO. IF THIS
  13. * PARAMETER IS OMITTED, FILE *OUTPUT* IS
  14. * ASSUMED.
  15. *
  16. * AAA - LAST THREE CHARACTERS OF THE JOB SEQUENCE
  17. * NUMBER TO START THE SORT. IF THIS PARAMETER
  18. * IS OMITTED, THE SORT BEGINS WITH THE
  19. * CHARACTER STRING *AAA*.
  20. *
  21. * 999 - LAST THREE CHARACTERS OF THE JOB SEQUENCE
  22. * NUMBER TO STOP THE SORT. IF THIS PARAMETER
  23. * IS OMITTED, THE SORT ENDS WITH THE
  24. * CHARACTER STRING *999*.
  25. *
  26. * NAME - TEST NAME IS ONE OF THE FOLLOWING -
  27. * P - THE TEST JOB PASSED.
  28. * F - THE TEST JOB FAILED.
  29. * QAQ - TEST JOB NAME.
  30.  
  31.  
  32. OVERLAY(DFSORT,0,0)
  33. PROGRAM DFSORT(TAPE1,OUTPUT,TAPE2=OUTPUT,
  34. 1 TAPE3,TAPE4)
  35. COMMON /DATA/JOBS,JOBF,ITN
  36. DIMENSION JJOB(1000),III(1000),KK(1000)
  37. DIMENSION LINE(8)
  38. DIMENSION ICHAR(50)
  39. DIMENSION JOB(1000)
  40. DIMENSION TIMES(1000,4)
  41. DIMENSION IRUN(1000)
  42. DIMENSION MSG(1000,3)
  43. DIMENSION NTIME(3)
  44. DIMENSION MRUN(50,3)
  45. INTEGER SJOB
  46. INTEGER STIME
  47. INTEGER FJOB
  48. INTEGER FTIME
  49. REAL MSTIME
  50. REAL MTTIME
  51. 1000 FORMAT (BZ,8A10)
  52. 1001 FORMAT (50R1)
  53. 2000 FORMAT(1H1,19X,'DAYFILE SUMMARY - ',A10,2X,
  54. 1 ' (FROM ....',R3,'. TO ....',R3,'.)',11X,'PAGE',I4,/,
  55. 2 3X,' JOB',3X,' NAME ',3X,' CP TIME',3X,'SYS RSRCE',
  56. 3 3X,' MS USAGE',3X,' MT USAGE',
  57. 4 3X,' RUN ',5X,'LAST DAYFILE MESSAGE.'/
  58. 5 26X,'(SECS)',6X,'(UNTS)',6X,'(KUNS)',6X,'(KUNS)'//)
  59. 2001 FORMAT (2X,I4,1H.,3X,A10,4(3X,F9.3),3X,A10,5X,3A10)
  60. 2002 FORMAT (/,14X,'TOTALS',4(1X,F11.3))
  61. 2003 FORMAT (/,13X,'FINISH TIME - ',A10,2X,' AT END OF - ',A10,
  62. 1 /14X,'START TIME - ',A10,' AT START OF - ',A10)
  63. 2004 FORMAT (12X,'ELAPSED TIME - ',I2,' HR. ',I2,' MIN. ',I2,
  64. 1 ' SEC.',' (',I6,' SEC.)')
  65. 2005 FORMAT (1H1,19X,'DAYFILE SUMMARY - ',A10,40X,'PAGE',I4,/,
  66. 1 10X,'RUN',7X,' USED'//)
  67. 2006 FORMAT (10X,A10,I5)
  68. 2007 FORMAT(1H1,19X,' A C R SUMMARY - ',A10,2X,
  69. 1 '(FROM ....',R3,'. TO ....',R3,'.)',11X,'PAGE',I4)
  70. 2008 FORMAT (10X,4A10)
  71. 2009 FORMAT (BZ,I4,3A10,3A10)
  72. 2010 FORMAT(//36X,'NUMBER OF PASSES =',I4/)
  73. 2011 FORMAT(//36X,'NUMBER OF FAILS =',I4/)
  74. 2012 FORMAT(//36X,'TOTAL NUMBER =',I4/)
  75. 2013 FORMAT (2X,I4,1H.,3X,A10,3X,A10,3X,3A10,6X,A10)
  76. 2014 FORMAT (3X,' JOB',2X,' NAME ',3X,' TEST NAME ',
  77. 1 3X,'ACR MESSAGE ',22X,' TYPE ',/)
  78. 2015 FORMAT(3X,' JOB',2X,' NAME ',3X,' TEST NAME ',
  79. 1 3X,'ACR MESSAGE ',22X,' TYPE ',/,19X,'(TN=',A3,')')
  80. 3000 FORMAT (26X,F10.3,4X)
  81. 3001 FORMAT (1X,I2,1X,I2,1X,I2,1X)
  82. 3002 FORMAT (5X,I3,2X)
  83.  
  84. ** ACCOUNTING CONSTANTS.
  85.  
  86. DATA BFILL /10H /
  87. DATA IRUN /1000 * O"5555 5555 5555 5555 5555"/
  88. DATA NUECP /L"UECP"/
  89. DATA NSECS /R"SECS"/
  90. DATA NAESR /L"AESR"/
  91. DATA NUNTS /R"UNTS"/
  92. DATA NUEMS /L"UEMS"/
  93. DATA NKUNS /R"KUNS"/
  94. DATA NUEMT /L"UEMT"/
  95. DATA MASK1 /O"7700 0000 0000 0000 0000"/
  96. DATA MASK2 /O"7777 0000 0000 0000 0000"/
  97. DATA MASK3 /O"7777 7700 0000 0000 0000"/
  98. DATA MASK4R/O"0000 0000 0000 7777 7777"/
  99. DATA MASK4L/O"7777 7777 0000 0000 0000"/
  100. DATA MASK8 /O"7777 7777 7777 7777 0000"/
  101. DATA MASK9 /O"0077 7777 7700 0000 0000"/
  102. DATA MASK10 /O"0000 0000 0000 0000 0077"/
  103. DATA IQM1 /O"0021 0121 0100 0000 0000"/
  104. DATA IQM2 /O"0000 0000 0000 0000 0020"/
  105. *
  106. ** INITIALIZE CPU, MS, MT, SRU ACCUMULATORS.
  107. *
  108. DATA CPTIME /0.0/
  109. DATA MSTIME /0.0/
  110. DATA MTTIME /0.0/
  111. DATA SRTIME /0.0/
  112. DATA TIMES /4000 * 0.0/
  113. *
  114. ** INITIALIZE LAST DAYFILE MESSAGE TO *(NONE)*.
  115. *
  116. DATA MSG /1000 * 8H (NONE), 2000 * 1H /
  117.  
  118. ** COMPILER TABLE.
  119.  
  120. DATA MRUN(1,1) /L"COMPASS"/
  121. DATA MRUN(1,2) /O"7777 7777 7777 7700 0000"/
  122. DATA MRUN(1,3) /O"0000 0000 0000 0055 5555"/
  123. DATA MRUN(2,1) /L"SORTMRG"/
  124. DATA MRUN(2,2) /O"7777 7777 7777 7700 0000"/
  125. DATA MRUN(2,3) /O"0000 0000 0000 0055 5555"/
  126. DATA MRUN(3,1) /L"ALGOL"/
  127. DATA MRUN(3,2) /O"7777 7777 7700 0000 0000"/
  128. DATA MRUN(3,3) /O"0000 0000 0055 5555 5555"/
  129. DATA MRUN(4,1) /L"COBOL"/
  130. DATA MRUN(4,2) /O"7777 7777 7700 0000 0000"/
  131. DATA MRUN(4,3) /O"0000 0000 0055 5555 5555"/
  132. DATA MRUN(5,1) /L"RUN23"/
  133. DATA MRUN(5,2) /O"7777 7777 7700 0000 0000"/
  134. DATA MRUN(5,3) /O"0000 0000 0055 5555 5555"/
  135. DATA MRUN(6,1) /L"BASIC"/
  136. DATA MRUN(6,2) /O"7777 7777 7700 0000 0000"/
  137. DATA MRUN(6,3) /O"0000 0000 0055 5555 5555"/
  138. DATA MRUN(7,1) /L"FTN"/
  139. DATA MRUN(7,2) /O"7777 7700 0000 0000 0000"/
  140. DATA MRUN(7,3) /O"0000 0055 5555 5555 5555"/
  141. DATA MRUN(8,1) /L"RUN"/
  142. DATA MRUN(8,2) /O"7777 7700 0000 0000 0000"/
  143. DATA MRUN(8,3) /O"0000 0055 5555 5555 5555"/
  144. DATA MRUN(9,1) /L"FTN5"/
  145. DATA MRUN(9,2) /O"7777 7777 0000 0000 0000"/
  146. DATA MRUN(9,3) /O"0000 0000 5555 5555 5555"/
  147. DATA MRUN(10,1) /L"SYMPL"/
  148. DATA MRUN(10,2) /O"7777 7777 7700 0000 0000"/
  149. DATA MRUN(10,3) /O"0000 0000 0055 5555 5555"/
  150.  
  151. CALL REMARK(' VERSION 3')
  152. REWIND 1
  153. REWIND 3
  154. REWIND 4
  155. CALL DATER(DATE)
  156. IJOB = 1
  157. ITNM = 0
  158. IF(ITN.EQ.0) GO TO 7
  159. IF((ITN.AND. .NOT.MASK3).EQ.0)ITNM = MASK3
  160. IF((ITN.AND. .NOT.MASK2).EQ.0)ITNM = MASK2
  161. IF((ITN.AND. .NOT.MASK1).EQ.0)ITNM = MASK1
  162. 7 CONTINUE
  163. STIME = 0
  164. JOBS = SHIFT(JOBS,-42).AND.O"777777"
  165. JOBF = SHIFT(JOBF,-42).AND.O"777777"
  166. ITIME = 1
  167. 1 READ(1,1000,END=10000) LINE
  168. 10000 IF(EOF(1)) 100,2,100
  169.  
  170. ** CHANGE 00B TO BLANK(55B)
  171.  
  172. 2 CONTINUE
  173. DECODE(50,1001,LINE(1)) (ICHAR(I),I=1,50)
  174. DO 201 L=1,50
  175. IF(ICHAR(L) .EQ. O"00") ICHAR(L) = O"55"
  176. 201 CONTINUE
  177. ENCODE(50,1001,LINE(1)) (ICHAR(I),I=1,50)
  178.  
  179. ** DETERMINE JOB LIMITS.
  180.  
  181. JOBN = SHIFT(LINE(2),-18).AND.O"777777"
  182. IF (ITIME.EQ.0) GO TO 21
  183. IF ((LINE(2).AND.MASK8).EQ.L"SYSTEM ") GO TO 1
  184. IF ((LINE(2).AND.MASK8).EQ.L"TELEX S") GO TO 1
  185. IF ((LINE(2).AND.MASK8).EQ.L"BATCHIOS") GO TO 1
  186. IF ((LINE(2).AND.MASK8).EQ.L"EXPORTLS") GO TO 1
  187. IF ((LINE(2).AND.MASK8).EQ.L"IAFEX S") GO TO 1
  188. IF ((LINE(2).AND.MASK8).EQ.L"MSSEXECS") GO TO 1
  189. IF ((LINE(2).AND.MASK8).EQ.L"NAM S") GO TO 1
  190. IF ((LINE(2).AND.MASK8).EQ.L"RBF S") GO TO 1
  191. IF ((LINE(2).AND.MASK8).EQ.L"MAGNET S") GO TO 1
  192. IF (LINE(3).EQ.6HINPUT.) GO TO 1
  193. ITIME = 0
  194. STIME = LINE(1)
  195. SJOB = LINE(2)
  196. 21 IF(JOBN.LT.JOBS) GO TO 1
  197. IF(JOBN.GT.JOBF) GO TO 1
  198. IF(STIME.NE.0) GO TO 23
  199. STIME = LINE(1)
  200. 23 FTIME = LINE(1)
  201. FJOB = LINE(2)
  202.  
  203. ** ADD JOB NAME TO JOB LIST IF NOT IN.
  204.  
  205. INJ=0
  206. DO 31 II=1,IJOB
  207. I = II
  208. IF(JOB(I).EQ.LINE(2)) GO TO 4
  209. 31 CONTINUE
  210. JOB(I) = LINE(2)
  211. ICNT = 60
  212. JB = LINE(3)
  213.  
  214. ** DETERMINE JOB NAME LENGTH
  215.  
  216. 32 JB = SHIFT(JB,6)
  217. ICNT = ICNT - 6
  218. IF((JB.AND.O"77").LT.R"A") GO TO 33
  219. IF((JB.AND.O"77").GT.R"9") GO TO 33
  220. IF(ICNT.NE.0) GO TO 32
  221. JJOB(I) = LINE(3)
  222. GO TO 34
  223.  
  224. ** ADD BLANKS TO JOB NAME FIELD
  225.  
  226. 33 N = ICNT + 6
  227. JB = SHIFT(JB,ICNT)
  228. JJOB(I) = (JB.AND.MASK(60-N)).OR.(SHIFT(MASK(N),N).AND.BFILL)
  229. 34 CONTINUE
  230. IJOB = IJOB+1
  231. INJ=1
  232.  
  233. ** ENTER JOB TIMES.
  234.  
  235. 4 IF((LINE(4).AND.MASK4R).NE.NSECS) GO TO 41
  236. IF((LINE(3).AND.MASK4L).NE.NUECP) GO TO 41
  237. DECODE(40,3000,LINE) TIME
  238. CPTIME = CPTIME+TIME
  239. TIMES(I,1) = TIMES(I,1)+TIME
  240. GO TO 44
  241. 41 IF((LINE(4).AND.MASK4R).NE.NUNTS) GO TO 42
  242. IF((LINE(3).AND.MASK4L).NE.NAESR) GO TO 42
  243. DECODE(40,3000,LINE) TIME
  244. SRTIME = SRTIME+TIME
  245. TIMES(I,2) = TIMES(I,2)+TIME
  246. GO TO 44
  247. 42 IF((LINE(4).AND.MASK4R).NE.NKUNS) GO TO 5
  248. IF((LINE(3).AND.MASK4L).NE.NUEMS) GO TO 43
  249. DECODE(40,3000,LINE) TIME
  250. MSTIME = MSTIME+TIME
  251. TIMES(I,3) = TIMES(I,3)+TIME
  252. GO TO 44
  253. 43 IF((LINE(3).AND.MASK4L).NE.NUEMT) GO TO 1
  254. DECODE(40,3000,LINE) TIME
  255. MTTIME = MTTIME+TIME
  256. TIMES(I,4) = TIMES(I,4)+TIME
  257. 44 GO TO 1
  258.  
  259. ** DETERMINE RUN TYPE.
  260.  
  261. 5 IF(INJ.EQ.0) GO TO 50
  262. IF(JOBN.GE.JOBS) GO TO 1
  263. 50 DO 51 J=1,50
  264. IF (MRUN(J,1).EQ.0) GO TO 6
  265. IF ((LINE(3).AND.MRUN(J,2)).NE.(MRUN(J,1).AND.MRUN(J,2)))
  266. 1 GO TO 51
  267. IRUN(I) = SHIFT(((MRUN(J,1).AND.MRUN(J,2)).OR.MRUN(J,3)),42)
  268. MRUN(J,1) = MRUN(J,1)+1
  269. GO TO 6
  270. 51 CONTINUE
  271.  
  272. ** ENTER DAYFILE MESSAGE.
  273.  
  274. 6 DO 61 J=1,3
  275. 61 MSG(I,J) = LINE(J+2)
  276. IF((LINE(3).AND.MASK9).NE.IQM1) GO TO 62
  277. ITAPE =4
  278. IF((LINE(4).AND.MASK10).EQ.IQM2) ITAPE = 3
  279. IF((JJOB(I).AND.ITNM).NE.(ITN)) GO TO 62
  280. WRITE(ITAPE,2009)I,JOB(I),JJOB(I),IRUN(I),(LINE(L),L=3,5)
  281. 62 CONTINUE
  282. GO TO 1
  283.  
  284.  
  285. ** PRINT JOB TABLES
  286.  
  287. 100 LINES = 64
  288. J = IJOB-1
  289. IPAGE = 1
  290. DO 105 I=1,J
  291. IF (LINES.LT.60) GO TO 101
  292. WRITE(2,2000)DATE,JOBS,JOBF,IPAGE
  293. LINES = 4
  294. IPAGE = IPAGE+1
  295. 101 M = R"999"
  296. DO 102 K=1,J
  297. IF (JOB(K).EQ.0) GO TO 102
  298. IF ((SHIFT(JOB(K),-18).AND.O"777777").GE.M) GO TO 102
  299. L = K
  300. M = SHIFT(JOB(K),-18).AND.O"777777"
  301. 102 CONTINUE
  302. K = L
  303. WRITE(2,2001) I,JOB(K),(TIMES(K,L),L=1,4),IRUN(K),(MSG(K,L),
  304. 1 L=1,3)
  305. JOB(K) = 0
  306. III(K) = I
  307. 105 LINES = LINES+1
  308.  
  309. ** LIST TOTALS.
  310.  
  311. WRITE(2,2002) CPTIME,SRTIME,MSTIME,MTTIME
  312. WRITE(2,2003) FTIME,FJOB,STIME,SJOB
  313. DECODE(10,3001,STIME) NTIME
  314. ITIME = 3600*NTIME(1)+60*NTIME(2)+NTIME(3)
  315. DECODE(10,3001,FTIME) NTIME
  316. JTIME = 3600*NTIME(1)+60*NTIME(2)+NTIME(3)
  317. KTIME = JTIME-ITIME
  318. NTIME(1) = KTIME/3600
  319. ITIME = KTIME/60
  320. NTIME(2) = ITIME-(NTIME(1)*60)
  321. NTIME(3) = KTIME-(NTIME(2)*60)-(NTIME(1)*3600)
  322. WRITE(2,2004) NTIME,KTIME
  323.  
  324. ** LIST RUN USAGE.
  325.  
  326. WRITE(2,2005) DATE,IPAGE
  327. LINES = 4
  328. IPAGE = IPAGE+1
  329. DO 110 I=1,50
  330. IF (MRUN(I,1).EQ.0) GO TO 111
  331. J = (MRUN(I,1).AND.MRUN(I,2)) .OR. MRUN(I,3)
  332. K = MRUN(I,1).AND.O"777777"
  333. 110 WRITE(2,2006) J, K
  334. *
  335. ** AUTOMATIC CHECKOUT ROUTINES SUMMARY PROCESSOR.
  336. *
  337. 111 ENDFILE 3
  338. ENDFILE 4
  339. REWIND 3
  340. REWIND 4
  341. ITOT = 0
  342. IPASS = 0
  343. IFAIL = 0
  344. DO 112 I=1,1000
  345. KK(I)=0
  346. 112 CONTINUE
  347. ITAPE = 3
  348. DO 114 J=1,1000
  349. READ(ITAPE,2009,END=10001)I,JOB(I),JJOB(I),IRUN(I),(MSG(I,L)
  350. +,L=1,3)
  351. 10001 IF(EOF(ITAPE)) 115,113,115
  352. 113 IPASS = IPASS + 1
  353. ITOT = ITOT + 1
  354. KK(I) = III(I)
  355. 114 CONTINUE
  356. 115 IF(IPASS.EQ.0) GO TO 119
  357. LINES = 64
  358. J = J - 1
  359. DO 118 I = 1,J
  360. IF(LINES.LT.60) GO TO 116
  361. WRITE(2,2007)DATE,JOBS,JOBF,IPAGE
  362. IF(ITN.EQ.0)WRITE(2,2014)
  363. IF(ITN.NE.0)WRITE(2,2015)ITN
  364. LINES = 4
  365. IPAGE = IPAGE + 1
  366. 116 M = 1001
  367. DO 117 K=1,1000
  368. IF(KK(K).EQ.0) GO TO 117
  369. IF(KK(K).GE.M) GO TO 117
  370. L = K
  371. M = KK(K)
  372. 117 CONTINUE
  373. K = L
  374. WRITE(2,2013)KK(K),JOB(K),JJOB(K),(MSG(K,L),L=1,3),IRUN(K)
  375. KK(K) = 0
  376. LINES = LINES + 1
  377. 118 CONTINUE
  378. WRITE(2,2010)IPASS
  379. *
  380. 119 ITAPE = 4
  381. DO 121 J = 1,1000
  382. READ(ITAPE,2009,END=10002)I,JOB(I),JJOB(I),IRUN(I),(MSG(I,L)
  383. +,L=1,3)
  384. 10002 IF(EOF(ITAPE)) 122,120,122
  385. 120 IFAIL = IFAIL + 1
  386. ITOT = ITOT + 1
  387. KK(I) = III(I)
  388. 121 CONTINUE
  389. 122 IF(IFAIL.EQ.0)GO TO 126
  390. LINES = 64
  391. J = J - 1
  392. DO 125 I=1,J
  393. IF(LINES.LT.60) GO TO 123
  394. WRITE(2,2007)DATE,JOBS,JOBF,IPAGE
  395. IF(ITN.EQ.0)WRITE(2,2014)
  396. IF(ITN.NE.0)WRITE(2,2015)ITN
  397. LINES = 4
  398. IPAGE = IPAGE + 1
  399. 123 M = 1001
  400. DO 124 K = 1,1000
  401. IF(KK(K).EQ.0)GO TO 124
  402. IF(KK(K).GE.M)GO TO 124
  403. L = K
  404. M = KK(K)
  405. 124 CONTINUE
  406. K = L
  407. WRITE(2,2013)KK(K),JOB(K),JJOB(K),(MSG(K,L),L=1,3),IRUN(K)
  408. KK(K) = 0
  409. LINES = LINES + 1
  410. 125 CONTINUE
  411. WRITE(2,2011)IFAIL
  412. 126 IF(ITOT.EQ.0) GO TO 127
  413. WRITE(2,2007)DATE,JOBS,JOBF,IPAGE
  414. WRITE(2,2010)IPASS
  415. WRITE(2,2011)IFAIL
  416. WRITE(2,2012)ITOT
  417. 127 ENDFILE 2
  418. END
  419. SUBROUTINE DATER(I)
  420. CALL DATE(I)
  421. RETURN
  422. END
  423. IDENT PRESET
  424. ENTRY PRESET
  425. SYSCOM
  426. SPACE 4,10
  427. *CALL COMCMAC
  428. SPACE 4,10
  429. PRESET SB1 1
  430. SA1 ACTR
  431. SB4 X1
  432. SA4 ARGR
  433. SB5 PRSA
  434. RJ ARG PROCESS ARGUMENTS
  435. ZR X1,PRS1 IF NO ARGUMENT ERRORS
  436. MESSAGE (=C*DFSORT ARGUMENT ERROR.*)
  437. ABORT
  438. PRS1 SA1 D SET DAYFILE NAME
  439. SA2 L SET LIST FILE NAME
  440. BX6 X1
  441. LX7 X2
  442. SA6 ARGR
  443. SA7 A6+B1
  444. SX6 B1+B1 ARGUMENT COUNT = 2
  445. SA6 ACTR
  446. EQ =XDFSORT ENTER FORTRAN PROGRAM
  447.  
  448. PRSA BSS 0
  449. VFD 12/0LD,18/D,30/D
  450. VFD 12/0LL,18/L,30/L
  451. VFD 12/0LS,18/JOBS,30/JOBS
  452. VFD 12/0LF,18/JOBF,30/JOBF
  453. VFD 12/0LTN,18/ITN,30/ITN
  454. CON 0
  455.  
  456. D CON 0LDAYFILE
  457. L CON 0LOUTPUT
  458. SPACE 4
  459. ** COMMON DECKS.
  460.  
  461.  
  462. *CALL COMCARG
  463. *CALL COMCSYS
  464. SPACE 4
  465. USE /DATA/
  466. JOBS CON 0LAAA
  467. JOBF CON 0L999
  468. ITN CON 0
  469. SPACE 4
  470. END PRESET