User Tools

Site Tools


cdc:nos2.source:opl871:acpd
1)
STA),(FWA),(DTY),(BCL),(WFP
2)
SPC),WFT,PRFLG)
  • [01093] CHKSPA - CHECK SPECIAL ACTION.
  • [01098] CHKSPA - CHECK SPECIAL ACTION.
  • [01125] PROC WRITEV
  • [01187] PROC COMPWF((WFA),(WFP),(POS),WFT,PRFLG)
    • [01188] COMPWF - COMPUTE WEIGHT FACTOR.
    • [01193] COMPWF - COMPUTE WEIGHT FACTOR.
    • [01224] PROC CHKSPA
    • [01297] PROC DATBLK(EDTM,DTDC,LSTM)
    • [01298] DATBLK - PROCESS DATA BLOCK.
    • [01303] DATBLK - PROCESS DATA BLOCK.
    • [01336] PROC DECODE
    • [01337] FUNC DTMNUM U
    • [01338] PROC PERROR
    • [01339] PROC PUTDAT
    • [01340] PROC READRC
    • [01341] PROC WRTSUM
    • [01576] PROC DATELM(FLG,MS1,MS2,(WFA),(WFP),(POS),(DTY),(FWA),(NSF))
    • [01577] DATELM - PROCESS ONE DATA BLOCK ELEMENT.
    • [01582] DATELM - PROCESS ONE DATA BLOCK ELEMENT.
    • [01631] PROC ACMSTA
    • [01632] PROC COMPWF
    • [01633] PROC PRDTEL
    • [01634] FUNC SQRT R
    • [01635] PROC WRITEV
    • [01891] PROC DECODE((DTA),(BFA
    3)
    VALUE),(FORM),(PDOS
    4)
    ENT),MSG)
    • [02523] GETMSG - GET REPORT MESSAGE.
    • [02528] GETMSG - GET REPORT MESSAGE.
    • [02581] FUNC GETVAL((BA),(PR
    5)
    ENP),(FCL),(LCL
    6)
    ERCD),(EROR),(ERNM
    7)
    PVL),(DTY),(TMX
    8)
    NSF),(FWA),(LWA
    9)
    NSF),(NIN
    10)
    FWA),(LWA
    11)
    NIP
    12)
    NUM
    13)

    ACPD

    Table Of Contents

    • [00003] ENTRY ACPD
    • [00004] ENTRY PAP
    • [00005] ENTRY RFL=
    • [00007] ACPD - ANALYZE PERFORMANCE DATA.
    • [00011] MPAR - MULTIPLE PRECISION ARRAY.
    • [00061] DDSC - DATA DESCRIPTION.
    • [00108] DSPT - DISPLAY TEXT DEFINITION.
    • [00171] SMGT - SUBBLOCK REPORT TITLE DEFINITION.
    • [00207] DEF - DEFINE CONSTANT.
    • [00247] ANALYZE PERFORMANCE DATA.
    • [00258] PAP - PROCESS ACPD PARAMETERS.
    • [00301] PAP - PROCESS *ACPD* PARAMETERS.
    • [00449] PRGM ACPDM
    • [00450] ACPDM - ANALYZE PERFORMANCE DATA.
    • [00604] PROC DATBLK
    • [00605] PROC HEADER
    • [00606] PROC INITLZ
    • [00607] PROC MESSAGE
    • [00608] PROC RPCLOSE
    • [00660] PROC ACMSTA1)
    • [00661] ACMSTA - PRINT TOTAL STATISTICAL VALUES.
    • [00666] ACMSTA - PRINT TOTAL STATISTICAL VALUES.
    • [00699] FUNC SQRT R
    • [00700] PROC WRITEV
    • [00816] PROC ADJUST
    • [00817] ADJUST - ADJUST TABLES AND FIELD LENGTH.
    • [00822] ADJUST - ADJUST TABLES AND FIELD LENGTH.
    • [00849] PROC MEMORY
    • [00850] FUNC XCOD C(10)
    • [01092] PROC CHKSPA2)
    • [01892] DECODE - DECODE DATA.
    • [01897] DECODE - DECODE DATA.
    • [01928] FUNC GETVAL I
    • [01929] PROC PERROR
    • [02195] PROC DETMXM(MXP,MNP,(MXI),(MNI),(DTY))
    • [02196] DETMXM - DETERMINE MAXIMUM AND MINIMUM VALUES.
    • [02201] DETMXM - DETERMINE MAXIMUM AND MINIMUM VALUES.
    • [02235] FUNC XCDD C(10)
    • [02236] FUNC XCED C(10)
    • [02237] FUNC XCOD C(10)
    • [02238] FUNC XCFD C(10)
    • [02239] PROC WRITEV
    • [02389] FUNC DTMNUM3) I
    • [02390] DTMNUM - CONVERT DATE/TIME TO NUMBER.
    • [02395] DTMNUM - CONVERT DATE/TIME TO NUMBER.
    • [02427] PROC PERROR
    • [02522] PROC GETMSG4) I [02582] GETVAL - GET VALUE FROM *CIO* BUFFER. [02587] GETVAL - GET VALUE FROM *CIO* BUFFER. [02641] PROC HDRELM5) [02642] HDRELM - PRINT HEADER BLOCK ELEMENT. [02647] HDRELM - PRINT HEADER BLOCK ELEMENT. [02678] PROC GETMSG [02679] PROC WRITEV [02738] PROC HEADER(TMED,HDDC,(LSTM)) [02739] HEADER - PROCESS HEADER BLOCK. [02744] HEADER - PROCESS HEADER BLOCK. [02774] PROC ADJUST [02775] PROC BZFILL [02776] PROC DECODE [02777] FUNC DTMNUM U [02778] PROC PERROR [02779] PROC PUTEST [02780] PROC PUTHDR [02781] PROC PUTSCI [02782] PROC READRC [02783] PROC RPHEAD [02784] PROC WRITER [02785] PROC WRITEW [02926] PROC INITLZ(HDDC,DTDC,EDTM) [02927] INITLZ - INITIALIZE PARAMETERS AND OPEN FILES. [02932] INITLZ - INITIALIZE PARAMETERS AND OPEN FILES. [02961] PROC ADJUST [02962] PROC DECODE [02963] FUNC DTMNUM I [02964] PROC FILINFO [02965] PROC MEMORY [02966] PROC PAP [02967] PROC PERROR [02968] PROC READRC [02969] PROC REPTLE [02970] PROC RPOPEN [02971] PROC ZSETFET [03293] PROC PERROR6) [03294] PERROR - ISSUE ERROR MESSAGE. [03299] PERROR - ISSUE ERROR MESSAGE. [03345] PROC ABORT [03346] PROC MESSAGE [03427] PROC PRDTEL7) [03428] PRDTEL - PRINT ONE LINE OF DATA ELEMENT. [03433] PRDTEL - PRINT ONE LINE OF DATA ELEMENT. [03463] PROC DETMXM [03464] PROC WRITEV [03609] PROC PUTBLK8) [03610] PUTBLK - PRINT ELEMENTS OF ONE LOOP OF DATA BLOCK. [03615] PUTBLK - PRINT ELEMENTS OF ONE LOOP OF DATA BLOCK. [03644] PROC DATELM [03645] PROC GETMSG [03646] PROC WRITEV [03848] PROC PUTDAT9) [03849] PUTDAT - PRINT DATA BLOCK ELEMENTS. [03854] PUTDAT - PRINT DATA BLOCK ELEMENTS. [03881] PROC PUTBLK [03882] PROC PUTSNS [03883] PROC RPEJECT [03884] PROC WRITEV [03964] PROC PUTEST [03965] PUTEST - PRINT *EST*. [03970] PUTEST - PRINT *EST*. [03995] PROC RPEJECT [03996] PROC WRITEV [03997] FUNC XCOD C(10) [04255] PROC PUTHDR [04256] PUTHDR - PROCESS HEADER BLOCK. [04261] PUTHDR - PROCESS HEADER BLOCK. [04279] PROC HDRELM [04280] PROC RPEJECT [04281] PROC RPSPACE [04282] PROC WRITEV [04406] PROC PUTSCI [04407] PUTSCI - PRINT SYSTEM CONTROL INFORMATION. [04412] PUTSCI - PRINT SYSTEM CONTROL INFORMATION. [04430] PROC RPEJECT [04431] PROC RPSPACE [04432] PROC WRITEV [04540] PROC PUTSNS10) [04541] PUTSNS - PROCESS SNAPSHOT LOOP ELEMENTS. [04546] PUTSNS - PROCESS SNAPSHOT LOOP ELEMENTS. [04574] PROC GETMSG [04575] PROC WRITEV [04705] PROC READRC(STAT) [04706] READRC - READ DATA FILE. [04711] READRC - READ DATA FILE. [04737] PROC READSKP [04784] PROC REPTLE [04785] REPTLE - PRINT REPORT SUBTITLE. [04790] REPTLE - PRINT REPORT SUBTITLE. [04816] FUNC EDATE C(10) [04817] FUNC ETIME C(10) [04818] PROC RPLINEX [04819] FUNC XCDD C(10) [05116] PROC WRITEV(PVL,(DTY),(BCL),(FWD),(CRC)) [05117] WRITEV - WRITE TO REPORT FILE. [05122] WRITEV - WRITE TO REPORT FILE. [05156] PROC BZFILL [05157] PROC RPLINE [05158] FUNC XCDD C(10) [05159] FUNC XCED C(10) [05160] FUNC XCFD C(10) [05161] FUNC XCOD C(10) [05297] PROC WRTSUM11) [05298] WRTSUM - WRITE SUMMARY FILE. [05303] WRTSUM - WRITE SUMMARY FILE. [05329] PROC WRITER [05330] PROC WRITEW [05376] FUNC XCED12) C(10) [05377] XCED - CONVERT NUMBER TO THE DISPLAY *E* FORMAT. [05382] XCED - CONVERT NUMBER TO THE DISPLAY *E* FORMAT. [05416] FUNC XCDD C(10) </WRAP> === Source Code ===
      ACPD.txt
      1. IDENT ACPD
      2. SST
      3. ENTRY ACPD
      4. ENTRY PAP
      5. ENTRY RFL=
      6. SYSCOM B1
      7. TITLE ACPD - ANALYZE PERFORMANCE DATA.
      8. *COMMENT ACPD - ANALYZE PERFORMANCE DATA.
      9. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
      10. SPACE 4,10
      11. ** MPAR - MULTIPLE PRECISION ARRAY.
      12. *
      13. * NAME MPAR LEN,PREC,LMP
      14. *
      15. * ENTRY *NAME* = NAME OF DATA ITEM.
      16. * *LEN* = NUMBER OF ENTRIES OF DATA ITEM.
      17. * *PREC* = PRECISION OF ITEM IN PP WORDS.
      18. * *LMP* = POINTER TO LENGTH MULTIPLIER.
      19. *
      20. * EXIT *NAME* = ORDINAL OF ITEM IN THE CORRESPONDING TABLE.
      21. * *P.NAME* = PRECISION OF THE ITEM.
      22. * *L.NAME* = LENGTH OF THE ITEM.
      23. *
      24. * NOTE *MPAR* TABLE FORMAT IS
      25. *T 24/NAME,3/TP,6/LMP,4/ICM,11/PREC,12/LEN
      26. *
      27. * WHERE
      28. *
      29. * *TP* TYPE OF BLOCK (HEADER, FAST, MEDIUM, SLOW
      30. * OR SNAPSHOT LOOP).
      31. * *ICM* INDICATES THAT THE FOLLOWING GROUP OF DATA ELEMENTS
      32. * (UP TO THE NEXT DEFINITION OF *ICM*) IS EITHER A
      33. * SINGLE OR MULTIPLE ELEMENT ENTRY.
      34. *
      35. * WARNING - IF ARRAY LENGTH IS NOT EQUAL TO ONE. THE ELEMENT
      36. * PRECISION MUST NOT BE GREATER THAN TWO.
      37.  
      38. PURGMAC MPAR
      39.  
      40. MACRO MPAR,NAME,LEN,PREC,LMP
      41. NOREF .IC,.TYPE,BL
      42. .1 IFC EQ,$NAME$$
      43. CON 0
      44. .1 ELSE
      45. .2 IFC EQ,$PREC$$
      46. ERR PRECISION NOT SPECIFIED
      47. .2 ENDIF
      48. IFNE LEN,1,1
      49. ERRNG 2-P.NAME OFFSET CALCULATION ERROR
      50. IFEQ BL,0,1
      51. .IC SET 0
      52. NAME EQU .IC
      53. .IC SET .IC+1
      54. P.NAME EQU PREC 0
      55. L.NAME EQU LEN 0
      56. VFD 24/4L_NAME,3/.TYPE,6/LMP,4/.ICM,11/P.NAME,12/L.NAME
      57. BL SET BL+P.NAME*L.NAME
      58. .1 ENDIF
      59. ENDM
      60. SPACE 4,10
      61. ** DDSC - DATA DESCRIPTION.
      62. *
      63. * NAME DDSC SDL,DTY,WFA,WFP
      64. *
      65. * ENTRY *NAME* = ORDINAL OF ITEM IN THE CORRESPONDING
      66. * *MPAR* TABLE.
      67. * *SDL* = SELECTION BIT.
      68. * *DTY* = DATA TYPE OF ITEM.
      69. * *WFA* = WEIGHT FACTOR INSTRUCTION.
      70. * *WFP* = WEIGHT FACTOR POINTER.
      71. *
      72. * EXIT *DDSC* ENTRY CONTAINS A POINTER TO THE DECODED
      73. * DATA BUFFER *DBUF*, WHERE THE DATA OF THE ITEM
      74. * IS DECODED AND STORED.
      75. *
      76. * NOTE - *DDSC* ENTRY FORMAT IS
      77. *
      78. *T 1/S,3/D,3/WI,13/WFP,4/ICM,18/LEN,18/FW
      79. *
      80. * WHERE
      81. *
      82. * *S* IS *SDL*.
      83. * *D* IS *DTY*.
      84. * *WI* IS *WFA*.
      85. * *ICM* SINGLE/MULTIPLE ELEMENT ENTRY INDICATOR.
      86. * *LEN* LENGTH OF THE DATA ELEMENT.
      87. * *FW* POINT TO THE DECODED DATA BUFFER WHERE
      88. * THE VALUE OF THE DATA ELEMENT IS STORED.
      89. *
      90. * WARNING - THE *MPAR* TABLE HAS TO BE DEFINED BEFORE
      91. * *DDSC* TABLE CAN BE DEFINED. THE RELATIVE POSITION
      92. * OF THE DATA ITEMS IN *DDSC* TABLE MUST BE THE SAME
      93. * AS IN *MPAR* TABLE.
      94.  
      95. PURGMAC DDSC
      96.  
      97. MACRO DDSC,NAME,SDL,DTY,WFA,WFP
      98. NOREF .L,.FW,L._NAME,P._NAME
      99. IFGT P._NAME,5
      100. .L SET P._NAME/5*L._NAME
      101. ELSE
      102. .L SET L._NAME
      103. ENDIF
      104. VFD 1/SDL,3/DTY,3/WFA,13/WFP,4/0,18/.L,18/.FW
      105. .FW SET .FW+.L
      106. ENDM
      107. SPACE 4,10
      108. ** DSPT - DISPLAY TEXT DEFINITION.
      109. *
      110. * NAME DSPT MSGE,SBTL,WORD,BITA,BITL
      111. *
      112. * ENTRY *NAME* = ORDINAL OF ITEM IN THE CORRRESPONDING
      113. * *DDSC* TABLE.
      114. * *MSGE* = DISPLAY TEXT.
      115. * *SBTL* = POINTER TO SUBBLOCK TITLES.
      116. * *WORD* = WORD COUNT IN MULTITPLE-WORD ENTRY.
      117. * *BITA* = BEGIN BIT POSITION FOR NON-WORD-BOUNDARY
      118. * ITEMS.
      119. * *BITL* = BIT LENGTH.
      120. *
      121. * EXIT *DSPT* BUILDS *DSPTENT* TABLE AND *DSPTTXT* TABLE.
      122. * THE *DSPTTXT* TABLE CONTAINS TEXTS USED IN THE REPORT.
      123. * THE *DSPTENT* ENTRY FORMAT IS
      124. *
      125. *T 9/NAME,6/WORD,6/BITA,6/BITL,9/SBTL,6/LN,18/BC
      126. *
      127. * WHERE *LN* IS THE LENGTH IN CHARACTER OF THE TEXT,
      128. * AND *BC* IS THE BEGIN CHARACTER POSITION OF THE
      129. * TEXT IN *DSPTTXT* TABLE.
      130.  
      131. M2 MICRO 1,,**
      132. .BC SET 0
      133.  
      134. PURGMAC DSPT
      135.  
      136. MACRO DSPT,NAME,MSGE,SBTL,WORD,BITA,BITL
      137. NOREF .EC,.LN,.L,.BC,SBT
      138. NOREF .WC,.CC,.RC,.I
      139. IFC EQ,$SBTL$$
      140. SBT SET 777B
      141. ELSE
      142. SBT SET SBTL
      143. ENDIF
      144. M1 MICRO 1,,MSGE
      145. .EC SET .EC+1
      146. .LN MICCNT M1
      147. M MICRO 1,,*"M2""M1"*
      148. .L MICCNT M
      149. USE /DSPTENT/
      150. VFD 9/NAME,6/WORD,6/BITA,6/BITL,9/SBT,6/.LN,18/.BC
      151. .BC SET .BC+.LN
      152. USE
      153. USE /DSPTTXT/
      154. IFNE .LN,0
      155. .WC SET .L/10
      156. .CC SET .WC*10
      157. .RC SET .L-.CC
      158. M2 MICRO .CC+1,.RC,*"M"*
      159. .I SET 1
      160. DUP .WC
      161. MSG MICRO .I,10,*"M"*
      162. DATA 10H"MSG"
      163. .I SET .I+10
      164. ENDD
      165. ELSE
      166. DATA 10H"M2"
      167. ENDIF
      168. USE
      169. ENDM
      170. SPACE 4,10
      171. ** SMGT - SUBBLOCK REPORT TITLE DEFINITION.
      172. *
      173. * SMGT MSGE,CNT,STC
      174. *
      175. * ENTRY *MSGE* = SUBBLOCK REPORT TITLE.
      176. * *CNT* = NUMBER OF ENTRIES IN THE SUBBLOCK.
      177. * *STC* = STARTING NUMBER. IGNORED IF *CNT* IS OMITTED.
      178. *
      179. * EXIT *SMGT* BUILDS A TABLE OF DISPLAY TEXT,
      180. * TEN CHARACTERS, LEFT JUSTIFIED, BLANK FILLED
      181. * FOR EACH ENTRY.
      182.  
      183. PURGMAC SMGT
      184.  
      185. SMGT MACRO MSGE,CNT,STC
      186. NOREF .ST,.SM
      187. MM MICRO 1,,MSGE
      188. .IF IFC NE,$CNT$$
      189. .ST SET STC
      190. DUP CNT
      191. .IF1 IFLT .ST,10B
      192. MC OCTMIC .ST,1
      193. .IF1 ELSE
      194. MC OCTMIC .ST,2
      195. .IF1 ENDIF
      196. MG MICRO 1,,$"MM""MC"$
      197. .ST SET .ST+1
      198. DATA 10H"MG"
      199. .SM SET .SM+1
      200. ENDD
      201. .IF ELSE
      202. DATA 10H"MM"
      203. .SM SET .SM+1
      204. .IF ENDIF
      205. ENDM
      206. SPACE 4,10
      207. ** DEF - DEFINE CONSTANT.
      208. *
      209. * DEF NAM#VAL#;
      210. *
      211. * ENTRY *NAM* = CONSTANT NAME.
      212. * *VAL* = CONSTANT VALUE.
      213. *
      214. * EXIT *DEF* DEFINES SYMBOLIC CONSTANTS USED BY BOTH
      215. * SYMPL AND COMPASS PROGRAMS.
      216. *
      217. * WARNING - *DEF* CAN ONLY BE USED TO DEFINE INTEGER CONSTANTS.
      218. * NON-INTEGER CONSTANTS HAVE TO BE CONVERTED TO INTEGER BEFORE
      219. * *DEF* CAN BE USED.
      220.  
      221. PURGMAC DEF
      222.  
      223. DEF MACRO VALUE
      224. NOREF .BB
      225. .NAM MICRO 1,,#_VALUE
      226.  .BB MICCNT .NAM
      227.  .BB SET .BB+2
      228.  .VAL MICRO .BB,,;_VALUE
      229.  .VAL MICRO 1,,#".VAL"
      230. ".NAM" EQU ".VAL"
      231. DEF ENDM
      232. SPACE 4,10
      233. ** COMMON DECKS.
      234.  
      235. *CALL COMCMAC
      236. *CALL COMSPRD
      237. *CALL COMSCPS
      238. *CALL COMSEJT
      239. *CALL COMSSSD
      240. *CALL COMSSCD
      241. LIST X
      242. *CALL COMSCPD
      243. *CALL COMUCPD
      244. LIST *
      245. TITLE
      246. ACPD SPACE 4,10
      247. *** ACPD - ANALYZE PERFORMANCE DATA.
      248. *
      249. * THIS ENTRY POINT IS NEEDED IN ORDER FOR THE
      250. * ABSOLUTE BINARY RECORD NAME TO MATCH WITH THE
      251. * DECK NAME *ACPD*. IT CONTAINS ONLY A JUMP
      252. * INSTRUCTION TO TRANSFER TO THE MAIN SYMPL
      253. * PROGRAM *ACPDM*.
      254.  
      255.  
      256. ACPD BSS 0 TRANSFER ADDRESS FROM THE LOADER
      257. EQ =XACPDM TO SYMPL MAIN PROGRAM
      258. TITLE PAP - PROCESS ACPD PARAMETERS.
      259. * *PAP* DATA DEFINITIONS.
      260. SPACE 4,10
      261. DS DATA 0LSUMMARY SECONDARY DEFAULT VALUE OF S
      262. DN DATA 0L9999999 SECONDARY DEFAULT VALUE OF N
      263.  
      264.  
      265. TARG BSS 0
      266. FN ARG FN,FN INPUT FILE
      267. L ARG L,L REPORT FILE
      268. S ARG DS,S,400B SUMMARY FILE
      269. LO ARG LO,LO LIST OPTION
      270. IN ARG IN,IN,400B INTERVAL LENGTH IN MINUTES
      271. IC ARG IC,IC,400B INTERVAL RECORD COUNT
      272. N ARG DN,N,400B NUMBER OF FILES
      273. BT ARG BT,BT BEGINNING TIME
      274. ET ARG ET,ET ENDING TIME
      275. BD ARG BD,BD BEGINNING DATE
      276. ED ARG ED,ED ENDING DATE
      277. ARG
      278.  
      279. ERC CON 0 ERROR CODE
      280. ERF CON FATAL FATAL ERROR
      281. EFL CON 0 ERROR NAME
      282.  
      283. PAR BSS 0 PERROR PARAMETER LIST
      284. VFD 60/ERC
      285. VFD 60/ERF
      286. VFD 60/EFL
      287.  
      288. VARG BSS 0
      289. DATA 0LFN
      290. DATA 0LL
      291. DATA 0LS
      292. DATA 0LLO
      293. DATA 0LIN
      294. DATA 0LIC
      295. DATA 0LN
      296. DATA 0LBT
      297. DATA 0LET
      298. DATA 0LBD
      299. DATA 0LED
      300. PAP EJECT
      301. ** PAP - PROCESS *ACPD* PARAMETERS.
      302. *
      303. * *PAP* VALIDATES *ACPD* PARAMETERS, AND CONVERTS
      304. * PARAMETERS IN DISPLAY CODE NUMBER TO BINARY.
      305.  
      306. PAP SUBR ENTRY/EXIT
      307. SB1 1
      308. SA1 ACTR
      309. SA4 ARGR
      310. SB4 X1 NUMBER OF ARGUMENTS
      311. SB5 TARG
      312. RJ ARG
      313. NZ X1,PAP12 IF ERROR
      314. SA5 FN
      315. ZR X5,PAP11 IF NO DATA FILE
      316. SA5 LO
      317. LX5 6
      318. SX4 X5-1RZ
      319. ZR X4,PAP1 IF *Z* OPTION
      320. NZ X5,PAP11 IF INCORRECT OPTION
      321. PAP1 SA5 N CONVERT *N* PARAMETER
      322. SB7 B1+ ASSUME DECIMAL CONVERSION
      323. RJ DXB
      324. NZ X4,PAP11 IF ERROR
      325. ZR X6,PAP11 IF ZERO VALUE ENTERED
      326. SA6 A5+ SET *N* VALUE
      327. SA1 IN
      328. SA5 IC
      329. ZR X5,PAP2 IF *IC* NOT SPECIFIED
      330. ZR X1,PAP2 IF *IN* NOT SPECIFIED
      331. SX6 ERM14 * IN AND IC PARAMETER CONFLICT.*
      332. EQ PAP13 PROCESS ERROR
      333.  
      334. PAP2 NZ X5,PAP3 IF *IC* SPECIFIED
      335. SA5 IN
      336. SX6 6
      337. ZR X5,PAP4 IF *IN* NOT SPECIFIED
      338. PAP3 RJ DXB
      339. NZ X4,PAP11 IF ARGUMENT ERROR
      340. ZR X6,PAP11 IF ARGUMENT ERROR
      341. PAP4 SA6 A5 SET *IN* OR *IC* VALUE
      342.  
      343. * CHECK FOR *BT* AND *ET* PARAMETERS.
      344.  
      345. SB2 B1+B1
      346. MX0 8*6
      347. SA5 BT-1
      348.  
      349. PAP7 SA5 A5+B1
      350. ZR X5,PAP8 IF PARAMETER NOT SPECIFIED OR ZERO
      351. LX5 2*6
      352. BX2 -X0*X5
      353. SB3 X2-2R24
      354. GE B3,PAP11 IF HOUR .GE. 24
      355. SB3 X2-2R00
      356. NG B3,PAP11 IF HOUR .LT. 00
      357. LX5 2*6
      358. BX2 -X0*X5
      359. SB3 X2-2R60
      360. GE B3,PAP11 IF MINUTE .GE. 60
      361. SB3 X2-2R00
      362. NG B3,PAP11 IF MINUTE .LT. 00
      363. MX4 -6
      364. LX5 6
      365. BX2 -X4*X5
      366. SB3 X2-1R6
      367. GE B3,PAP11 IF SECOND .GE. 6X
      368. SB3 X2-1R0
      369. NG B3,PAP11 IF SECOND .LT. 0X
      370. LX5 6
      371. BX2 -X4*X5
      372. SB3 X2-1R9
      373. LX5 2*6
      374. GT B3,PAP11 IF SECOND .GT. X9
      375. SB3 X2-1R0
      376. NG B3,PAP11 IF SECOND .LT. X0
      377. LX5 2*6
      378. BX2 -X0*X5
      379. NZ X2,PAP11 IF TIME TOO LONG
      380. PAP8 SB2 B2-B1
      381. GT B2,PAP7 IF NOT DONE
      382.  
      383. * CHECK FOR *BD* AND *ED* PARAMETERS.
      384.  
      385. SB2 2
      386. SA5 BD-1
      387.  
      388. PAP9 SA5 A5+B1
      389. ZR X5,PAP10 IF PARAMETER NOT SPECIFIED OR ZERO
      390. LX5 2*6
      391. BX2 -X0*X5
      392. SB3 X2-2R99
      393. GT B3,PAP11 IF YEAR .GT. 99
      394. SB3 X2-2R70
      395. PL B3,PAP9.1 IF YEAR .GE. 70
      396. SB3 X2-2R33
      397. GT B3,PAP11 IF YEAR .GT. 33
      398. SB3 X2-2R00
      399. NG B3,PAP11 IF YEAR .LT. 00
      400. PAP9.1 LX5 2*6
      401. BX2 -X0*X5
      402. SB3 X2-2R12
      403. GT B3,PAP11 IF MONTH .GT. 12
      404. SB3 X2-2R01
      405. NG B3,PAP11 IF MONTH .LT. 01
      406. LX5 2*6
      407. BX2 -X0*X5
      408. SB3 X2-2R31
      409. GT B3,PAP11 IF DAY .GT. 31
      410. SB3 X2-2R01
      411. NG B3,PAP11 IF DAY .LT. 01
      412. MX3 -6
      413. BX4 -X3*X2
      414. SB3 X4-1R9
      415. GT B3,PAP11 IF DATE .GT. X9
      416. SB3 X4-1R0
      417. NG B3,PAP11 IF DATE .LT. X0
      418. LX5 2*6
      419. BX2 -X0*X5
      420. NZ X2,PAP11 IF DATE TOO LONG
      421. PAP10 SB2 B2-B1
      422. GT B2,PAP9 IF NOT DONE
      423. EQ PAPX RETURN
      424.  
      425. * PROCESS ARGUMENT ERROR.
      426.  
      427. PAP11 SB2 FN GET ARGUMENT NAME
      428. SB2 A5-B2
      429. SA4 B2+VARG
      430.  
      431. PAP12 MX0 2*6
      432. BX6 X0*X4
      433. SA6 EFL
      434. SX6 ERM1 * ACPD ARGUMENT ERROR - XX.*
      435.  
      436. * PROCESS ERROR.
      437.  
      438. PAP13 SA6 ERC SET ERROR CODE
      439. SA1 PAR SET PARAMETER ADDRESS
      440. RJ =XPERROR NO RETURN
      441. SPACE 4,10
      442. * COMMON DECKS
      443.  
      444. *CALL COMCARG
      445. *CALL COMCDXB
      446.  
      447. END ACPD
      448. *WEOR
      449. PRGM ACPDM;
      450. # TITLE ACPDM - ANALYZE PERFORMANCE DATA. #
      451.  
      452. BEGIN # ACPDM #
      453.  
      454. #
      455. *** ACPDM - ANALYZE PERFORMANCE DATA.
      456. *
      457. * ANALYZE PERFORMANCE DATA COLLECTED BY *CPD*.
      458. *
      459. * COMMAND FORMAT.
      460. *
      461. * ACPD(P1,P2,...,PN)
      462. *
      463. * WHERE PI IS ANY OF THE FOLLOWING.
      464. *
      465. * OPTION DEFAULT DESCRIPTION
      466. *
      467. * FN=LFN1 SAMPLE DATA FILE NAME.
      468. * L=LFN2 OUTPUT REPORT FILE NAME.
      469. * S=LFN3 0 SUMMARY FILE NAME.
      470. * IF NO EQUIVALENCE, *S* IS ASSUMED
      471. * TO BE *SUMMARY*.
      472. * IN=NNN 6 MINS INTERVAL LENGTH IN MINUTES.
      473. * IF THE IC PARAMETER IS SPECIFIED AND
      474. * IN IS NOT, THE IC VALUE IS USED
      475. * INSTEAD OF THE IN PARAMETER DEFAULT
      476. * TO SPECIFY THE REPORT INTERVAL. USE
      477. * OF BOTH THE IN AND IC PARAMETERS
      478. * RESULTS IN AN ERROR.
      479. * IC=NNN 0 RECORDS INTERVAL RECORD COUNT. SPECIFIES THE
      480. * NUMBER OF SAMPLE FILE RECORDS PER
      481. * REPORT INTERVAL. USE OF BOTH THE IN
      482. * AND IC PARAMETERS RESULTS IN AN ERROR.
      483. * N=NNN 1 FILE NUMBER OF FILES TO PROCESS.
      484. * IF NO EQUIVALENCE, *ACPD* WILL PROCESS
      485. * UNTIL EOI OF *LFN1* IS REACHED.
      486. * LO=Z 0 LIST OPTION. IF LO=Z, ELEMENTS
      487. * WITH ZERO VALUES WILL BE PRINTED.
      488. * IF LO=0 (DEFAULT), THESE ELEMENTS
      489. * WILL NOT BE PRINTED. *Z* IS THE
      490. * ONLY VALID OPTION.
      491. * BT=HHMMSS 0 BEGINNING TIME. IF *BT* IS OMITTED,
      492. * PROCESSING WILL BEGIN AT THE
      493. * CURRENT DATA FILE POSITION. IF *BT*
      494. * IS SPECIFIED, PROCESSING WILL
      495. * BEGIN AT THE FILE CONTAINING THE
      496. * RECORD WHOSE TIME EQUALS TO *BT*.
      497. * BD=YYMMDD 0 BEGINNING DATE. IF *BD* IS OMITTED,
      498. * *BD* WILL BE ASSUMED THE DATE OF THE
      499. * FILE WHERE THE DATA FILE IS
      500. * CURRENTLY POSITIONED.
      501. * ET=HHMMSS 0 ENDING TIME. *ACPD* WILL TERMINATE
      502. * WHEN THE RECORD WHOSE TIME EQUALS
      503. * TO *ET* IS REACHED.
      504. * ED=YYMMDD 0 ENDING DATE. *ED* AND *ET* FORM THE
      505. * ENDING TIME. IF *ED* IS SPECIFIED BUT
      506. * *ET* IS OMITTED, THE ENDING TIME IS
      507. * ZERO HOUR OF DAY *ED*. IF *ED* IS
      508. * OMITTED BUT *ET* IS SPECIFIED, *ED*
      509. * IS SET TO THE VALUE OF *BD*. IF BOTH
      510. * *ED* AND *ET* ARE OMITTED, *ACPD* WILL
      511. * TERMINATE IF THE FOLLOWING OCCURS :
      512. * -NUMBER OF FILES SPECIFIED IN THE
      513. * *N* PARAMETER ARE PROCESSED.
      514. * -AT EOI OF THE DATA FILE.
      515. *
      516. * SUMMARY FILE FORMAT.
      517. *
      518. * THE SUMMARY FILE HAS TWO TYPES OF RECORD, THE HEADER BLOCK
      519. * RECORD AND THE DATA BLOCK RECORD.
      520. * THE HEADER BLOCK RECORD IS THE HEADER RECORD OF THE DATA
      521. * FILE IN THE UNPACKED FORMAT.
      522. * EACH DATA BLOCK RECORD CONTAINS VALUES OF THE DATA BLOCK
      523. * ELEMENTS IN ONE REPORT INTERVAL.
      524. * THE DATA BLOCK RECORD HAS TWO EQUAL LENGTH PARTS. THE
      525. * FIRST PART CONTAINS THE AVERAGE VALUES OF THE DATA BLOCK
      526. * ELEMENTS. THE SECOND PART CONTAINS THE STANDARD DEVIATIONS
      527. * OF EACH DATA BLOCK ELEMENTS.
      528. * THE LOOP SAMPLE TIMES AND THE SNAPSHOT ELEMENTS DO NOT
      529. * HAVE STANDARD DEVIATIONS (0).
      530. * THERE IS AN EOR BETWEEN TWO CONSECUTIVE RECORDS.
      531. *
      532. * MESSAGES.
      533. *
      534. * -ACPD ARGUMENT ERROR - XX.
      535. * ERROR DETECTED IN COMMAND SYNTAX.
      536. *
      537. * -BT/BD NOT FOUND.
      538. * *BT*/*BD* GREATER THAN THE TIME OF THE LAST DATA RECORD.
      539. *
      540. * -CPD/ACPD VERSIONS MISMATCH.
      541. * *CPD* AND *ACPD* VERSIONS ARE NOT COMPATIBLE.
      542. *
      543. * -DATA BLOCKS MISSING.
      544. * EXPECTED DATA BLOCKS FOLLOWING HEADER BLOCK NOT FOUND.
      545. *
      546. * -DATA ELEMENT NAME UNDEFINED - XXXX.
      547. * DATA ELEMENT XXXX IS NOT DEFINED IN COMMON DECK COMSCPD.
      548. *
      549. * -DATA FILE POSITIONED AT *EOI*.
      550. * DATA FILE IS INITIALLY POSITIONED AT EOI.
      551. *
      552. * -DATA FILE EMPTY.
      553. * DATA FILE IS EMPTY.
      554. *
      555. * -DATA FILE CONTENT ERROR.
      556. * DATA FILE GENERATED BY *CPD* IS NOT IN THE EXPECTED
      557. * FORMAT.
      558. *
      559. * -DATA FILE NOT AT BEGINNING OF A FILE.
      560. * AT THE BEGINNING OF PROCESSING, THE DATA FILE IS
      561. * POSITIONED EITHER AT THE MIDDLE OF A RECORD, OR
      562. * AT THE BEGINNING OF A DATA BLOCK RECORD.
      563. *
      564. * -DATA FILE NOT FOUND - XXX.
      565. * DATA FILE XXX IS NOT LOCAL TO THE JOB AT THE TIME *ACPD*
      566. * IS RUNNING.
      567. *
      568. * -DATA FILE NOT IN CHRONOLOGICAL ORDER.
      569. * DATA FILE IS NOT IN THE INCREASING ORDER OF TIME OF THE
      570. * RECORDS.
      571. *
      572. * -IN LESS THAN FILE WRITE TIME.
      573. * REPORT TIME INTERVAL LESS THAN FILE WRITE TIME
      574. * (*FW*) OF *CPD*.
      575. *
      576. * -IN AND IC PARAMETER CONFLICT.
      577. * THE IN AND IC PARAMETERS WERE BOTH SPECIFIED ON THE *ACPD*
      578. * COMMAND.
      579. *
      580. * -N EXCEEDS NUMBER OF FILES.
      581. * NUMBER OF FILES REQUESTED GREATER THAN NUMBER OF FILES
      582. * ON THE DATA FILE.
      583. *
      584. *
      585. * NOTE.
      586. *
      587. * TO BUILD *ACPD*, DO THE FOLLOWING :
      588. *
      589. * - MODIFY(Z)/*EDIT,ACPD
      590. * - COMPASS(I,S=NOSTEXT)
      591. * - SYMPL(I)
      592. * - LDSET(LIB=SRVLIB,PRESET=ZERO)
      593. * - LOAD(LGO)
      594. * - NOGO(ACPD,ACPD,$RFL=$)
      595. *
      596. #
      597.  
      598. #
      599. **** PRGM ACPDM - XREF LIST BEGIN.
      600. #
      601.  
      602. XREF
      603. BEGIN
      604. PROC DATBLK; # PROCESS DATA BLOCK #
      605. PROC HEADER; # PROCESS HEADER BLOCK #
      606. PROC INITLZ; # INITIALIZE *ACPD* #
      607. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
      608. PROC RPCLOSE; # CLOSE FILES #
      609. END
      610.  
      611. #
      612. **** PRGM ACPDM - XREF LIST END.
      613. #
      614.  
      615. DEF LISTCON #0#; #TURN OFF COMMON DECK LISTING #
      616.  
      617. *CALL COMUCPD
      618.  
      619. #
      620. * LOCAL VARIABLES.
      621. #
      622.  
      623. ITEM DTDC B; # DATA BLOCK DECODED FLAG #
      624. ITEM HDDC B; # HEADER BLOCK DECODED FLAG #
      625. ITEM I I; # FOR LOOP CONTROL #
      626. ITEM LSTM U; # TIME OF LAST RECORD #
      627. ITEM EDTM B; # ENDING TIME EXPIRED FLAG #
      628.  
      629.  
      630.  
      631.  
      632.  
      633. #
      634. * BEGIN *ACPDM* PROGRAM.
      635. #
      636.  
      637. INITLZ(HDDC,DTDC,EDTM); # INITIALIZE *ACPD* #
      638.  
      639. SLOWFOR I=1 STEP 1 WHILE (I LQ P$N) AND (NOT EDTM)
      640. DO
      641. BEGIN # PROCESS ONE FILE #
      642. HEADER(EDTM,HDDC,LSTM); # PROCESS HEADER BLOCK #
      643. IF (NOT EDTM) # NOT EOI #
      644. THEN
      645. BEGIN
      646. DATBLK(EDTM,DTDC,LSTM); # PROCESS DATA BLOCK #
      647. END
      648.  
      649. END # PROCESS ONE FILE #
      650.  
      651. IF (P$L NQ NULL) # REPORT FILE SPECIFIED #
      652. THEN
      653. BEGIN # CLOSE REPORT FILE #
      654. RPCLOSE(OFFA);
      655. END
      656.  
      657. MESSAGE(" ACPD COMPLETE.",3);
      658. END # ACPDM #
      659. TERM
      660. PROC ACMSTA((STA),(FWA),(DTY),(BCL),(WFP));
      661. # TITLE ACMSTA - PRINT TOTAL STATISTICAL VALUES. #
      662.  
      663. BEGIN # ACMSTA #
      664.  
      665. #
      666. ** ACMSTA - PRINT TOTAL STATISTICAL VALUES.
      667. *
      668. * PRINT PERCENTAGE, STANDARD DEVIATION, AND AVERAGE
      669. * OF ONE DATA ELEMENT FOR THE ENTIRE *ACPD* RUN.
      670. *
      671. * PROC ACMSTA((STA),(FWA),(DTY),(BCL),(WFP))
      672. *
      673. * ENTRY STA = STATISTICAL VALUE TO BE COMPUTED.
      674. * FWA = ADDRESS OF THE DATA ELEMENT IN TABLE *DDSM*.
      675. * DTY = DATA TYPE.
      676. * BCL = BEGINNING COLUMN TO PRINT THE VALUE.
      677. * WFP = WEIGHT FACTOR.
      678. *
      679. * EXIT THE AVERAGE, STANDARD DEVIATION, AND PERCENTAGE
      680. * OF THE DATA ELEMENT FOR THE ENTIRE RUN ARE PRINTED.
      681. #
      682.  
      683. #
      684. * PARAMETER LIST.
      685. #
      686.  
      687. ITEM STA U; # STATISTIC TO BE COMPUTED #
      688. ITEM FWA U; # DATA ELEMENT ORDINAL #
      689. ITEM DTY U; # DATA TYPE #
      690. ITEM BCL U; # BEGINNING COLUMN #
      691. ITEM WFP R; # WEIGHT FACTOR #
      692.  
      693. #
      694. **** PROC ACMSTA - XREF LIST BEGIN.
      695. #
      696.  
      697. XREF
      698. BEGIN
      699. FUNC SQRT R; # SQUARE ROOT FUNCTION #
      700. PROC WRITEV; # WRITE DATA ELEMENT #
      701. END
      702.  
      703. #
      704. **** PROC ACMSTA - XREF LIST END.
      705. #
      706.  
      707. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      708.  
      709. *CALL COMUCPD
      710.  
      711. #
      712. * LOCAL VARIABLES.
      713. #
      714.  
      715. ITEM VL R; # TEMPORARY STORAGE #
      716.  
      717. ARRAY MAXVAL [0:0] P(1); # MAXIMUM VALUE #
      718. BEGIN # ARRAY MAXVAL #
      719. ITEM MAXR R(00,00,60); # REAL VALUE #
      720. ITEM MAXI I(00,00,60); # INTEGER VALUE #
      721. END # ARRAY MAXVAL #
      722.  
      723. ARRAY MINVAL [0:0] P(1); # MINIMUM VALUE #
      724. BEGIN # ARRAY MINVAL #
      725. ITEM MINR R(00,00,60); # REAL VALUE #
      726. ITEM MINI I(00,00,60); # INTEGER VALUE #
      727. END # ARRAY MINVAL #
      728.  
      729. ARRAY TOTVAL [0:0] P(1); # TOTAL REPORT VALUE #
      730. BEGIN # ARRAY TOTVAL #
      731. ITEM TOTR R(00,00,60); # REAL VALUE #
      732. ITEM TOTI I(00,00,60); # INTEGER VALUE #
      733. END # ARRAY TOTVAL #
      734.  
      735. SWITCH STAT:STVAL # STATISTIC #
      736. PCSS:PCST, # PERCENTAGE #
      737. SDSS:SDST, # STANDARD DEVIATION #
      738. AVSS:AVST; # AVERAGE #
      739.  
      740. LABEL PRSTAT; # PRINT TOTAL STATISTICS #
      741.  
      742.  
      743.  
      744.  
      745. #
      746. * BEGIN ACMSTA PROC.
      747. #
      748.  
      749. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      750. GOTO STAT[STA];
      751.  
      752. #
      753. * COMPUTE AND PRINT TOTAL PERCENTAGE.
      754. #
      755.  
      756. PCSS: # PERCENTAGE #
      757. IF (WFP EQ 0)
      758. THEN
      759. BEGIN
      760. TOTR[0]=0.0;
      761. END
      762.  
      763. ELSE
      764. BEGIN
      765. TOTR[0]=(DDSM$SM[FWA]/(ACNS*WFP))*100.0;
      766. END
      767.  
      768. MAXR[0]=DDSM$PX[FWA]; # MAXIMUM PERCENTAGE #
      769. MINR[0]=DDSM$PN[FWA]; # MINIMUM PERCENTAGE #
      770. GOTO PRSTAT;
      771.  
      772. #
      773. * COMPUTE AND PRINT TOTAL STANDARD DEVIATION.
      774. #
      775.  
      776. SDSS: # STANDARD DEVIATION #
      777. VL=DDSM$SM[FWA]/ACNS;
      778. TOTR[0]=SQRT(DDSM$SQ[FWA]/ACNS - VL*VL);
      779. MAXR[0]=DDSM$SX[FWA]; # MAXIMUM STANDARD DEVIATION #
      780. MINR[0]=DDSM$SN[FWA]; # MINIMUM STANDARD DEVIATION #
      781. GOTO PRSTAT;
      782.  
      783. #
      784. * COMPUTE AND PRINT TOTAL AVERAGE.
      785. #
      786.  
      787. AVSS: # AVERAGE #
      788. VL=DDSM$SM[FWA];
      789. IF (DTY EQ FLPC) # REAL FORMAT #
      790. THEN
      791. BEGIN
      792. TOTR[0]=VL/ACNS;
      793. MAXR[0]=DDSM$AX[FWA]; # MAXIMUM AVERAGE #
      794. MINR[0]=DDSM$AN[FWA]; # MINIMUM AVERAGE #
      795. END
      796.  
      797. ELSE # NOT REAL FORMAT #
      798. BEGIN
      799. TOTI[0]=VL/ACNS;
      800. MAXI[0]=DDSM$AX[FWA]; # MAXIMUM AVERAGE #
      801. MINI[0]=DDSM$AN[FWA]; # MINIMUM AVERAGE #
      802. END
      803.  
      804. #
      805. * PRINT TOTAL STATISTICS.
      806. #
      807.  
      808. PRSTAT: # PRINT STATISTIC VALUES #
      809. WRITEV(TOTVAL[0],DTY,BCL+1,9,NLFC);
      810. WRITEV(MAXVAL[0],DTY,BCL+10,10,NLFC);
      811. WRITEV(MINVAL[0],DTY,BCL+20,10,LFDC);
      812. RETURN;
      813. END # ACMSTA #
      814.  
      815. TERM
      816. PROC ADJUST;
      817. # TITLE ADJUST - ADJUST TABLES AND FIELD LENGTH. #
      818.  
      819. BEGIN # ADJUST #
      820.  
      821. #
      822. ** ADJUST - ADJUST TABLES AND FIELD LENGTH.
      823. *
      824. * THIS PROC RECOMPUTES THE FIELD LENGTH AND BUFFER ADDRESSES.
      825. * IT ALSO COMPUTES THE DECODED BUFFER ADDRESSES OF TABLES
      826. * *DDHD* AND *DDDT*.
      827. * THE MASS STORAGE DEVICE SUBBLOCK TITLE TABLE IS CONSTRUCTED
      828. * BASED ON THE EST.
      829. *
      830. * PROC ADJUST
      831. *
      832. * ENTRY NONE.
      833. *
      834. * EXIT THE NEW DECODED BUFFER LENGTHS OF THE HEADER
      835. * BLOCK *DCHL* AND DATA BLOCK *DCDL* ARE COMPUTED.
      836. * THE DECODED BUFFER POINTERS OF TABLES *DDHD* AND
      837. * *DDDT* ARE COMPUTED.
      838. * NEW FIELD LENGTH IS COMPUTED.
      839. * MASS STORAGE DEVICE SUBBLOCK TITLE TABLE IS
      840. * CONSTRUCTED.
      841. #
      842.  
      843. #
      844. **** PROC ADJUST - XREF LIST BEGIN.
      845. #
      846.  
      847. XREF
      848. BEGIN
      849. PROC MEMORY; # REQUEST MEMORY #
      850. FUNC XCOD C(10); # NUMBER TO DISPLAY OCTAL #
      851. END
      852.  
      853. #
      854. **** PROC ADJUST - XREF LIST END.
      855. #
      856.  
      857. DEF BLKC #" "#; # BLANK #
      858. DEF CPWC #5#; # NUMBER OF CHARACTER PER WORD #
      859. DEF MXVC #1.0E20#; # MAXIMUM VALUE #
      860. DEF NA #"NA"#; # NO ABORT FLAG #
      861. DEF RECALL #1#; # RECALL FLAG #
      862.  
      863. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      864.  
      865. *CALL COMUCPD
      866. *CALL COMUEST
      867.  
      868. #
      869. * LOCAL VARIABLES.
      870. #
      871.  
      872. ITEM BL I; # BUFFER LENGTH #
      873. ITEM BLC I; # BUFFER LENGTH #
      874. ITEM CBL I; # CURRENT BUFFER LENGTH #
      875. ITEM CM C(10)="CM"; # MEMORY ARGUMENT #
      876. ITEM I I; # FOR LOOP CONTROL #
      877. ITEM IC I; # INCREMENTOR #
      878. ITEM J I; # FOR LOOP CONTROL #
      879. ITEM L I; # TEMPORARY STORAGE #
      880. ITEM LN I; # LENGTH #
      881. ITEM M I; # TEMPORARY STORAGE #
      882. ITEM MSI I; # *MST* ORDINAL #
      883. ITEM N I; # TEMPORARY STORAGE #
      884. ITEM ORD C(10); # *MST* ORDINAL DISPLAY #
      885. ITEM PR I; # PRECISION #
      886. ITEM RBL I; # REQUESTED BUFFER LENGTH #
      887. ITEM RDCDL I; # REQUESTED BUFFER LENGTH #
      888. ITEM RDCHL I; # REQUESTED BUFFER LENGTH #
      889.  
      890. BASED
      891. ARRAY MSD [0:0] P(1); # MASS STORAGE DEVICE #
      892. BEGIN # ARRAY MSD #
      893. ITEM MSD$WD I(00,00,60); # MSD ENTRY #
      894. ITEM MSD$EQ C(00,00,03); # EQUIPMENT NAME #
      895. ITEM MSD$OR C(00,18,07); # EQUIPMENT ORDINAL #
      896. END # ARRAY MSD #
      897.  
      898. ARRAY STT [0:0] P(1); # MEMORY ARGUMENT #
      899. BEGIN # ARRAY STT #
      900. ITEM STT$RFL U(00,00,30); # REQUESTED FIELD LENGTH #
      901. ITEM STT$CMB U(00,59,01); # COMPLETION BIT #
      902. END # ARRAY STT #
      903.  
      904.  
      905.  
      906.  
      907.  
      908.  
      909. #
      910. * BEGIN ADJUST PROC.
      911. #
      912.  
      913. P<DCHD>=LOC(DBUF);
      914.  
      915. #
      916. * COMPUTE LENGTH OF THE HEADER BLOCK DECODED BUFFER.
      917. #
      918.  
      919. BL=0;
      920. P<MPAR>=LOC(HDTR);
      921. P<DDSC>=LOC(DDHD);
      922.  
      923. J=0;
      924. SLOWFOR M=0 WHILE (MPAR$WD[J] NQ 0)
      925. DO
      926. BEGIN # COMPUTE HEADER BLOCK LENGTH AND BUFFER ADDRESS #
      927. LN=MPAR$LN[J];
      928. IF (MPAR$LMP[J] NQ 0)
      929. THEN
      930. BEGIN
      931. LN=LN*DCHD$WD[DDSC$FW[MPAR$LMP[J]]];
      932. END
      933.  
      934. PR=MPAR$PR[J];
      935. IF (PR GR CPWC)
      936. THEN
      937. BEGIN
      938. LN=(PR/CPWC)*LN;
      939. END
      940.  
      941. BLC=BL;
      942. IC=MPAR$IC[J];
      943. FASTFOR I=1 STEP 1 UNTIL IC
      944. DO
      945. BEGIN
      946. DDSC$FW[J]=BLC;
      947. DDSC$LN[J]=LN;
      948. DDSC$IC[J]=IC;
      949. BL=BL+LN;
      950. BLC=BLC+1;
      951. J=J+1;
      952. END
      953.  
      954. END # COMPUTE HEADER BLOCK LENGTH AND BUFFER ADDRESS #
      955.  
      956. RDCHL=BL+1; # NEW HEADER BLOCK BUFFER LENGTH #
      957.  
      958. #
      959. * COMPUTE THE DATA BLOCK DECODED BUFFER LENGTH.
      960. #
      961.  
      962. BL=0;
      963. J=0;
      964. P<MPAR>=LOC(DATT);
      965.  
      966. SLOWFOR M=0 WHILE (MPAR$WD[J] NQ 0)
      967. DO
      968. BEGIN # COMPUTE DATA BLOCK LENGTH AND BUFFER ADDRESS #
      969. P<DDSC>=LOC(DDHD);
      970. LN=MPAR$LN[J];
      971. IF (MPAR$LMP[J] NQ 0)
      972. THEN
      973. BEGIN
      974. LN=LN*DCHD$WD[DDSC$FW[MPAR$LMP[J]]];
      975. END
      976.  
      977. PR=MPAR$PR[J];
      978. IF (PR GR CPWC)
      979. THEN
      980. BEGIN
      981. LN=(PR/CPWC)*LN;
      982. END
      983.  
      984. P<DDSC>=LOC(DDDT);
      985. BLC=BL;
      986. IC=MPAR$IC[J];
      987. FASTFOR I=1 STEP 1 UNTIL IC
      988. DO
      989. BEGIN
      990. DDSC$FW[J]=BLC;
      991. DDSC$LN[J]=LN;
      992. DDSC$IC[J]=IC;
      993. BL=BL+LN;
      994. BLC=BLC+1;
      995. J=J+1;
      996. END
      997.  
      998. END # COMPUTE DATA BLOCK LENGTH AND BUFFER ADDRESS #
      999.  
      1000. RDCDL=BL+1; # NEW DATA BLOCK LENGTH #
      1001.  
      1002. #
      1003. * COMPUTE NEW FIELD LENGTH.
      1004. #
      1005.  
      1006. RBL=RDCHL+(RDCDL*DCDC*2)+(RDCDL*8); # NEW LENGTH #
      1007. CBL=DCHL+(DCDL*DCDC*2)+(DCDL*8); # OLD LENGTH #
      1008. HGAD=HGAD + (RBL-CBL); # UPDATE HIGHEST ADDRESS #
      1009. DCHL=RDCHL;
      1010. DCDL=RDCDL;
      1011. IF (HGAD GR CRFL) # EXCEED FIELD LENGTH #
      1012. THEN
      1013. BEGIN
      1014. STT$RFL[0]=HGAD;
      1015. MEMORY(CM,STT,RECALL,NA); # REQUEST MEMORY #
      1016. CRFL=STT$RFL[0]; # UPDATE CURRENT FIELD LENGTH #
      1017. END
      1018.  
      1019. #
      1020. * INITIALIZE DECODED BUFFER AND TOTAL BUFFER.
      1021. #
      1022.  
      1023. P<DCDT>=LOC(DBUF[DCHL]);
      1024. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      1025. FASTFOR I=0 STEP 1 UNTIL DCDC*DCDL*2 - 1
      1026. DO
      1027. BEGIN
      1028. DCDT$WD[I]=0;
      1029. END
      1030.  
      1031. FASTFOR I=0 STEP 1 UNTIL DCDL-1
      1032. DO
      1033. BEGIN
      1034. DDSM$IM[I]=0;
      1035. DDSM$IQ[I]=0;
      1036. DDSM$AX[I]=0;
      1037. DDSM$AN[I]=MXVC;
      1038. DDSM$SX[I]=0;
      1039. DDSM$SN[I]=MXVC;
      1040. DDSM$PX[I]=0;
      1041. DDSM$PN[I]=MXVC;
      1042. END
      1043.  
      1044. #
      1045. * CONSTRUCT THE MASS STORAGE DEVICE SUBBLOCK TITLE TABLE.
      1046. #
      1047.  
      1048. P<DDSC>=LOC(DDHD);
      1049. P<EST>=LOC(DCHD$WD[DDSC$FW[ESTB]]);
      1050. P<MSD>=LOC(SMGT[EQTN]);
      1051. MSI=0;
      1052.  
      1053. SLOWFOR J=0 STEP 1 UNTIL DCHD$WD[DDSC$FW[ESTL]] - 1
      1054. DO
      1055. BEGIN # SEARCH FOR MASS STORAGE DEVICE IN EST #
      1056. IF (EST$MS[J]) # MASS STORAGE DEVICE #
      1057. THEN
      1058. BEGIN # BUILD SUBBLOCK TITLE #
      1059. MSD$EQ[MSI]="EQ ";
      1060. MSD$OR[MSI]=BLKC;
      1061. ORD=XCOD(J); # CONVERT TO DISPLAY #
      1062. N=0;
      1063.  
      1064. SLOWFOR I=9 STEP -1 WHILE (C<I,1>ORD NQ BLKC)
      1065. DO # COUNT NUMBER OF DIGITS #
      1066. BEGIN
      1067. N=N+1;
      1068. END
      1069.  
      1070. M=I+1;
      1071. L=0;
      1072.  
      1073. SLOWFOR I=1 STEP 1 WHILE (I LQ N)
      1074. DO # BUILD MST ORDINAL #
      1075. BEGIN
      1076. C<L,1>MSD$OR[MSI]=C<M,1>ORD;
      1077. L=L+1;
      1078. M=M+1;
      1079. END
      1080.  
      1081. MSI=MSI+1;
      1082. END # BUILD SUBBLOCK TITLE #
      1083.  
      1084. END # SEARCH FOR MASS STORAGE DEVICE IN EST #
      1085.  
      1086. MSD$WD[MSI]=0; # END OF TABLE #
      1087.  
      1088. RETURN;
      1089. END # ADJUST #
      1090.  
      1091. TERM
      1092. PROC CHKSPA((SPC),WFT,PRFLG);
      1093. # TITLE CHKSPA - CHECK SPECIAL ACTION. #
      1094.  
      1095. BEGIN # CHKSPA #
      1096.  
      1097. #
      1098. ** CHKSPA - CHECK SPECIAL ACTION.
      1099. *
      1100. * *CHKSPA* PERFORMS TASKS THAT CANNOT BE TABLE DRIVEN.
      1101. * CURRENTLY THESE ACTIONS INCLUDE COMPUTING AVAILABLE
      1102. * MEMORY AND BUFFERED I/O CHECKING.
      1103. *
      1104. * PROC CHKSPA((SPC),WFT,PRFLG)
      1105. *
      1106. * ENTRY SPC = SPECIAL ACTION CODE.
      1107. *
      1108. * EXIT WFT = WEIGHT FACTOR.
      1109. * PRFLG = FLAG INDICATES IF ELEMENT IS TO BE PROCESSED.
      1110. #
      1111.  
      1112. #
      1113. * PARAMETER LIST.
      1114. #
      1115. ITEM SPC I; # SPECIAL ACTION CODE #
      1116. ITEM WFT R; # WEIGHT FACTOR #
      1117. ITEM PRFLG B; # PROCESS FLAG #
      1118.  
      1119. #
      1120. **** PROC CHKSPA - XREF LIST BEGIN.
      1121. #
      1122.  
      1123. XREF
      1124. BEGIN
      1125. PROC WRITEV; # WRITE DATA VALUE #
      1126. END
      1127.  
      1128. #
      1129. **** PROC CHKSPA - XREF LIST END.
      1130. #
      1131.  
      1132. DEF NPCC #-1.0#; # NO PERCENTAGE FLAG #
      1133.  
      1134. DEF LISTCON #0#; # TURN OFF COMMON LISTING #
      1135.  
      1136. *CALL COMUCPD
      1137.  
      1138. #
      1139. * LOCAL VARIABLES.
      1140. #
      1141.  
      1142. ITEM TEM I; # TEMPORARY STORAGE #
      1143.  
      1144. SWITCH SPAT
      1145. AVMS, # AVAILABLE MEMORY #
      1146. BIOS, # BUFFERED I/O #
      1147. ; # END OF SPAT #
      1148.  
      1149.  
      1150.  
      1151.  
      1152.  
      1153.  
      1154. #
      1155. * BEGIN CHKSPA PROC.
      1156. #
      1157.  
      1158. P<DCHD>=LOC(DBUF);
      1159. P<DDSC>=LOC(DDHD);
      1160. PRFLG=FALSE;
      1161.  
      1162. GOTO SPAT[SPC];
      1163.  
      1164. AVMS: # AVAILABLE MEMORY #
      1165.  
      1166. WFT=DCHD$WD[DDSC$FW[MEMS]]-DCHD$WD[DDSC$FW[CMRS]];
      1167. PRFLG=TRUE;
      1168. RETURN;
      1169.  
      1170. BIOS: # BUFFERED I/O PARAMETERS #
      1171. WFT=DCHD$WD[DDSC$FW[TIOB]];
      1172. IF (WFT NQ 0) # SYSTEM HAS BUFFERED I/O #
      1173. THEN
      1174. BEGIN
      1175. PRFLG=TRUE;
      1176. END
      1177.  
      1178. RETURN;
      1179.  
      1180. #
      1181. * END CASE.
      1182. #
      1183.  
      1184. END # CHKSPA #
      1185.  
      1186. TERM
      1187. PROC COMPWF((WFA),(WFP),(POS),WFT,PRFLG);
      1188. # TITLE COMPWF - COMPUTE WEIGHT FACTOR. #
      1189.  
      1190. BEGIN # COMPWF #
      1191.  
      1192. #
      1193. ** COMPWF - COMPUTE WEIGHT FACTOR.
      1194. *
      1195. * COMPUTE WEIGHT FACTOR FOR PERCENTAGE CALCULATION.
      1196. *
      1197. * PROC COMPWF((WFA),(WFP),(POS),WFT,PRFLG)
      1198. *
      1199. * ENTRY WFA = WEIGHT FACTOR INFORMATION.
      1200. * WFP = WEIGHT FACTOR.
      1201. * POS = RELATIVE POSITION OF THE WEIGHT FACTOR.
      1202. *
      1203. * EXIT WFT = COMPUTED WEIGHT FACTOR.
      1204. * WFT=-1.0 IF PERCENTAGE NOT TO BE PRINTED.
      1205. * PRFLG = PROCESS FLAG.
      1206. #
      1207.  
      1208. #
      1209. * PARAMETER LIST.
      1210. #
      1211.  
      1212. ITEM WFA U; # WEIGHT FACTOR INFORMATION #
      1213. ITEM WFP U; # WEIGHT FACTOR #
      1214. ITEM POS I; # RELATIVE POSITION OF *WFP* #
      1215. ITEM WFT R; # COMPUTED WEIGHT FACTOR #
      1216. ITEM PRFLG B; # PROCESS FLAG #
      1217.  
      1218. #
      1219. **** PROC COMPWF - XREF LIST BEGIN.
      1220. #
      1221.  
      1222. XREF
      1223. BEGIN
      1224. PROC CHKSPA; # CHECK SPECIAL ACTION #
      1225. END
      1226.  
      1227. #
      1228. **** PROC COMPWF - XREF LIST END.
      1229. #
      1230.  
      1231. DEF NPCC #-1.0#; # NO PERCENTAGE FLAG #
      1232.  
      1233. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      1234.  
      1235. *CALL COMUCPD
      1236.  
      1237. #
      1238. * LOCAL VARIABLES.
      1239. #
      1240.  
      1241.  
      1242. SWITCH WFAT
      1243. WGFS, # WEIGHT FACTOR SPECIFIED #
      1244. NWFS, # NO WEIGHT FACTOR #
      1245. CWFS, # CONSTANT WEIGHT FACTOR #
      1246. SPAS, # SPECIAL ACTION #
      1247. IWFS, # INDIRECT WEIGHT FACTOR #
      1248. ; # END OF WFAT #
      1249.  
      1250.  
      1251.  
      1252.  
      1253.  
      1254. #
      1255. * BEGIN COMPWF PROC.
      1256. #
      1257.  
      1258. P<DCHD>=LOC(DBUF);
      1259. P<DDSC>=LOC(DDHD);
      1260. PRFLG=TRUE;
      1261. GOTO WFAT[WFA];
      1262.  
      1263. WGFS: # WEIGHT FACTOR SPECIFIED #
      1264. WFT=DCHD$WD[DDSC$FW[WFP] + POS];
      1265. RETURN;
      1266.  
      1267. NWFS: # NO WEIGHT FACTOR #
      1268. WFT=NPCC;
      1269. RETURN;
      1270.  
      1271. CWFS: # CONSTANT WEIGHT FACTOR #
      1272. WFT=WFP;
      1273. IF (WFP EQ 100) # CONSTANT FACTOR IS 100 #
      1274. THEN # NO PERCENTAGE #
      1275. BEGIN
      1276. WFT=NPCC;
      1277. END
      1278.  
      1279. RETURN;
      1280.  
      1281. SPAS: # SPECIAL ACTION #
      1282.  
      1283. CHKSPA(WFP,WFT,PRFLG);
      1284. RETURN;
      1285.  
      1286. IWFS: # INDIRECT WEIGHT FACTOR #
      1287. WFT=0.0; # TO BE COMPUTED #
      1288. RETURN;
      1289.  
      1290. #
      1291. * END CASE.
      1292. #
      1293.  
      1294. END # COMPWF #
      1295.  
      1296. TERM
      1297. PROC DATBLK(EDTM,DTDC,LSTM);
      1298. # TITLE DATBLK - PROCESS DATA BLOCK. #
      1299.  
      1300. BEGIN # DATBLK #
      1301.  
      1302. #
      1303. ** DATBLK - PROCESS DATA BLOCK.
      1304. *
      1305. * DATBLK PROCESSES DATA BLOCKS OF EACH FILE IN THE DATA FILE.
      1306. *
      1307. * PROC DATBLK(EDTM,DTDC,LSTM)
      1308. *
      1309. * ENTRY EDTM = TRUE IF ENDING TIME REACHED,
      1310. * FALSE IF OTHERWISE.
      1311. * DTDC = INDICATE IF DATA BLOCK HAS BEEN DECODED.
      1312. * FILE IS POSITIONED AT THE FIRST DATA BLOCK RECORD.
      1313. *
      1314. * EXIT TIME = TRUE IF ENDING TIME REACHED.
      1315. * LSTM = TIME OF LAST RECORD.
      1316. * DATA FILE IS POSITIONED AT EITHER *EOI* OR
      1317. * AT *EOF* OF THE CURRENT FILE. IF TIME IS TRUE,
      1318. * DATA FILE IS AT THE RECORD CONTAINING THE
      1319. * ENDING TIME.
      1320. #
      1321.  
      1322. #
      1323. * PARAMETER LIST.
      1324. #
      1325.  
      1326. ITEM EDTM B; # ENDING TIME OR EOI FLAG #
      1327. ITEM DTDC B; # DECODE DATA BLOCK FLAG #
      1328. ITEM LSTM U; # TIME IF LAST RECORD #
      1329.  
      1330. #
      1331. **** PROC DATBLK - XREF LIST BEGIN.
      1332. #
      1333.  
      1334. XREF
      1335. BEGIN
      1336. PROC DECODE; # DECODE *CIO* INPUT BUFFER DATA #
      1337. FUNC DTMNUM U; # CONVERT DATE/TIME TO BINARY #
      1338. PROC PERROR; # PROCESS ERROR #
      1339. PROC PUTDAT; # PRINT DATA BLOCK ELEMENTS #
      1340. PROC READRC; # READ ONE RECORD FROM DATA FILE #
      1341. PROC WRTSUM; # WRITE SUMMARY FILE #
      1342. END
      1343.  
      1344. #
      1345. **** PROC DATBLK - XREF LIST END.
      1346. #
      1347.  
      1348. DEF DOTC #TRUE#; # FLAG #
      1349. DEF MXVC #1.0E10#; # MAXIMUM VALUE #
      1350.  
      1351. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      1352.  
      1353. *CALL COMUCPD
      1354.  
      1355. #
      1356. * LOCAL VARIABLES.
      1357. #
      1358.  
      1359. ITEM BC I; # BEGINNING COLUMN #
      1360. ITEM FW I; # FILE WRITE TIME #
      1361. ITEM I I; # FOR LOOP CONTROL #
      1362. ITEM J I; # FOR LOOP CONTROL #
      1363. ITEM K I; # FOR LOOP CONTROL #
      1364. ITEM NS I; # SAMPLING FREQUENCY #
      1365. ITEM PT I; # ADDRESS OF DECODED DATA BLOCK #
      1366. ITEM STAT I; # I/O STATUS #
      1367. ITEM TM I; # TIME OF CURRENT RECORD #
      1368.  
      1369.  
      1370.  
      1371.  
      1372.  
      1373. #
      1374. * BEGIN DATBLK PROC.
      1375. #
      1376.  
      1377. P<DCHD>=LOC(DBUF);
      1378. P<DCDT>=LOC(DBUF[DCHL]);
      1379. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      1380. TLFG=1; # SUBTITLE IS TO BE PRINTED #
      1381.  
      1382. #
      1383. * DETERMINE REPORT INTERVAL LENGTH.
      1384. #
      1385.  
      1386. P<DDSC>=LOC(DDHD);
      1387. FW=DCHD$WD[DDSC$FW[DLFW]]; # FILE WRITE TIME #
      1388. IF (P$IN NQ 0) # INTERVAL TIME SPECIFIED #
      1389. THEN
      1390. BEGIN
      1391. NS=(P$IN*60)/FW; # NUMBER OF RECORDS PER INTERVAL #
      1392. IF (NS EQ 0) # *IN* .LT. *FW* #
      1393. THEN
      1394. BEGIN
      1395. PERROR(ERM10,FATAL,NULL); # IN LESS THAN FILE WRITE TIME #
      1396. END
      1397.  
      1398. END
      1399.  
      1400. ELSE
      1401. BEGIN
      1402. NS=P$IC; # NUMBER OF RECORDS PER INTERVAL #
      1403. END
      1404.  
      1405. IF (DTDC) # FIRST DATA BLOCK DECODED #
      1406. THEN
      1407. BEGIN
      1408. BC=2; # COLLECT NEXT SAMPLE #
      1409. ACNS=1;
      1410. TM=P$BT;
      1411. DTDC=FALSE;
      1412. END
      1413.  
      1414. ELSE # NOT DECODED #
      1415. BEGIN
      1416. BC=1; # COLLECT FIRST SAMPLE #
      1417. ACNS=0;
      1418. TM=DTMNUM(DCHD$WD[DDSC$FW[DATE]],DOTC,TRUE)*SHFC;
      1419. TM=TM + DTMNUM(DCHD$WD[DDSC$FW[TIME]],DOTC,FALSE);
      1420. END
      1421.  
      1422. #
      1423. * PROCESS DATA BLOCKS UNTIL EITHER END OF
      1424. * CURRENT FILE OR END TIME IS REACHED.
      1425. #
      1426.  
      1427. PT=LOC(DCDT);
      1428. P<DDSC>=LOC(DDDT);
      1429. STAT=EORC;
      1430. TCOL=0; # TOTAL NUMBER OF COLUMNS #
      1431.  
      1432. SLOWFOR K=1 STEP 1 WHILE (STAT EQ EORC) AND (P$ET GR TM)
      1433. DO
      1434. BEGIN # COLLECT DATA #
      1435.  
      1436. #
      1437. * COLLECT DATA FOR 10 COLUMNS AND PUT THEM IN THE DECODED
      1438. * DATA BLOCK BUFFER *DCDT*. *PT* IS THE ADDRESS OF WHERE THE
      1439. * DECODED DATA ARE TO BE STORED IN *DCDT*. FOR EACH COLUMN, THE
      1440. * NUMBER OF DATA BLOCKS NEEDED TO COLLECT IS DETERMINED BY *NS*.
      1441. #
      1442.  
      1443. SLOWFOR I=1 STEP 1 UNTIL DCDC
      1444. DO
      1445. BEGIN # PROCESS 10 COLUMNS #
      1446. SLOWFOR J=BC STEP 1 UNTIL NS
      1447. DO
      1448. BEGIN # COLLECT DATA FOR THE I-TH COLUMN #
      1449. IF (IBWA GQ IBNW) # INPUT BUFFER EXHAUSTED #
      1450. THEN
      1451. BEGIN # GET NEXT RECORD #
      1452. READRC(STAT); # READ NEXT RECORD #
      1453. IF (STAT NQ EORC) # EOF OR EOI #
      1454. THEN
      1455. BEGIN
      1456. TEST K; # END OF CURRENT FILE #
      1457. END
      1458.  
      1459. IBWA=0; # RESET INPUT BUFFER POINTER #
      1460. END # GET NEXT RECORD #
      1461.  
      1462. DECODE(LOC(DATT),PT); # DECODE DATA BLOCK #
      1463. ACNS=ACNS+1; # NUMBER OF DATA BLOCKS DECODED #
      1464. TM=DCDT$WD[(I-1)*DCDL + DDSC$FW[PDTM]]; # GET TIME #
      1465. IF (TM GQ P$ET) # CURRENT TIME GREATER THAN #
      1466. THEN # ENDING TIME #
      1467. BEGIN
      1468. TEST K; # ENDING TIME REACHED #
      1469. END
      1470.  
      1471. END # COLLECT DATA FOR THE I-TH COLUMN #
      1472.  
      1473. BC=1;
      1474. TCOL=TCOL+1;
      1475. PT=PT+DCDL; # NEXT BUFFER ADDRESS #
      1476. END # PROCESS 10 COLUMNS #
      1477.  
      1478. #
      1479. * DATA OF THE FAST, MEDIUM, SLOW, AND SNAPSHOT LOOPS FOR 10
      1480. * COLUMNS HAVE BEEN DECODED AND SAVED IN DECODED DATA BLOCK
      1481. * BUFFER *DCDT*. NOW PRINT THE DATA TO THE REPORT FILE AND
      1482. * THE SUMMARY FILE IF THE SUMMARY FILE IS SPECIFIED.
      1483. #
      1484.  
      1485. PUTDAT(NS,DCDC); # COMPUTE DATA BLOCK ELEMENTS #
      1486. IF (P$S NQ NULL) # SUMMARY FILE SPECIFIED #
      1487. THEN
      1488. BEGIN
      1489. WRTSUM(DCDC); # WRITE SUMMARY FILE #
      1490. END
      1491.  
      1492. #
      1493. * REINITIALIZE THE DECODED DATA BLOCK BUFFER FOR NEXT
      1494. * COLLECTION OF DATA.
      1495. #
      1496.  
      1497. PT=LOC(DCDT);
      1498. SLOWFOR I=0 STEP 1 UNTIL DCDC*DCDL*2 - 1
      1499. DO
      1500. BEGIN
      1501. DCDT$WD[I]=0;
      1502. END
      1503.  
      1504. END # COLLECT DATA #
      1505.  
      1506. #
      1507. * PROCESS END CASE.
      1508. * THE NUMBER OF COLUMNS MAY NOT BE 10, AND THE NUMBER OF DATA
      1509. * BLOCKS COLLECTED FOR THE LAST COLUMN MAY NOT BE *NS*.
      1510. #
      1511.  
      1512. IF (STAT NQ EORC) # EOF OR EOI #
      1513. THEN
      1514. BEGIN
      1515. J=J-1;
      1516. END
      1517.  
      1518. #
      1519. * IF LAST COLUMN DOES NOT HAVE ENOUGH BLOCKS, IGNORE LAST
      1520. * COLUMN.
      1521. #
      1522.  
      1523. IF (J LS NS) # NOT ENOUGH BLOCKS #
      1524. THEN
      1525. BEGIN # IGNORE LAST INCOMPLETED COLUMN #
      1526. I=I-1;
      1527. IF (I EQ 0) # ONLY ONE COLUMN COLLECTED #
      1528. THEN
      1529. BEGIN
      1530. I=1;
      1531. NS=J;
      1532. END
      1533.  
      1534. END # IGNORE LAST INCOMPLETED COLUMN #
      1535.  
      1536. IF (NS GR 0) # LAST COLUMN HAS DATA #
      1537. THEN
      1538. BEGIN
      1539. PUTDAT(NS,I); # PROCESS LAST COLLECTION #
      1540. IF (P$S NQ NULL) # SUMMARY FILE SPECIFIED #
      1541. THEN # WRITE SUMMARY FILE #
      1542. BEGIN
      1543. WRTSUM(I);
      1544. END
      1545.  
      1546. END
      1547.  
      1548. IF (I GR (DCDC-3)) # MORE THAN 7 COLUMNS COLLECTED #
      1549. OR (NS EQ 0) # NO BLOCK WAS COLLECTED #
      1550. THEN # PRINT TOTAL ON NEXT PAGE #
      1551. BEGIN
      1552. PUTDAT(NS,0); # PRINT TOTAL #
      1553. END
      1554.  
      1555. #
      1556. * THE CURRENT FILE IS DONE. CHECK IF THERE IS ANOTHER FILE
      1557. * TO REPORT.
      1558. #
      1559.  
      1560. IF (P$ET LQ TM) # ENDING TIME REACHED #
      1561. OR (STAT EQ EOIC) # EOI ENCOUNTERED ON FILE #
      1562. THEN
      1563. BEGIN
      1564. EDTM=TRUE; # ENDING TIME REACHED OR EOI #
      1565. END
      1566.  
      1567. ELSE # DONE WITH THE CURRENT FILE #
      1568. BEGIN
      1569. LSTM=TM; # TIME OF LAST RECORD #
      1570. END
      1571.  
      1572. RETURN;
      1573. END # DATBLK #
      1574.  
      1575. TERM
      1576. PROC DATELM(FLG,MS1,MS2,(WFA),(WFP),(POS),(DTY),(FWA),(NSF));
      1577. # TITLE DATELM - PROCESS ONE DATA BLOCK ELEMENT. #
      1578.  
      1579. BEGIN # DATELM #
      1580.  
      1581. #
      1582. ** DATELM - PROCESS ONE DATA BLOCK ELEMENT.
      1583. *
      1584. * COMPUTE AND PRINT ONE DATA BLOCK ELEMENT-S STATISTICAL
      1585. * VALUES (AVERAGE, STANDARD DEVIATION, AND PERCENTAGE).
      1586. *
      1587. * PROC DATELM(FLG,MS1,MS2,(WFA),(WFP),(POS),(DTY),(FWA),(NSF))
      1588. *
      1589. * ENTRY FLG = TRUE IF SUB BLOCK TITLE IS TO BE PRINTED.
      1590. * MS1 = SUB BLOCK TITLE.
      1591. * MS2 = DATA ELEMENT NAME.
      1592. * WFA = WEIGHT FACTOR INFORMATION.
      1593. * WFP = WEIGHT FACTOR.
      1594. * POS = RELATIVE POSITION OF WEIGHT FACTOR.
      1595. * DTY = DATA TYPE.
      1596. * FWA = ADDRESS OF THE ELEMENT IN TABLE *DCDT*.
      1597. * NSF = NUMBER OF RECORDS PER INTERVAL.
      1598. * NIPP = (COMMON BLOCK *CIOCOMM*) NUMBER OF INTERVALS
      1599. * PER PAGE.
      1600. *
      1601. * EXIT THE AVERAGE, STANDARD DEVIATION, AND PERCENTAGE
      1602. * OF THE DATA ELEMENT AT TEN INTERVALS ARE COMPUTED
      1603. * AND PRINTED.
      1604. * IF THE WEIGHT FACTOR IS THE CONSTANT 1, THE AVERAGE
      1605. * WILL NOT BE PRINTED.
      1606. * THE PERCENTAGE WILL NOT BE PRINTED IF THE ELEMENT
      1607. * DOES NOT HAVE A WEIGHT FACTOR, OR THE WEIGHT FACTOR
      1608. * IS THE CONSTANT 100.
      1609. #
      1610.  
      1611. #
      1612. * PARAMETER LIST.
      1613. #
      1614.  
      1615. ITEM FLG B; # SUBBLOCK TITLE FLAG #
      1616. ITEM MS1 C(40); # SUBBLOCK TITLE #
      1617. ITEM MS2 C(30); # DATA ELEMENT NAME #
      1618. ITEM WFA U; # WEIGHT FACTOR INFORMATION #
      1619. ITEM WFP U; # WEIGHT FACTOR #
      1620. ITEM POS I; # RELATIVE POSITIN OF *WFP* #
      1621. ITEM DTY U; # DATA TYPE #
      1622. ITEM FWA U; # ADDRESS OF ENTRY #
      1623. ITEM NSF I; # NUMBER OF SAMPLES PER INTERVAL #
      1624.  
      1625. #
      1626. **** PROC DATELM - XREF LIST BEGIN.
      1627. #
      1628.  
      1629. XREF
      1630. BEGIN
      1631. PROC ACMSTA; # COMPUTE TOTAL STATISTICS #
      1632. PROC COMPWF; # COMPUTE WEIGHT FACTOR #
      1633. PROC PRDTEL; # PRINT ONE ROW OF DATA ELEMENT #
      1634. FUNC SQRT R; # SQUARE ROOT #
      1635. PROC WRITEV; # WRITE ONE VALUE #
      1636. END
      1637.  
      1638. #
      1639. **** PROC DATELM - XREF LIST END.
      1640. #
      1641.  
      1642. DEF AVGC #"AV"#; # AVERAGE #
      1643. DEF PCTC #"PC"#; # PERCENTAGE #
      1644. DEF SDVC #"SD"#; # STANDARD DEVIATION #
      1645. DEF ZOPC #"Z"#; # *Z* OPTION #
      1646.  
      1647. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      1648.  
      1649. *CALL COMUCPD
      1650.  
      1651. #
      1652. * LOCAL VARIABLES.
      1653. #
      1654.  
      1655. ITEM AV R; # AVERAGE VALUE #
      1656. ITEM BCL I; # BEGIN COLUMN TO PRINT #
      1657. ITEM I I; # FOR LOOP CONTROL #
      1658. ITEM NIP R; # NUMBER OF COLUMNS PER PAGE #
      1659. ITEM NSR R; # NUMBER OF BLOCKS PER COLUMN #
      1660. ITEM PRFLG B; # PROCESS FLAG #
      1661. ITEM SM R; # INTERVAL SUM #
      1662. ITEM SQ R; # INTERVAL SUM SQUARED #
      1663. ITEM SSM R; # SUM OF SUBTOTAL #
      1664. ITEM SSQ R; # SQUARED SUM OF SUBTOTAL #
      1665. ITEM SWF R; # SUM OF WEIGHT FACTOR #
      1666. ITEM WFT R; # WEIGHT FACTOR #
      1667.  
      1668. ARRAY TEM [1:11] P(3); # COMPUTED STATISTIC VALUES #
      1669. BEGIN
      1670. ITEM TEM$AV R(00,00,60); # AVERAGE #
      1671. ITEM TEM$SD R(01,00,60); # STANDARD DEVIATION #
      1672. ITEM TEM$PC R(02,00,60); # PERCENTAGE #
      1673. END
      1674.  
      1675.  
      1676.  
      1677. #
      1678. * BEGIN DATELM PROC.
      1679. #
      1680.  
      1681. COMPWF(WFA,WFP,POS,WFT,PRFLG); # COMPUTE WEIGHT FACTOR #
      1682. IF (NOT PRFLG) # NOT TO PROCESS THIS ELEMENT #
      1683. THEN
      1684. BEGIN
      1685. RETURN;
      1686. END
      1687.  
      1688. P<DCHD>=LOC(DBUF);
      1689. P<DCDT>=LOC(DBUF[DCHL]);
      1690. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      1691. P<DDSC>=LOC(DDDT);
      1692.  
      1693. #
      1694. * CHECK IF ENTIRE LINE IS ZERO. IF SO, DO NOT PRINT THIS LINE.
      1695. #
      1696.  
      1697. SM=0;
      1698. SLOWFOR I=1 STEP 1 UNTIL NIPP
      1699. DO
      1700. BEGIN
      1701. SM=SM + DCDT$SM[(I-1)*DCDL + FWA];
      1702. END
      1703.  
      1704. IF (SM EQ 0.0) AND (P$LO NQ ZOPC) AND (NIPP GR (DCDC-3))
      1705. THEN
      1706. BEGIN
      1707. RETURN;
      1708. END
      1709.  
      1710. IF (NIPP LQ (DCDC-3)) # PRINT TOTAL ON THIS PAGE #
      1711. THEN # CHECK IF TOTAL IS 0 #
      1712. BEGIN
      1713. IF (DDSM$IM[FWA] EQ 0) AND (P$LO NQ ZOPC)
      1714. THEN
      1715. BEGIN
      1716. RETURN;
      1717. END
      1718.  
      1719. END
      1720.  
      1721. #
      1722. * CHECK IF SUBTITLE HAS BEEN PRINTED.
      1723. #
      1724.  
      1725. IF (FLG) # SUBTITLE NOT PRINTED #
      1726. THEN # PRINT SUBTITLE #
      1727. BEGIN
      1728. WRITEV(MS1,CHRC,1,22,LFDC);
      1729. FLG=FALSE; # INDICATE SUBTITLE WAS PRINTED #
      1730. END
      1731.  
      1732. WRITEV(MS2,CHRC,1,22,NLFC); # WRITE DATA ELEMENT NAME #
      1733.  
      1734. #
      1735. * COMPUTE AVERAGE, STANDARD DEVIATION, AND PERCENTAGE
      1736. * FOR *NIPP* INTERVALS. THE COMPUTED VALUES ARE SAVED
      1737. * IN ARRAY *TEM*.
      1738. #
      1739.  
      1740. BCL=BCLC; # BEGIN COLUMN TO PRINT #
      1741. NSR=NSF; # CONVERT TO REAL #
      1742. NIP=NIPP; # CONVERT TO REAL #
      1743. SSM=0.0;
      1744. SSQ=0.0;
      1745. SWF=0.0;
      1746.  
      1747. IF (NIPP GR 0)
      1748. THEN
      1749. BEGIN # COMPUTE INTERVAL STATISTICS #
      1750. FASTFOR I=1 STEP 1 UNTIL NIPP
      1751. DO
      1752. BEGIN # COMPUTE *AV*, *SD*, *PC* #
      1753. SM=DCDT$SM[(I-1)*DCDL + FWA];
      1754. SSM=SSM+SM;
      1755. SQ=DCDT$SQ[(I-1)*DCDL+DCDC*DCDL+FWA];
      1756. SSQ=SSQ+SQ;
      1757. AV=SM/NSR; # AVERAGE #
      1758. TEM$AV[I]=AV;
      1759. TEM$SD[I]=SQRT(SQ/NSR - AV*AV); # STANDARD DEVIATION #
      1760. DCDT$SQ[(I-1)*DCDL+DCDC*DCDL+FWA]=TEM$SD[I]; # SAVE *SD* #
      1761. DCDT$SM[(I-1)*DCDL+FWA]=TEM$AV[I]; # SAVE *AV* #
      1762.  
      1763. IF (WFA EQ IWFC) # INDIRECT WEIGHT FACTOR #
      1764. THEN # GET WEIGHT FACTOR #
      1765. BEGIN
      1766. WFT=DCDT$SM[(I-1)*DCDL + DDSC$FW[WFP]]/NSR;
      1767. SWF=SWF+WFT;
      1768. END
      1769.  
      1770. IF (WFT LQ 0)
      1771. THEN
      1772. BEGIN
      1773. TEM$PC[I]=0.0;
      1774. END
      1775.  
      1776. ELSE
      1777. BEGIN
      1778. TEM$PC[I]=(AV/WFT)*100.0; # PERCENTAGE #
      1779. END
      1780.  
      1781. END # COMPUTE *AV*, *SD*, *PC* #
      1782.  
      1783. #
      1784. * COMPUTE AVERAGE, STANDARD DEVIATION, AND PERCENTAGE
      1785. * OF SUBTOTAL. THE PRECEDING INTERVALS ARE CONSIDERED
      1786. * AS ONE INTERVAL.
      1787. #
      1788.  
      1789. IF (TCOL GR (DCDC-3)) # PRINT SUBTOTAL #
      1790. THEN
      1791. BEGIN # COMPUTE SUBTOTAL STATISTICS #
      1792. I=NIPP+1;
      1793. TEM$AV[I]=SSM/(NIP*NSR); # AVERAGE #
      1794. TEM$SD[I]=SQRT(SSQ/(NIP*NSR)-(TEM$AV[I]*TEM$AV[I]));
      1795. IF (WFA EQ IWFC) # INDIRECT WEIGHT FACTOR #
      1796. THEN
      1797. BEGIN
      1798. WFT=SWF/NIP; # WEIGHT FACTOR #
      1799. END
      1800.  
      1801. IF (WFT LQ 0)
      1802. THEN
      1803. BEGIN
      1804. TEM$PC[I]=0.0;
      1805. END
      1806.  
      1807. ELSE
      1808. BEGIN
      1809. TEM$PC[I]=(TEM$AV[I]/WFT)*100.0;
      1810. END
      1811.  
      1812. BCL=BCL + I*10;
      1813. END # COMPUTE SUBTOTAL STATISTICS #
      1814.  
      1815. ELSE # NO SUBTOTAL #
      1816. BEGIN
      1817. BCL=BCL + NIPP*10;
      1818. END
      1819.  
      1820. END # COMPUTE INTERVAL STATISTICS #
      1821.  
      1822. #
      1823. * PRINT VALUES SAVED IN ARRAY *TEM*.
      1824. * AVERAGE VALUES ARE NOT PRINTED IF THE WEIGHT FACTOR
      1825. * IS 1.
      1826. * PERCENTAGE VALUES ARE NOT PRINTED IF *WFT* IS LESS THAN 0.
      1827. * THE TOTAL STATISTIC VALUES ARE NOT PRINTED IF THERE ARE
      1828. * MORE THAN 7 COLUMNS PRINTED ON A PAGE, I.E. IF THE NUMBER
      1829. * OF INTERVALS PER PAGE *NIPP* IS GREATER THAN 7.
      1830. #
      1831.  
      1832. IF (WFA NQ CWFC) OR (WFP NQ 1)
      1833. THEN
      1834. BEGIN # PRINT *AV* #
      1835. WRITEV(AVGC,CHRC,BCLC-2,2,NLFC);
      1836. IF (NIPP GR 0) # MORE THAN 1 COLUMN #
      1837. THEN
      1838. BEGIN
      1839. PRDTEL(LOC(TEM$AV[1]),DTY,LOC(DDSM$AX[FWA]));
      1840. END
      1841.  
      1842. IF (NIPP LQ (DCDC-3)) # PRINT TOTAL ON SAME PAGE #
      1843. THEN
      1844. BEGIN
      1845. ACMSTA(STVAL"AVST",FWA,DTY,BCL,0); # TOTAL AVERAGE #
      1846. END
      1847.  
      1848. END # PRINT *AV* #
      1849.  
      1850. WRITEV(SDVC,CHRC,BCLC-2,2,NLFC);
      1851. IF (NIPP GR 0) # MORE THAN 1 COLUMN #
      1852. THEN
      1853. BEGIN # PRINT *SD* #
      1854. PRDTEL(LOC(TEM$SD[1]),FLPC,LOC(DDSM$SX[FWA]));
      1855. END # PRINT *SD* #
      1856.  
      1857. IF (NIPP LQ (DCDC-3)) # PRINT TOTAL ON SAME PAGE #
      1858. THEN
      1859. BEGIN
      1860. ACMSTA(STVAL"SDST",FWA,FLPC,BCL,0); # STANDARD DEVIATION #
      1861. END
      1862.  
      1863. IF (WFT GQ 0.0) # PERCENTAGE TO BE PRINTED #
      1864. THEN
      1865. BEGIN # PRINT *PC* #
      1866. WRITEV(PCTC,CHRC,BCLC-2,2,NLFC);
      1867. IF (NIPP GR 0) # MORE THAN 1 COLUMN #
      1868. THEN
      1869. BEGIN
      1870. PRDTEL(LOC(TEM$PC[1]),FLPC,LOC(DDSM$PX[FWA]));
      1871. END
      1872.  
      1873. IF (WFA EQ IWFC) # INDIRECT WEIGHT FACTOR #
      1874. THEN
      1875. BEGIN
      1876. WFT=DDSM$SM[DDSC$FW[WFP]]/ACNS; # TOTAL WEIGHT FACTOR #
      1877. END
      1878.  
      1879. IF (NIPP LQ (DCDC-3)) # TOTAL IS PRINTED ON SAME PAGE #
      1880. THEN
      1881. BEGIN
      1882. ACMSTA(STVAL"PCST",FWA,FLPC,BCL,WFT); # TOTAL PERCENTAGE #
      1883. END
      1884.  
      1885. END # PRINT *PC* #
      1886.  
      1887. RETURN;
      1888. END # DATELM #
      1889.  
      1890. TERM
      1891. PROC DECODE((DTA),(BFA));
      1892. # TITLE DECODE - DECODE DATA. #
      1893.  
      1894. BEGIN # DECODE #
      1895.  
      1896. #
      1897. ** DECODE - DECODE DATA.
      1898. *
      1899. * DECODE DATA IN *CIO* INPUT BUFFER, AND PUT THEM
      1900. * IN CORRESPONDING DECODED BUFFER.
      1901. *
      1902. * PROC DECODE((DTA),(BFA))
      1903. *
      1904. * ENTRY DTA = ADDRESS OF DATA DESCRIPTION TABLE
      1905. * (*DDHD* OR *DDDT*).
      1906. * BFA = ADDRESS OF THE BUFFER WHERE THE DECODED DATA
      1907. * ARE TO BE SAVED (*DCHD* OR *DCDT*).
      1908. * IBWA = CURRENT *CIO* INPUT BUFFER ADDRESS.
      1909. *
      1910. * EXIT IBWA = ADDRESS OF NEXT *CIO* INPUT BUFFER WORD.
      1911. * DECODED DATA ARE ACCUMULATED IN THE APPROPRIATE
      1912. * BUFFER.
      1913. #
      1914.  
      1915. #
      1916. * PARAMETER LIST.
      1917. #
      1918.  
      1919. ITEM BFA I; # BUFFER ADDRESS #
      1920. ITEM DTA I; # DATA DESCRIPTOR TABLE ADDRESS #
      1921.  
      1922. #
      1923. **** PROC DECODE - XREF LIST BEGIN.
      1924. #
      1925.  
      1926. XREF
      1927. BEGIN
      1928. FUNC GETVAL I; # GET VALUE FROM *CIO* BUFFER #
      1929. PROC PERROR; # PROCESS ERROR #
      1930. END
      1931.  
      1932. #
      1933. **** PROC DECODE - XREF LIST END.
      1934. #
      1935.  
      1936. DEF CNIC #"CNIL"#; # FAST LOOP SAMPLE #
      1937. DEF CPWC #5#; # NUMBER OF BYTES #
      1938. DEF CTMC #"CTML"#; # MEDIUM LOOP SAMPLE #
      1939. DEF CTOC #"CTOL"#; # SLOW LOOP SAMPLE #
      1940. DEF HDLC #0#; # HEADER LOOP FLAG #
      1941. DEF PDTC #"PDTM"#; # PACKED DATE AND TIME #
      1942. DEF SNLC #4#; # SNAP SHOT LOOP FLAG #
      1943.  
      1944. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      1945.  
      1946. *CALL COMUCPD
      1947.  
      1948. #
      1949. * LOCAL VARIABLES.
      1950. #
      1951.  
      1952. ITEM AV R; # AVERAGE VALUE #
      1953. ITEM BA I; # BYTE ADDRESS OF *CIO* BUFFER #
      1954. ITEM BASE I; # BEGIN ADDRESS OF REPEAT GROUP #
      1955. ITEM C I; # DECODED DATA BUFFER ADDRESS #
      1956. ITEM CQ I; # DECODED DATA BUFFER ADDRESS #
      1957. ITEM I I; # FOR LOOP CONTROL #
      1958. ITEM IC I; # INCREMENTOR #
      1959. ITEM J I; # FOR LOOP CONTROL #
      1960. ITEM K I; # FOR LOOP CONTROL #
      1961. ITEM L I; # FOR LOOP CONTROL #
      1962. ITEM LMP I; # LENGTH MULTIPLIER #
      1963. ITEM LN I; # LENGTH OF ENTRY #
      1964. ITEM M I; # FOR LOOP CONTROL #
      1965. ITEM NM C(4); # DATA ELEMENT NAME #
      1966. ITEM OF I; # OFFSET #
      1967. ITEM PR I; # NUMBER OF PP WORDS OCCUPIED #
      1968. ITEM TP U; # DATA TYPE OF ELEMENT #
      1969. ITEM VL I; # DECODED VALUE #
      1970. ITEM VLR R; # DECODED VALUE #
      1971.  
      1972. BASED
      1973. ARRAY BUF [0:0] P(1); # DECODED BUFFER #
      1974. BEGIN # ARRAY BUF #
      1975. ITEM BUF$WD U(00,00,60); # DECODED DATA #
      1976. ITEM BUF$SQ R(00,00,60); # SUM SQUARE #
      1977. ITEM BUF$SM R(00,00,60); # SUM #
      1978. ITEM BUF$ET U(00,00,30); # INTERVAL START TIME #
      1979. ITEM BUF$BT U(00,30,30); # INTERVAL END TIME #
      1980. END # ARRAY BUF #
      1981.  
      1982. ARRAY SPT [1:3] P(1); # LOOP SAMPLE TIMES #
      1983. BEGIN # ARRAY SPT #
      1984. ITEM SPT$WD I(00,00,60); # SAMPLE TIME #
      1985. END # ARRAY SPT #
      1986.  
      1987.  
      1988.  
      1989.  
      1990.  
      1991.  
      1992. #
      1993. * BEGIN DECODE PROC.
      1994. #
      1995.  
      1996. P<DCHD>=LOC(DBUF);
      1997. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      1998. P<MPAR>=DTA;
      1999. P<DDSC>=LOC(DDHD);
      2000. P<BUF>=BFA;
      2001. BA=IBWA*CPWC;
      2002.  
      2003. IF (MPAR$TP[0] NQ HDLC) # NOT HEADER BLOCK #
      2004. THEN
      2005. BEGIN # GET LOOP SAMPLE TIMES #
      2006. FASTFOR I=1 STEP 1 UNTIL 3
      2007. DO
      2008. BEGIN
      2009. SPT$WD[I]=GETVAL(BA+SPLA$WD[I],2);
      2010. END
      2011.  
      2012. END # GET LOOP SAMPLE TIMES #
      2013.  
      2014. #
      2015. * FOLLOW TABLE *MPAR* TO EXTRACT DATA FROM *CIO* BUFFER AND PUT
      2016. * THEM IN THE DECODED DATA BUFFER.
      2017. * THE VALUES STORED IN THE DECODED DATA BUFFER FOR THE DATA
      2018. * BLOCK ELEMENTS ARE THE CUMULATIVE AVERAGES. THE AVERAGE OF
      2019. * EACH DATA BLOCK ELEMENT IS COMPUTED BY TAKING THE EXTRACTED
      2020. * VALUE AND DIVIDING IT BY THE RESPECTIVE LOOP-S SAMPLE TIME
      2021. * (*SPT* ARRAY). THE SQUARED AVERAGES ARE ALSO COMPUTED FOR
      2022. * THE DATA BLOCK ELEMENTS.
      2023. #
      2024.  
      2025. C=0; # BEGIN ADDRESS TO STORE AVERAGE #
      2026. OF=DCDL*DCDC; # OFFSET #
      2027. J=0;
      2028.  
      2029. SLOWFOR M=0 WHILE (MPAR$WD[J] NQ 0)
      2030. DO
      2031. BEGIN # FOLLOW TABLE *MPAR* #
      2032. BASE=J;
      2033. LMP=1;
      2034. IF (MPAR$LMP[J] NQ NULL)
      2035. THEN
      2036. BEGIN
      2037. LMP=DCHD$WD[DDSC$FW[MPAR$LMP[J]]]; # REPEAT GROUP LENGTH #
      2038. END
      2039.  
      2040. #
      2041. * *LMP* IS GREATER THAN 1 IF THE REPEAT GROUP HAS
      2042. * MULTIPLE ENTRIES.
      2043. #
      2044.  
      2045. FASTFOR K=1 STEP 1 UNTIL LMP
      2046. DO
      2047. BEGIN # COLLECT REPEAT GROUP VALUES #
      2048. J=BASE;
      2049. IC=MPAR$IC[J];
      2050.  
      2051. #
      2052. * *IC* IS THE SIZE OF THE REPEAT GROUP.
      2053. * SINGLE ELEMENTS HAVE *IC* EQUAL TO 1.
      2054. #
      2055.  
      2056. FASTFOR L=1 STEP 1 UNTIL IC
      2057. DO
      2058. BEGIN # COLLECT ONE ENTRY OF REPEAT GROUP #
      2059. NM=MPAR$NM[J]; # NAME #
      2060. TP=MPAR$TP[J]; # TYPE #
      2061. LN=MPAR$LN[J]; # LENGTH #
      2062. PR=MPAR$PR[J]; # PRECISION #
      2063. IF (PR GR CPWC)
      2064. THEN
      2065. BEGIN
      2066. LN=(PR/CPWC)*LN;
      2067. PR=CPWC;
      2068. END
      2069.  
      2070. #
      2071. * *LN* IS GREATER THAN 1 IF THE ELEMENT HAS MULTIPLE
      2072. * ENTRIES.
      2073. #
      2074.  
      2075. FASTFOR I=1 STEP 1 UNTIL LN
      2076. DO
      2077. BEGIN # COLLECT VALUE OF ONE ENTRY #
      2078. CQ=C + OF; # ADDRESS OF SQUARED AVERAGE #
      2079. VL=GETVAL(BA,PR); # GET VALUE FROM *CIO* BUFFER #
      2080.  
      2081. IF (TP EQ HDLC) # HEADER BLOCK #
      2082. OR (TP EQ SNLC) # SNAPSHOT LOOP #
      2083. THEN
      2084. BEGIN # COLLECT VALUES #
      2085.  
      2086. #
      2087. * HEADER BLOCK AND SNAPSHOT LOOP DATA ELEMENTS ARE NOT CUMULATIVE
      2088. * VALUES.
      2089. #
      2090.  
      2091. IF (NM EQ PDTC) # PACKED DATE AND TIME #
      2092. THEN
      2093. BEGIN # GET TIME #
      2094. BUF$ET[CQ]=VL-(VL/SHFC)*SHFC; # INTERVAL END TIME #
      2095. IF (DDSM$BT[C] EQ 0) # TOTAL *BT* NOT COLLECTED #
      2096. THEN
      2097. BEGIN
      2098. DDSM$BT[C]=VL; # TOTAL BEGIN TIME #
      2099. END
      2100.  
      2101. IF (BUF$BT[CQ] EQ 0) # INTERVAL *BT* NOT COLLECTED #
      2102. THEN
      2103. BEGIN
      2104. BUF$BT[CQ]=BUF$ET[CQ]; # INTERVAL BEGIN TIME #
      2105. END
      2106.  
      2107. END # GET TIME #
      2108.  
      2109. BUF$WD[C]=VL;
      2110. IF (TP EQ SNLC) # SNAPSHOT LOOP #
      2111. THEN
      2112. BEGIN
      2113. DDSM$IM[C]=VL;
      2114. END
      2115.  
      2116. END # COLLECT VALUES #
      2117.  
      2118. ELSE # FAST, MEDIUM, SLOW LOOP #
      2119. BEGIN # DECODE DATA BLOCK VALUES #
      2120.  
      2121. #
      2122. * THE FAST, MEDIUM, AND SLOW LOOP DATA ELEMENTS ARE CUMULATIVE
      2123. * VALUES. THE VALUES SAVED IN THE DECODED BUFFER ARE CUMULATIVE
      2124. * AVERAGE VALUES. THE AVERAGE VALUE IS COMPUTED BY TAKING THE
      2125. * VALUE DECODED FROM THE INPUT BUFFER (READ IN FROM THE DATA
      2126. * FILE) AND DEVIDE IT BY THE RESPECTIVE LOOP SAMPLE TIME.
      2127. * THE AVERAGE SQUARE IS ALSO COMPUTED AND SAVED IN THE DECODED
      2128. * BUFFER FOR EACH DATA BLOCK ELEMENTS.
      2129. #
      2130.  
      2131. IF (NM EQ CNIC)
      2132. OR (NM EQ CTMC)
      2133. OR (NM EQ CTOC) # LOOP SAMPLE TIMES #
      2134. THEN # ACCUMULATE SAMPLE TIMES #
      2135. BEGIN
      2136. BUF$WD[C]=BUF$WD[C] + VL;
      2137. DDSM$IM[C]=DDSM$IM[C] + VL;
      2138. END
      2139.  
      2140. ELSE
      2141. BEGIN # COMPUTE CUMULATIVE *AV* AND SQUARED *AV* #
      2142. IF (SPT$WD[TP] NQ 0) # NUMBER OF SAMPLES .NE. 0 #
      2143. THEN
      2144. BEGIN
      2145. VLR=VL;
      2146. AV=VLR/SPT$WD[TP];
      2147. BUF$SM[C]=BUF$SM[C] + AV;
      2148. BUF$SQ[CQ]=BUF$SQ[CQ] + AV*AV;
      2149. DDSM$SM[C]=DDSM$SM[C] + AV;
      2150. DDSM$SQ[C]=DDSM$SQ[C] + AV*AV;
      2151. END
      2152.  
      2153. END # COMPUTE CUMULATIVE *AV* AND SQUARED *AV* #
      2154.  
      2155. END # DECODE DATA BLOCK VALUES #
      2156.  
      2157. C=C+1; # NEXT DECODED BUFFER ADDRESS #
      2158. BA=BA+PR; # NEXT *CIO* BUFFER BYTE ADDRESS #
      2159. END # COLLECT VALUE OF ONE ENTRY #
      2160.  
      2161. J=J+1;
      2162. END # COLLECT ONE ENTRY OF REPEAT GROUP #
      2163.  
      2164. END # COLLECT REPEAT GROUP VALUES #
      2165.  
      2166. END # FOLLOW TABLE *MPAR* #
      2167.  
      2168. #
      2169. * CHECK IF THERE IS ANY MISSING ELEMENTS. THE VALUE OF
      2170. * *IBWA* HAS TO BE A MULTIPLE OF *IBNW*, FOR THE *CIO* BUFFER
      2171. * HAS TO CONTAIN A MULTIPLE NUMBER OF DATA BLOCKS OR
      2172. * HEADER BLOCK.
      2173. #
      2174.  
      2175. C=BA/CPWC;
      2176. IBWA=C+1; # NEXT *CIO* BUFFER ADDRESS #
      2177. J=BA - (C*CPWC);
      2178. IF (J NQ 0)
      2179. THEN
      2180. BEGIN
      2181. C=C+1;
      2182. END
      2183.  
      2184. I=IBNW - (IBNW/C)*C;
      2185. IF (I NQ 0) # NOT A MULTIPLE OF *IBNW* #
      2186. THEN
      2187. BEGIN
      2188. PERROR(ERM6,FATAL,NULL); # DATA FILE CONTENT ERROR #
      2189. END
      2190.  
      2191. RETURN;
      2192. END # DECODE #
      2193.  
      2194. TERM
      2195. PROC DETMXM(MXP,MNP,(MXI),(MNI),(DTY));
      2196. # TITLE DETMXM - DETERMINE MAXIMUM AND MINIMUM VALUES. #
      2197.  
      2198. BEGIN # DETMXM #
      2199.  
      2200. #
      2201. ** DETMXM - DETERMINE MAXIMUM AND MINIMUM VALUES.
      2202. *
      2203. * DETERMINE THE MINIMUM AND MAXIMUM VALUES OF ONE
      2204. * REPORT LINE. THE MAXIMUM VALUE IS INDICATED BY BRACKETS,
      2205. * THE MINIMUM VALUE IS INDICATED BY PARENTHESES.
      2206. *
      2207. * PROC DETMXM(MXP,MNP,(MXI),(MNI),(DTY))
      2208. *
      2209. * ENTRY MXP = MAXIMUM VALUE ADDRESS.
      2210. * MNP = MINIMUM VALUE ADDRESS.
      2211. * MXI = INTERVAL CONTAINING MAXIMUM VALUE.
      2212. * MNI = INTERVAL CONTAINING MINIMUM VALUE.
      2213. * DTY = DATA TYPE.
      2214. *
      2215. * EXIT MAXIMUM AND MINIMUM VALUES ARE INDICATED BY
      2216. * BRACKETS AND PARENTHESES, RESPECTIVELY.
      2217. #
      2218.  
      2219. #
      2220. * PARAMETER LIST.
      2221. #
      2222.  
      2223. ITEM MXP U; # ADDRESS OF MAXIMUM VALUE #
      2224. ITEM MNP U; # ADDRESS OF MINIMUM VALUE #
      2225. ITEM MXI I; # COLUMN OF MAXIMUM VALUE #
      2226. ITEM MNI I; # COLUMN OF MINIMUM VALUE #
      2227. ITEM DTY U; # DATA TYPE #
      2228.  
      2229. #
      2230. **** PROC DETMXM - XREF LIST BEGIN.
      2231. #
      2232.  
      2233. XREF
      2234. BEGIN
      2235. FUNC XCDD C(10); # BINARY TO DISPLAY DECIMAL #
      2236. FUNC XCED C(10); # BINARY TO *E* FORMAT #
      2237. FUNC XCOD C(10); # BINARY TO DISPLAY OCTAL #
      2238. FUNC XCFD C(10); # BINARY TO DISPLAY REAL #
      2239. PROC WRITEV; # WRITE DATA ELEMENT #
      2240. END
      2241.  
      2242. #
      2243. **** PROC DETMXM - XREF LIST END.
      2244. #
      2245.  
      2246. DEF BLKC #" "#; # BLANK #
      2247. DEF LBKC #"["#; # LEFT BRACKET #
      2248. DEF LPRC #"("#; # LEFT PARENTHESIS #
      2249. DEF MAXF #1.0E4#; # MAXIMUM VALUE OF *F* FORMAT #
      2250. DEF RBKC #"]"#; # RIGHT BRACKET #
      2251. DEF RPRC #")"#; # RIGHT PARENTHESIS #
      2252.  
      2253. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      2254.  
      2255. *CALL COMUCPD
      2256.  
      2257. #
      2258. * LOCAL VARIABLES.
      2259. #
      2260.  
      2261. ITEM I I; # FOR LOOP CONTROL #
      2262. ITEM MN I; # TEMPORARY VALUE #
      2263. ITEM MNF R; # TEMPORARY VALUE #
      2264. ITEM MX I; # TEMPORARY VALUE #
      2265. ITEM MXF R; # TEMPORARY VALUE #
      2266.  
      2267. ARRAY OCV [0:0] P(1); # OCTAL VALUE #
      2268. BEGIN # ARRAY OCV #
      2269. ITEM OC$WD C(00,00,10); # VALUE #
      2270. ITEM OC$NP C(00,06,09); # NO POSTFIX #
      2271. END # ARRAY OCV #
      2272.  
      2273. ARRAY TM [0:0] P(1); # TEMPORARY BUFFER #
      2274. BEGIN # ARRAY TM #
      2275. ITEM TM$WD C(00,00,10); # DISPLAY CODE MINIMUM VALUE #
      2276. ITEM TM$W1 C(00,00,09); # VALUE WITH NO POSTFIX #
      2277. END # ARRAY TM #
      2278.  
      2279. ARRAY TX [0:0] P(1); # TEMPORARY BUFFER #
      2280. BEGIN # ARRAY TX #
      2281. ITEM TX$WD C(00,00,10); # DISPLAY CODE MAXIMUM VALUE #
      2282. ITEM TX$W1 C(00,00,09); # VALUE WITH NO POSTFIX #
      2283. END # ARRAY TX #
      2284.  
      2285. BASED
      2286. ARRAY VLMN [0:0] P(1); # MINIMUM VALUE #
      2287. BEGIN # ARRAY VLMN #
      2288. ITEM VLMN$F R(00,00,60); # REAL VALUE #
      2289. ITEM VLMN$N I(00,00,60); # INTEGER VALUE #
      2290. END # ARRAY VLMN #
      2291.  
      2292. BASED
      2293. ARRAY VLMX [0:0] P(1); # MAXIMUM VALUE #
      2294. BEGIN # ARRAY VLMX #
      2295. ITEM VLMX$F R(00,00,60); # REAL VALUE #
      2296. ITEM VLMX$N I(00,00,60); # INTEGER VALUE #
      2297. END # ARRAY VLMX #
      2298.  
      2299.  
      2300.  
      2301.  
      2302.  
      2303. #
      2304. * BEGIN DETMXM PROC.
      2305. #
      2306.  
      2307. IF (P$L EQ NULL) # NO REPORT FILE #
      2308. THEN
      2309. BEGIN
      2310. RETURN;
      2311. END
      2312.  
      2313. #
      2314. * CONVERT MAXIMUM AND MINIMUM VALUES TO DISPLAY CODE.
      2315. #
      2316.  
      2317. P<VLMX>=LOC(MXP);
      2318. P<VLMN>=LOC(MNP);
      2319. IF (DTY EQ FLPC) # REAL VALUE #
      2320. THEN
      2321. BEGIN
      2322. IF (VLMX$F[0] GQ MAXF)
      2323. THEN
      2324. BEGIN # CONVERT TO *E* FORMAT #
      2325. MXF=VLMX$F[0];
      2326. TX$WD[0]=XCED(MXF);
      2327. END # CONVERT TO *E* FORMAT #
      2328.  
      2329. ELSE
      2330. BEGIN # CONVERT TO *F* FORMAT #
      2331. MX=VLMX$F[0]*1000.0 + 0.5;
      2332. TX$WD[0]=XCFD(MX);
      2333. END # CONVERT TO *F* FORMAT #
      2334.  
      2335. IF (VLMN$F[0] GQ MAXF)
      2336. THEN
      2337. BEGIN # CONVERT TO *E* FORMAT #
      2338. MNF=VLMN$F[0];
      2339. TM$WD[0]=XCED(MNF);
      2340. END # CONVERT TO *E* FORMAT #
      2341.  
      2342. ELSE
      2343. BEGIN # CONVERT TO *F* FORMAT #
      2344. MN=VLMN$F[0]*1000.0 + 0.5;
      2345. TM$WD[0]=XCFD(MN);
      2346. END # CONVERT TO *F* FORMAT #
      2347.  
      2348. END
      2349.  
      2350. ELSE
      2351. BEGIN
      2352. IF (DTY EQ INTC) # INTEGER VALUE #
      2353. THEN
      2354. BEGIN
      2355. TX$WD[0]=XCDD(VLMX$N[0]);
      2356. TM$WD[0]=XCDD(VLMN$N[0]);
      2357. END
      2358.  
      2359. ELSE # OCTAL VALUE #
      2360. BEGIN
      2361. OC$WD[0]=XCOD(VLMX$N[0]);
      2362. TX$W1[0]=OC$NP[0];
      2363. OC$WD[0]=XCOD(VLMN$N[0]);
      2364. TM$W1[0]=OC$NP[0];
      2365. END
      2366.  
      2367. END
      2368.  
      2369. #
      2370. * ENCLOSE THE MAXIMUM AND MINIMUM VALUES BY BRACKETS AND
      2371. * PARENTHESES, RESPECTIVELY.
      2372. #
      2373.  
      2374. SLOWFOR I=0 STEP 1 WHILE (C<I,1>TX$WD[0] EQ BLKC) DO;
      2375. MX=MXI*10 + I + 14;
      2376. WRITEV(LBKC,CHRC,MX,1,NLFC);
      2377. MX=BCLC + MXI*10;
      2378. WRITEV(RBKC,CHRC,MX,1,NLFC);
      2379.  
      2380. SLOWFOR I=0 STEP 1 WHILE (C<I,1>TM$WD[0] EQ BLKC) DO;
      2381. MN=MNI*10 + I + 14;
      2382. WRITEV(LPRC,CHRC,MN,1,NLFC);
      2383. MN=BCLC + MNI*10;
      2384. WRITEV(RPRC,CHRC,MN,1,NLFC);
      2385. RETURN;
      2386. END # DETMXM #
      2387.  
      2388. TERM
      2389. FUNC DTMNUM((VALUE),(FORM),(PDOS)) I;
      2390. # TITLE DTMNUM - CONVERT DATE/TIME TO NUMBER. #
      2391.  
      2392. BEGIN # DTMNUM #
      2393.  
      2394. #
      2395. ** DTMNUM - CONVERT DATE/TIME TO NUMBER.
      2396. *
      2397. * CONVERT DISPLAY DATE/TIME TO THE PACKED FORMAT.
      2398. *
      2399. * FUNC DTMNUM((VALUE),(FORM),(PDOS))
      2400. *
      2401. * ENTRY VALUE = VALUE TO BE CONVERTED.
      2402. * FORM = IF TRUE, THE VALUE IS IN FORMAT
      2403. * XX.YY.ZZ.
      2404. * IF FALSE, THE VALUE IS IN FORMAT
      2405. * XXYYZZ.
      2406. * PDOS = IF TRUE, THE PACKED DATE 1970 OFFSET APPLIES.
      2407. * IF FALSE, NO OFFSET IS APPLIED.
      2408. *
      2409. * EXIT VALUE IS CONVERTED TO PACKED FORMAT, AS IN
      2410. * THE PACKED DATE AND TIME FORMAT.
      2411. #
      2412.  
      2413. #
      2414. * PARAMETER LIST.
      2415. #
      2416.  
      2417. ITEM VALUE C(10); # VALUE TO BE CONVERTED #
      2418. ITEM FORM B; # FORMAT OF DATE OR TIME #
      2419. ITEM PDOS B; # APPLY PACKED DATE OFFSET #
      2420.  
      2421. #
      2422. **** FUNC DTMNUM - XREF LIST BEGIN.
      2423. #
      2424.  
      2425. XREF
      2426. BEGIN
      2427. PROC PERROR; # PROCESS ERROR #
      2428. END
      2429.  
      2430. #
      2431. **** FUNC DTMNUM - XREF LIST END.
      2432. #
      2433.  
      2434. DEF ZERC #"0"#; # CHARACTER 0 #
      2435.  
      2436. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      2437.  
      2438. *CALL COMUCPD
      2439.  
      2440. #
      2441. * LOCAL VARIABLES.
      2442. #
      2443.  
      2444. ITEM E I; # EXPONENTIAL #
      2445. ITEM I I; # FOR LOOP CONTROL #
      2446. ITEM N I; # TEMPORARY VARIABLE #
      2447. ITEM T U; # TIME #
      2448.  
      2449. ARRAY TM [0:0] P(1); # VALUE TO BE CONVERTED #
      2450. BEGIN # ARRAY TM #
      2451. ITEM TM$WD C(00,00,10); # VALUE #
      2452. ITEM TM$XX C(00,00,02); # XX OF XXYYZZ #
      2453. ITEM TM$YY C(00,12,02); # YY OF XXYYZZ #
      2454. ITEM TM$ZZ C(00,24,02); # ZZ OF XXYYZZ #
      2455.  
      2456. ITEM TM$X1 C(00,06,02); # XX OF XX.YY.ZZ #
      2457. ITEM TM$D1 C(00,18,01); # DELIMITER #
      2458. ITEM TM$Y1 C(00,24,02); # YY OF XX.YY.ZZ #
      2459. ITEM TM$D2 C(00,36,01); # DELIMITER #
      2460. ITEM TM$Z1 C(00,42,02); # ZZ OF XX.YY.ZZ #
      2461. END # ARRAY TM #
      2462.  
      2463.  
      2464.  
      2465.  
      2466.  
      2467. #
      2468. * BEGIN DTMNUM FUNC.
      2469. #
      2470.  
      2471. TM$WD[0]=VALUE;
      2472.  
      2473. IF (FORM) # FORMAT XX.YY.ZZ #
      2474. THEN # CONVERT TO FORMAT XXYYZZ #
      2475. BEGIN
      2476. TM$XX[0]=TM$X1[0];
      2477. TM$YY[0]=TM$Y1[0];
      2478. TM$ZZ[0]=TM$Z1[0];
      2479. END
      2480.  
      2481. IF (TM$WD[0] EQ 0)
      2482. THEN
      2483. BEGIN
      2484. DTMNUM=0;
      2485. RETURN;
      2486. END
      2487.  
      2488. #
      2489. * CONVERT TO THE PACKED FORMAT.
      2490. #
      2491.  
      2492. N=0;
      2493. E=1;
      2494. FASTFOR I=0 STEP 2 UNTIL 5
      2495. DO
      2496. BEGIN
      2497. T=C<5-I,1>TM$WD[0] - ZERC;
      2498. T=(C<4-I>TM$WD[0] - ZERC)*10 + T;
      2499. N=N+T*E;
      2500. E=E*64;
      2501. END
      2502.  
      2503. IF (PDOS) # CONVERTING DATE #
      2504. THEN # CHECK DATE RANGE #
      2505. BEGIN
      2506. IF (N LS Y70C) # DATE IN 21ST CENTURY #
      2507. THEN
      2508. BEGIN
      2509. N=N+Y30C; # BIAS 21ST CENTURY DATES #
      2510. END
      2511. ELSE # DATE IN 20TH CENTURY #
      2512. BEGIN
      2513. N=N-Y70C; # BIAS 20TH CENTURY DATES #
      2514. END
      2515. END
      2516.  
      2517. DTMNUM=N;
      2518. RETURN;
      2519. END # DTMNUM #
      2520.  
      2521. TERM
      2522. PROC GETMSG((ENT),MSG);
      2523. # TITLE GETMSG - GET REPORT MESSAGE. #
      2524.  
      2525. BEGIN # GETMSG #
      2526.  
      2527. #
      2528. ** GETMSG - GET REPORT MESSAGE.
      2529. *
      2530. * GET MESSAGES FROM COMMON BLOCK *DSPTTXT*.
      2531. *
      2532. * PROC GETMSG((ENT),MSG)
      2533. *
      2534. * ENTRY ENT = INDEX OF TABLE *DSPT* ENTRY.
      2535. *
      2536. * EXIT MSG = MESSAGE EXTRACTED FROM COMMON BLOCK *DSPTTXT*.
      2537. #
      2538.  
      2539. #
      2540. * PARAMETER LIST.
      2541. #
      2542.  
      2543. ITEM ENT I; # INDEX OF TABLE *DSPT* #
      2544. ITEM MSG C(50); # REPORT TITLES #
      2545.  
      2546. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      2547.  
      2548. *CALL COMUCPD
      2549.  
      2550. #
      2551. * LOCAL VARIABLES.
      2552. #
      2553.  
      2554. ITEM BA I; # BYTE ADDRESS #
      2555. ITEM BC I; # BEGINNING CHARACTER POSITION #
      2556. ITEM LN I; # MESSAGE LENGTH IN CHARACTER #
      2557.  
      2558. BASED
      2559. ARRAY TXT [0:0] P(1); # MESSAGE BUFFER #
      2560. BEGIN # ARRAY TXT #
      2561. ITEM TXT$MS C(00,00,60); # MESSAGE #
      2562. END # ARRAY TXT #
      2563.  
      2564.  
      2565.  
      2566.  
      2567.  
      2568. #
      2569. * BEGIN GETMSG PROC.
      2570. #
      2571.  
      2572. LN=DSPT$LN[ENT]; # NUMBER OF CHARACTERS #
      2573. BC=DSPT$BC[ENT]; # BEGINNING CHARACTER POSITION #
      2574. BA=BC - (BC/10)*10;
      2575. P<TXT>=LOC(DSTX$TX[BC/10]);
      2576. MSG=C<BA,LN>TXT$MS[0];
      2577. RETURN;
      2578. END # GETMSG #
      2579.  
      2580. TERM
      2581. FUNC GETVAL((BA),(PR)) I;
      2582. # TITLE GETVAL - GET VALUE FROM *CIO* BUFFER. #
      2583.  
      2584. BEGIN # GETVAL #
      2585.  
      2586. #
      2587. ** GETVAL - GET VALUE FROM *CIO* BUFFER.
      2588. *
      2589. * EXTRACT VALUES FROM THE *CIO* BUFFER OF THE DATA FILE.
      2590. *
      2591. * FUNC GETVAL((BA),(PR)) I
      2592. *
      2593. * ENTRY BA = BYTE ADDRESS OF THE VALUE TO BE EXTRACTED.
      2594. * PR = NUMBER OF BYTES TO BE EXTRACTED.
      2595. *
      2596. * EXIT THE VALUE IS EXTRACTED FROM BUFFER *WSAI*.
      2597. #
      2598.  
      2599. #
      2600. * PARAMETER LIST.
      2601. #
      2602.  
      2603. ITEM BA I; # BYTE ADDRESS #
      2604. ITEM PR I; # PRECISION #
      2605.  
      2606. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      2607.  
      2608. *CALL COMUCPD
      2609.  
      2610. #
      2611. * LOCAL VARIABLES.
      2612. #
      2613.  
      2614. ITEM BC I; # BYTE ADDRESS #
      2615. ITEM T I; # TEMPORARY VALUE #
      2616. ITEM WA I; # *CIO* BUFFER WORD ADDRESS #
      2617.  
      2618. BASED
      2619. ARRAY WSA [0:0] P(1); # WORKING BUFFER #
      2620. BEGIN # ARRAY WSA #
      2621. ITEM WSA$C C(00,00,20); # BUFFER ENTRY #
      2622. END # ARRAY WSA #
      2623.  
      2624.  
      2625.  
      2626.  
      2627.  
      2628. #
      2629. * BEGIN GETVAL FUNC.
      2630. #
      2631.  
      2632. WA=BA/5; # ADDRESS TO EXTRACT THE VALUE #
      2633. P<WSA>=LOC(WSAI$WD[WA]);
      2634. T=BA*2; # NUMBER OF CHARACTERS #
      2635. BC=T - (T/10)*10; # BEGIN CHARACTER POSITION #
      2636. GETVAL=C<BC,PR*2>WSA$C[0];
      2637. RETURN;
      2638. END # GETVAL #
      2639.  
      2640. TERM
      2641. PROC HDRELM((ENP),(FCL),(LCL));
      2642. # TITLE HDRELM - PRINT HEADER BLOCK ELEMENT. #
      2643.  
      2644. BEGIN # HDRELM #
      2645.  
      2646. #
      2647. ** HDRELM - PRINT HEADER BLOCK ELEMENT.
      2648. *
      2649. * PRINT ONE ELEMENT OF HEADER BLOCK.
      2650. *
      2651. * PROC HDRELM((ENP),(FCL),(LCL))
      2652. *
      2653. * ENTRY ENP = INDEX OF THE *DSPT* ENTRY POINTING TO
      2654. * THE HEADER BLOCK ELEMENT BEING PROCESSED.
      2655. * FCL = BEGINNING COLUMN TO PRINT THE HEADER BLOCK
      2656. * ELEMENT NAME.
      2657. * LCL = BEGINNING COLUMN TO PRINT THE HEADER BLOCK
      2658. * ELEMENT VALUE.
      2659. *
      2660. * EXIT THE HEADER BLOCK ELEMENT IS PRINTED TO THE REPORT
      2661. * FILE.
      2662. #
      2663.  
      2664. #
      2665. * PARAMETER LIST.
      2666. #
      2667.  
      2668. ITEM ENP I; # INDEX OF DSPT ENTRY #
      2669. ITEM FCL I; # BEGIN COLUMN TO PRINT NAME #
      2670. ITEM LCL I; # BEGIN COLUMN TO PRINT VALUE #
      2671.  
      2672. #
      2673. **** PROC HDRELM - XREF LIST BEGIN.
      2674. #
      2675.  
      2676. XREF
      2677. BEGIN
      2678. PROC GETMSG; # GET TITLE FROM TABLE *DSPTTXT* #
      2679. PROC WRITEV; # WRITE DATA ELEMENT #
      2680. END
      2681.  
      2682. #
      2683. **** PROC HDRELM - XREF LIST END.
      2684. #
      2685.  
      2686. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      2687.  
      2688. *CALL COMUCPD
      2689.  
      2690. #
      2691. * LOCAL VARIABLES.
      2692. #
      2693.  
      2694. ITEM BL I; # BIT LENGTH #
      2695. ITEM BT I; # BIT POSITION #
      2696. ITEM D I; # DATA TYPE #
      2697. ITEM J I; # POINTER TO *DDHD* TABLE #
      2698. ITEM L I; # TITLE LENGTH IN CHARACTERS #
      2699. ITEM MSG C(50); # TEMPORARY BUFFER #
      2700. ITEM T I; # POINTER TO *DCHD* TABLE #
      2701. ITEM VALUE I; # TEMPORARY VALUE #
      2702. ITEM WC I; # WORD COUNT #
      2703.  
      2704.  
      2705.  
      2706.  
      2707.  
      2708. #
      2709. * BEGIN HDRELM PROC.
      2710. #
      2711.  
      2712. P<DCHD>=LOC(DBUF);
      2713. P<DDSC>=LOC(DDHD);
      2714. J=DSPT$PT[ENP]; # INDEX OF TABLE *DDSC* #
      2715. L=DSPT$LN[ENP];
      2716. T=DDSC$FW[J]; # INDEX OF TABLE *DCHD* #
      2717. D=DDSC$TY[J]; # DATA TYPE #
      2718. GETMSG(ENP,MSG);
      2719. WRITEV(MSG,CHRC,FCL,L,NLFC);
      2720. BL=DSPT$BL[ENP]; # GET BIT LENGTH #
      2721. WC=DSPT$WC[ENP]; # WORD COUNT #
      2722. IF (BL EQ 0) # ACCESS FULL WORD #
      2723. THEN
      2724. BEGIN
      2725. VALUE=DCHD$WD[T+WC];
      2726. END
      2727.  
      2728. ELSE # ACCESS PARTIAL WORD #
      2729. BEGIN
      2730. BT=DSPT$BT[ENP];
      2731. VALUE=B<BT,BL>DCHD$WD[T+WC];
      2732. END
      2733.  
      2734. WRITEV(VALUE,D,LCL,10,LFDC);
      2735. RETURN;
      2736. END # HDRELM #
      2737. TERM
      2738. PROC HEADER(TMED,HDDC,(LSTM));
      2739. # TITLE HEADER - PROCESS HEADER BLOCK. #
      2740.  
      2741. BEGIN # HEADER #
      2742.  
      2743. #
      2744. ** HEADER - PROCESS HEADER BLOCK.
      2745. *
      2746. * *HEADER* BUILDS THE REPORT TITLE AND PROCESSES THE HEADER BLOCK
      2747. * OF EACH FILE IN THE DATA FILE.
      2748. *
      2749. * PROC HEADER(TMED,HDDC,(LSTM))
      2750. *
      2751. * ENTRY HDDC = TRUE IF HEADER BLOCK HAS BEEN DECODED.
      2752. * LSTM = TIME OF LAST RECORD.
      2753. *
      2754. * EXIT TMED = TRUE IF *N* PARAMETER EXCEEDS NUMBER OF FILES.
      2755. * HDDC = FALSE
      2756. * ELEMENTS IN HEADER BLOCK ARE PRINTED TO THE
      2757. * REPORT FILE.
      2758. #
      2759.  
      2760. #
      2761. * PARAMETER LIST.
      2762. #
      2763.  
      2764. ITEM TMED B; # EOI FLAG #
      2765. ITEM HDDC B; # DECODE HEADER BLOCK FLAG #
      2766. ITEM LSTM U; # ENDING TIME OF PREVIOUS FILE #
      2767.  
      2768. #
      2769. **** PROC HEADER - XREF LIST BEGIN.
      2770. #
      2771.  
      2772. XREF
      2773. BEGIN
      2774. PROC ADJUST; # ADJUST TABLES AND FIELD LENGTH #
      2775. PROC BZFILL; # BLANK/ZERO FILL ITEM #
      2776. PROC DECODE; # DECODE *CIO* INPUT BUFFER DATA #
      2777. FUNC DTMNUM U; # CONVERT DATE/TIME TO BINARY #
      2778. PROC PERROR; # PROCESS ERROR #
      2779. PROC PUTEST; # PRINT EST #
      2780. PROC PUTHDR; # PRINT HEADER ELEMENTS #
      2781. PROC PUTSCI; # PRINT JOB CONTROL BLOCK #
      2782. PROC READRC; # READ AND SKIP #
      2783. PROC RPHEAD; # PRINT *ACPD* TITLE #
      2784. PROC WRITER; # *CIO* WRITER #
      2785. PROC WRITEW; # *CIO* WRITEW #
      2786. END
      2787.  
      2788. #
      2789. **** PROC HEADER - XREF LIST END.
      2790. #
      2791.  
      2792. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      2793.  
      2794. *CALL COMUCPD
      2795. *CALL COMABZF
      2796.  
      2797. #
      2798. * LOCAL VARIABLES.
      2799. #
      2800.  
      2801. ITEM D I; # TEMPORARY VARIABLE #
      2802. ITEM L I; # TEMPORARY VARIABLE #
      2803. ITEM STAT I; # I/O STATUS #
      2804. ITEM T I; # TEMPORARY VARIABLE #
      2805.  
      2806. BASED
      2807. ARRAY HEAD [0:0] P(1); # HEADER SYSTEM DESIGNATOR #
      2808. BEGIN # ARRAY HEAD #
      2809. ITEM HEAD$SD C(00,00,70); # SYSTEM DESIGNATOR #
      2810. END # ARRAY HEAD #
      2811.  
      2812. ARRAY TEXT [0:0] S(10); # HEADER TEXT #
      2813. BEGIN # ARRAY TEXT #
      2814. ITEM TXT$H1 C(00,00,16); # *ACPD* VERSION #
      2815. ITEM TXT$VR C(01,00,10); # VERSION NUMBER #
      2816. ITEM TXT$H2 C(02,00,10)=[" "]; # BLANK FILL #
      2817. ITEM TXT$SD C(03,00,70); # SYSTEM DESIGNATOR #
      2818. END # ARRAY TEXT #
      2819.  
      2820.  
      2821.  
      2822.  
      2823.  
      2824. #
      2825. * BEGIN HEADER PROC.
      2826. #
      2827.  
      2828. P<MPAR>=LOC(HDTR);
      2829. P<DDSC>=LOC(DDHD);
      2830. P<DCHD>=LOC(DBUF);
      2831.  
      2832. #
      2833. * *HDDC* IS NOT TRUE IF *HEADER* IS CALLED TO PROCESS THE NEXT
      2834. * DATA FILE. *HDDC* IS TRUE IF THE FIRST FILE IS BEING PROCESSED.
      2835. * IF THE LATER IS TRUE, ALL THE ERROR CHECKING HAS BEEN DONE BY
      2836. * *INITLZ*.
      2837. #
      2838.  
      2839. IF (NOT HDDC) # HEADER BLOCK NOT DECODED #
      2840. THEN
      2841. BEGIN # READ HEADER BLOCK OF NEXT FILE #
      2842. READRC(STAT); # READ HEADER BLOCK #
      2843. IF (STAT NQ EORC) # EOF OR EOI ENCOUNTERED #
      2844. THEN
      2845. BEGIN
      2846. IF (IBNW GR 0) # INPUT BUFFER NOT EMPTY #
      2847. THEN
      2848. BEGIN
      2849. PERROR(ERM4,FATAL,NULL); # DATA BLOCKS MISSING #
      2850. END
      2851.  
      2852. IF (P$N LS 9999999) # EQUIVALENCED *N* PARAMETER #
      2853. THEN
      2854. BEGIN
      2855. PERROR(ERM9,INFOM,NULL); # *N* EXCEEDS NUMBER OF FILES #
      2856. END
      2857.  
      2858. TMED=TRUE;
      2859. RETURN;
      2860. END
      2861.  
      2862. IF (P$VERS NQ WSAI$VS[0]) # *CPD* AND *ACPD* INCOMPATBLE #
      2863. THEN
      2864. BEGIN
      2865. PERROR(ERM13,FATAL,NULL); # CPD/ACPD VERSIONS MISMATCH #
      2866. END
      2867.  
      2868. IBWA=0;
      2869. DECODE(LOC(HDTR),LOC(DCHD)); # DECODE HEADER BLOCK #
      2870. ADJUST; # ADJUST TABLES AND FIELD LENGTH #
      2871.  
      2872. #
      2873. * CHECK IF FILES IN CHRONOLOGICAL ORDER.
      2874. #
      2875.  
      2876. T=DTMNUM(DCHD$WD[DDSC$FW[TIME]],TRUE,FALSE);
      2877. D=DTMNUM(DCHD$WD[DDSC$FW[DATE]],TRUE,TRUE)*SHFC;
      2878. IF (LSTM GR (D+T)) # DATA FILE NOT IN ORDER #
      2879. THEN
      2880. BEGIN
      2881. PERROR(ERM8,FATAL,NULL);
      2882. END
      2883.  
      2884. END # READ HEADER BLOCK OF NEXT FILE #
      2885.  
      2886. ELSE # HEADER BLOCK HAS BEEN DECODED #
      2887. BEGIN
      2888. HDDC=FALSE;
      2889. END
      2890.  
      2891. #
      2892. * BUILD THE REPORT TITLE.
      2893. #
      2894.  
      2895. T=DDSC$FW[CPDV]; # *ACPD* VERSION POINTER #
      2896. TXT$VR[0]=DCHD$CW[T];
      2897. TXT$H1[0]=" A C P D - VER ";
      2898.  
      2899. T=DDSC$FW[SYSV]; # SYSTEM DESIGNATOR POINTER #
      2900. P<HEAD>=LOC(DCHD$CW[T]);
      2901. T=MPAR$PR[SYSV]*2;
      2902. BZFILL(HEAD,TYPFILL"BFILL",T);
      2903. TXT$SD[0]=HEAD$SD[0];
      2904.  
      2905. IF (P$L NQ NULL) # REPORT FILE SPECIFIED #
      2906. THEN
      2907. BEGIN
      2908. L=30 + T; # LENGTH OF HEADER TEXT #
      2909. RPHEAD(OFFA,TEXT,2,L); # SET UP *ACPD* TITLE #
      2910. PUTHDR; # PRINT HEADER BLOCK ELEMENTS #
      2911. PUTEST; # PRINT EST #
      2912. PUTSCI; # PRINT JOB CONTROL BLOCK #
      2913. END
      2914.  
      2915. IF (P$S NQ NULL) # SUMMARY FILE SPECIFIED #
      2916. THEN # WRITE SUMMARY FILE #
      2917. BEGIN
      2918. WRITEW(FETS,DCHD,DCHL,0);
      2919. WRITER(FETS,1);
      2920. END
      2921.  
      2922. RETURN;
      2923. END # HEADER #
      2924.  
      2925. TERM
      2926. PROC INITLZ(HDDC,DTDC,EDTM);
      2927. # TITLE INITLZ - INITIALIZE PARAMETERS AND OPEN FILES. #
      2928.  
      2929. BEGIN # INITLZ #
      2930.  
      2931. #
      2932. ** INITLZ - INITIALIZE PARAMETERS AND OPEN FILES.
      2933. *
      2934. * PROCESS *ACPD* COMMAND PARAMETERS, INITIALIZE *ACPD*,
      2935. * AND OPEN FILES.
      2936. *
      2937. * PROC INITLZ(HDDC,DTDC,EDTM)
      2938. *
      2939. * ENTRY NONE.
      2940. *
      2941. * EXIT HDDC = INDICATE IF HEADER BLOCK HAS BEEN DECODED.
      2942. * DTDC = INDICATE IF DATA BLOCK HAS BEEN DECODED.
      2943. * TIME = TRUE IF BEGINNING TIME GREATER THAN
      2944. * ENDING TIME.
      2945. #
      2946.  
      2947. #
      2948. * PARAMETER LIST.
      2949. #
      2950.  
      2951. ITEM HDDC B; # DECODED HEADER BLOCK FLAG #
      2952. ITEM DTDC B; # DECODED DATA BLOCK FLAG #
      2953. ITEM EDTM B; # ENDING TIME FLAG #
      2954.  
      2955. #
      2956. **** PROC INITLZ - XREF LIST BEGIN.
      2957. #
      2958.  
      2959. XREF
      2960. BEGIN
      2961. PROC ADJUST; # ADJUST TABLES AND FIELD LENGTH #
      2962. PROC DECODE; # DECODE *CIO* INPUT BUFFER DATA #
      2963. FUNC DTMNUM I; # CONVERT TIME/DATE TO BINARY #
      2964. PROC FILINFO; # GET FILE INFORMATION #
      2965. PROC MEMORY; # REQUEST MEMORY #
      2966. PROC PAP; # PROCESS *ACPD* PARAMETER #
      2967. PROC PERROR; # PROCESS ERROR #
      2968. PROC READRC; # READ ONE RECORD FROM DATA FILE #
      2969. PROC REPTLE; # PRINT REPORT SUBTITLE #
      2970. PROC RPOPEN; # OPEN FILES #
      2971. PROC ZSETFET; # INITIALIZE *CIO* FET #
      2972. END
      2973.  
      2974. #
      2975. **** PROC INITLZ - XREF LIST END.
      2976. #
      2977.  
      2978. DEF CNIC #"CNIL"#; # FAST LOOP SAMPLE #
      2979. DEF CTMC #"CTML"#; # MEDIUM LOOP SAMPLE #
      2980. DEF CTOC #"CTOL"#; # SLOW LOOP SAMPLE #
      2981. DEF MXVC #1.0E20#; # MAXIMUM VALUE #
      2982. DEF NA #"NA"#; # NO ABORT FLAG #
      2983. DEF RECALL #1#; # RECALL FLAG #
      2984.  
      2985. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      2986.  
      2987. *CALL COMUCPD
      2988.  
      2989. #
      2990. * LOCAL VARIABLES.
      2991. #
      2992.  
      2993. ITEM BA I; # BYTE ADDRESS #
      2994. ITEM CM C(10)="CM"; # REQUEST CM FLAG #
      2995. ITEM D I; # TEMPORARY VARIABLE #
      2996. ITEM DM I; # TEMPORARY VARIABLE #
      2997. ITEM I I; # FOR LOOP CONTROL #
      2998. ITEM J I; # FOR LOOP CONTROL #
      2999. ITEM STAT I; # I/O STATUS #
      3000. ITEM T I; # TEMPORARY VARIABLE #
      3001. ITEM TM I; # TIME #
      3002.  
      3003. ARRAY FINFO [0:0] P(5); # *FILINFO* PARAMETER BLOCK #
      3004. BEGIN # ARRAY FINFO #
      3005. ITEM FIN$FN C(00,00,07); # FILE NAME #
      3006. ITEM FIN$LN U(00,42,06)=[5]; # PARAMETER BLOCK LENGTH #
      3007. ITEM FIN$US U(00,48,12)=[1]; # COMPLETION STATUS #
      3008. ITEM FIN$WD U(01,00,60); # PARAMETER BLOCK WORD #
      3009. ITEM FIN$EI B(01,36,01); # EOI STATUS #
      3010. ITEM FIN$EF B(01,37,01); # EOF STATUS #
      3011. ITEM FIN$BI B(01,38,01); # BOI STATUS #
      3012. END # ARRAY FINFO #
      3013.  
      3014. ARRAY STT [0:0] P(1); # MEMORY ARGUMENT #
      3015. BEGIN # ARRAY STT #
      3016. ITEM STT$RFL U(00,00,30); # REQUEST FIELD LENGTH #
      3017. END # ARRARY STT #
      3018.  
      3019.  
      3020.  
      3021.  
      3022.  
      3023.  
      3024.  
      3025. #
      3026. * BEGIN INITLZ PROC.
      3027. #
      3028.  
      3029. PAP; # PROCESS *ACPD* PARAMETERS #
      3030.  
      3031. #
      3032. * OPEN FILES.
      3033. #
      3034.  
      3035. ZSETFET(LOC(FETI),P$FN,LOC(WSAI),WSAL+1,FENL+1);
      3036. FIN$FN[0]=P$FN;
      3037. FILINFO(FINFO); # CHECK STATUS OF INPUT FILE #
      3038. IF (FIN$WD[0] EQ NULL) # NO STATUS #
      3039. THEN
      3040. BEGIN
      3041. PERROR(ERM11,FATAL,P$FN); # DATA FILE NOT FOUND #
      3042. END
      3043.  
      3044. IF (FIN$EI[0]) # EOI #
      3045. THEN
      3046. BEGIN
      3047. PERROR(ERM12,FATAL,NULL); # DATA FILE POSITIONED AT EOI #
      3048. END
      3049.  
      3050. IF (NOT (FIN$EF[0] OR FIN$BI[0])) # NOT AT EOF NOR BOI #
      3051. THEN
      3052. BEGIN
      3053. PERROR(ERM7,FATAL,NULL);
      3054. END
      3055.  
      3056. OFFA=LOC(FETO);
      3057. IF (P$L NQ NULL) # REPORT FILE SPECIFIED #
      3058. THEN # OPEN REPORT FILE #
      3059. BEGIN
      3060. RPOPEN(P$L,OFFA,REPTLE);
      3061. END
      3062.  
      3063. IF (P$S NQ NULL) # SUMMARY FILE SPECIFIED #
      3064. THEN # OPEN SUMMARY FILE #
      3065. BEGIN
      3066. ZSETFET(LOC(FETS),P$S,LOC(WSAS),WSAL+1,FENL+1);
      3067. END
      3068.  
      3069. #
      3070. * REQUEST CURRENT FIELD LENGTH.
      3071. #
      3072.  
      3073. MEMORY(CM,STT,RECALL,NA);
      3074. CRFL=STT$RFL[0]; # CURRENT FIELD LENGTH #
      3075. HGAD=CRFL; # HIGHEST ADDRESS #
      3076.  
      3077. #
      3078. * CHECK IF *CPD* AND *ACPD* VERSIONS ARE THE SAME.
      3079. #
      3080.  
      3081. READRC(STAT); # READ HEADER BLOCK #
      3082. IF (STAT NQ EORC) # EOF OR EOI ENCOUNTERED #
      3083. THEN
      3084. BEGIN
      3085. PERROR(ERM5,FATAL,NULL); # DATA FILE EMPTY #
      3086. END
      3087.  
      3088. IF (P$VERS NQ WSAI$VS[0]) # *CPD* AND *ACPD* INCOMPATBLE #
      3089. THEN
      3090. BEGIN
      3091. PERROR(ERM13,FATAL,NULL); # CPD/ACPD VERSIONS MISMATCH #
      3092. END
      3093.  
      3094. #
      3095. * VALIDATE BEGIN AND END TIMES.
      3096. * IF NO *BD* SPECIFIED, BEGIN DATE IS THE DATE OF THE
      3097. * HEADER RECORD OF THE CURRENT FILE.
      3098. * IF NO *ED* SPECIFIED, END DATE IS THE SAME AS BEGIN DATE.
      3099. * IF NO *ET*/*ED* SPECIFIED, END DATE IS SET TO MAXIMUM.
      3100. #
      3101.  
      3102. P<DCHD>=LOC(DBUF);
      3103. P<DDSC>=LOC(DDHD);
      3104.  
      3105. IBWA=0;
      3106. DECODE(LOC(HDTR),LOC(DCHD)); # DECODE HEADER BLOCK #
      3107. ADJUST; # ADJUST TABLES AND FIELD LENGTH #
      3108. HDDC=TRUE; # HEADER BLOCK HAS BEEN DECODED #
      3109.  
      3110. IF (P$BD EQ NULL) # NO BEGINNING DATE #
      3111. THEN
      3112. BEGIN
      3113. DM=DTMNUM(DCHD$WD[DDSC$FW[DATE]],TRUE,TRUE)*SHFC;
      3114. END
      3115.  
      3116. ELSE # *BD* SPECIFIED #
      3117. BEGIN
      3118. DM=DTMNUM(P$BD,FALSE,TRUE)*SHFC;
      3119. END
      3120.  
      3121. P$BT=DM + DTMNUM(P$BT,FALSE,FALSE);
      3122.  
      3123. IF (P$ED NQ NULL) # END DATE SPECIFIED #
      3124. THEN
      3125. BEGIN
      3126. P$ET=(DTMNUM(P$ED,FALSE,TRUE)*SHFC) + DTMNUM(P$ET,FALSE,FALSE);
      3127. END
      3128.  
      3129. ELSE # NO END DATE #
      3130. BEGIN
      3131. IF (P$ET NQ NULL) # END TIME SPECIFIED #
      3132. THEN
      3133. BEGIN
      3134. P$ET=DM + DTMNUM(P$ET,FALSE,FALSE);
      3135. END
      3136.  
      3137. ELSE # *ET*/*ED* ARE NOT SPECIFIED #
      3138. BEGIN
      3139. P$ET=MXDC*SHFC + MXTC; # 33/12/31 23.59.59 #
      3140. END
      3141.  
      3142. END
      3143.  
      3144. IF (P$BT GQ P$ET) # BEGIN TIME .GE. END TIME #
      3145. THEN
      3146. BEGIN
      3147. EDTM=TRUE; # ENDING TIME REACHED #
      3148. RETURN;
      3149. END
      3150.  
      3151. TM=DTMNUM(DCHD$WD[DDSC$FW[DATE]],TRUE,TRUE)*SHFC;
      3152. TM=TM + DTMNUM(DCHD$WD[DDSC$FW[TIME]],TRUE,FALSE);
      3153. IF (P$BT GR TM) # *BT* .GT. TIME OF FIRST
      3154.   DATA RECORD #
      3155. THEN
      3156. BEGIN
      3157. DTDC=TRUE; # DECODE DATA BLOCK #
      3158. END
      3159.  
      3160. ELSE
      3161. BEGIN
      3162. DTDC=FALSE; # NOT DECODE DATA BLOCK #
      3163. END
      3164.  
      3165. #
      3166. * COMPUTE BYTE ADDRESSES OF SAMPLE TIMES IN
      3167. * INPUT FILE-S WORKING STORAGE AREA.
      3168. #
      3169.  
      3170. BA=0;
      3171. P<MPAR>=LOC(DATT);
      3172. SLOWFOR I=0 STEP 1 WHILE (MPAR$NM[I] NQ CTOC)
      3173. DO
      3174. BEGIN # COMPUTE SAMPLE TIME BYTE ADDRESS #
      3175. IF (MPAR$NM[I] EQ CNIC) # FAST LOOP SAMPLE #
      3176. THEN
      3177. BEGIN
      3178. SPLA$WD[MPAR$TP[I]]=BA;
      3179. END
      3180.  
      3181. ELSE
      3182. BEGIN
      3183. IF (MPAR$NM[I] EQ CTMC) # MEDIUM LOOP SAMPLE #
      3184. THEN
      3185. BEGIN
      3186. SPLA$WD[MPAR$TP[I]]=BA;
      3187. END
      3188.  
      3189. END
      3190.  
      3191. BA=MPAR$LN[I]*MPAR$PR[I] + BA;
      3192. END # COMPUTE SAMPLE TIME BYTE ADDRESS #
      3193.  
      3194. SPLA$WD[MPAR$TP[I]]=BA; # SLOW LOOP SAMPLE #
      3195.  
      3196. READRC(STAT); # READ FIRST DATA BLOCK #
      3197. IF (STAT NQ EORC) # NO DATA BLOCKS #
      3198. THEN
      3199. BEGIN
      3200. PERROR(ERM4,FATAL,NULL); # DATA BLOCKS MISSING #
      3201. END
      3202.  
      3203. P<DCDT>=LOC(DBUF[DCHL]);
      3204. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      3205.  
      3206. #
      3207. * POSITION FILE AT CORRECT RECORD.
      3208. #
      3209.  
      3210. STAT=0;
      3211. IBWA=0;
      3212.  
      3213. SLOWFOR J=0 WHILE (P$BT GR TM) AND (STAT NQ EOIC)
      3214. DO
      3215. BEGIN # READ FILE #
      3216. IF (IBWA GQ IBNW) # INPUT BUFFER EXHAUSTED #
      3217. THEN
      3218. BEGIN # GET NEXT BUFFER #
      3219. READRC(STAT); # READ NEXT RECORD #
      3220. IBWA=0;
      3221. IF (STAT NQ EORC) # END OF CURRENT FILE #
      3222. THEN
      3223. BEGIN # CHECK IF EOF OR EOI #
      3224. IF (STAT EQ EOFC) # PREVIOUS READ ENCOUNTERED EOF #
      3225. THEN
      3226. BEGIN # GET NEXT FILE #
      3227. READRC(STAT); # READ HEADER BLOCK OF NEXT FILE #
      3228. IF (STAT NQ EORC) # NO DATA BLOCKS FOLLOW #
      3229. THEN
      3230. BEGIN
      3231. PERROR(ERM4,FATAL,NULL); # DATA BLOCKS MISSING #
      3232. END
      3233.  
      3234. DECODE(LOC(HDTR),LOC(DCHD)); # DECODE HEADER BLOCK #
      3235. ADJUST; # ADJUST TABLES AND FIELD LENGTH #
      3236. P<DCDT>=LOC(DBUF[DCHL]);
      3237. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      3238. P<DDSC>=LOC(DDHD);
      3239.  
      3240. D=DTMNUM(DCHD$WD[DDSC$FW[DATE]],TRUE,TRUE)*SHFC;
      3241. # GET DATE ON RECORD #
      3242. T=DTMNUM(DCHD$WD[DDSC$FW[TIME]],TRUE,FALSE);
      3243. # GET TIME ON RECORD #
      3244. IF (TM GR (D+T)) # PREVIOUS TIME .GT.
      3245.   CURRENT TIME #
      3246. THEN
      3247. BEGIN
      3248. PERROR(ERM8,FATAL,NULL);
      3249. END
      3250.  
      3251. TM=D + T; # SET TO CURRENT TIME #
      3252. TEST J; # GO PROCESS DATA BLOCKS #
      3253. END # GET NEXT FILE #
      3254.  
      3255. ELSE # PREVIOUS READ ENCOUNTERD *EOI* #
      3256. BEGIN
      3257. PERROR(ERM3,FATAL,NULL); # BT/BD NOT FOUND #
      3258. END
      3259.  
      3260. END # CHECK IF EOF OR EOI #
      3261.  
      3262. END # GET NEXT BUFFER #
      3263.  
      3264. DECODE(LOC(DATT),LOC(DCDT));
      3265. P<DDSC>=LOC(DDDT);
      3266. TM=DCDT$WD[DDSC$FW[PDTM]]; # GET TIME #
      3267.  
      3268. #
      3269. * REINITIALIZE BUFFER OF FIRST COLUMN.
      3270. #
      3271.  
      3272. FASTFOR I=0 STEP 1 UNTIL DCDL - 1
      3273. DO
      3274. BEGIN
      3275. DCDT$WD[I]=0;
      3276. DCDT$WD[I + DCDL*DCDC]=0;
      3277. DDSM$IM[I]=0;
      3278. DDSM$IQ[I]=0;
      3279. END
      3280.  
      3281. END # READ FILE #
      3282.  
      3283. IF (P$ET LQ TM) # READ PAST ENDING TIME #
      3284. THEN
      3285. BEGIN
      3286. EDTM=TRUE;
      3287. END
      3288.  
      3289. RETURN;
      3290. END # INITLZ #
      3291.  
      3292. TERM
      3293. PROC PERROR((ERCD),(EROR),(ERNM));
      3294. # TITLE PERROR - ISSUE ERROR MESSAGE. #
      3295.  
      3296. BEGIN # PERROR #
      3297.  
      3298. #
      3299. ** PERROR - ISSUE ERROR MESSAGE.
      3300. *
      3301. * ISSUE ERROR MESSAGE TO THE USER DAYFILE AND ABORT
      3302. * THE JOB IF THE ERROR IS FATAL.
      3303. *
      3304. * PROC PERROR(ERCD,EROR,ERNM)
      3305. *
      3306. * ENTRY ERCD = ERROR CODE.
      3307. * EROR = ERROR LEVEL.
      3308. * ERNM = ERROR NAME.
      3309. *
      3310. * EXIT JOB ABORTED IF *EROR*=FATAL.
      3311. * OTHERWISE, RETURN TO CALLING PROGRAM.
      3312. *
      3313. * MESSAGES
      3314. *
      3315. * 1. ACPD ARGUMENT ERROR - XX.
      3316. * 2. ACPD/CPD VERSIONS MISMATCH.
      3317. * 3. BT/BD NOT FOUND.
      3318. * 4. DATA BLOCKS MISSING.
      3319. * 5. DATA ELEMENT NAME UNDEFINED - XXXX.
      3320. * 6. DATA FILE CONTENT ERROR.
      3321. * 7. DATA FILE EMPTY.
      3322. * 8. DATA FILE NOT AT BEGINNING OF FILE.
      3323. * 9. DATA FILE NOT FOUND - XXXXXXX.
      3324. * 10. DATA FILE NOT IN CHRONOLOGICAL ORDER.
      3325. * 11. DATA FILE POSITIONED AT EOI.
      3326. * 12. IN AND IC PARAMETER CONFLICT.
      3327. * 13. IN LESS THAN FILE WRITE TIME.
      3328. * 14. N EXCEEDS NUMBER OF FILES.
      3329. #
      3330.  
      3331. #
      3332. * PARAMETER LIST.
      3333. #
      3334.  
      3335. ITEM ERCD I; # ERROR CODE #
      3336. ITEM EROR I; # ERROR LEVEL #
      3337. ITEM ERNM C(10); # ERROR NAME #
      3338.  
      3339. #
      3340. **** PROC PERROR - XREF LIST BEGIN.
      3341. #
      3342.  
      3343. XREF
      3344. BEGIN
      3345. PROC ABORT; # ABORT JOB #
      3346. PROC MESSAGE; # ISSUE DAYFILE MESSAGES #
      3347. END
      3348.  
      3349. #
      3350. **** PROC PERROR - XREF LIST END.
      3351. #
      3352.  
      3353. DEF BLKC #" "#; # BLANK #
      3354. DEF DOLC #"$"#; # DOLLAR SIGN #
      3355. DEF PRDC #"."#; # PERIOD #
      3356.  
      3357. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      3358.  
      3359. *CALL COMUCPD
      3360.  
      3361. #
      3362. * LOCAL VARIABLES.
      3363. #
      3364.  
      3365. ITEM J I; # FOR LOOP CONTROL #
      3366. ITEM L I; # FOR LOOP CONTROL #
      3367.  
      3368. ARRAY ERMS [1:ERMSC] S(4); # ERROR MESSSAGES #
      3369. BEGIN # ARRAY ERMS #
      3370. ITEM ER$MS C(00,00,38) = # ERROR MESSAGES #
      3371.  
      3372. [" ACPD ARGUMENT ERROR - $.",
      3373. " DATA ELEMENT NAME UNDEFINED - $.",
      3374. " BT/BD NOT FOUND.",
      3375. " DATA BLOCKS MISSING.",
      3376. " DATA FILE EMPTY.",
      3377. " DATA FILE CONTENT ERROR.",
      3378. " DATA FILE NOT AT BEGINNING OF FILE.",
      3379. " DATA FILE NOT IN CHRONOLOGICAL ORDER.",
      3380. " N EXCEEDS NUMBER OF FILES.",
      3381. " IN LESS THAN FILE WRITE TIME.",
      3382. " DATA FILE NOT FOUND - $.",
      3383. " DATA FILE POSITIONED AT EOI.",
      3384. " ACPD/CPD VERSIONS MISMATCH.",
      3385. " IN AND IC PARAMETER CONFLICT."];
      3386.  
      3387. ITEM ER$ZR C(03,48,02) = [0,0,0,0,0,0,0,0,0,0,0,0,0,0];
      3388. # ZERO FILLED LAST BYTE #
      3389. END # ARRAY ERMS #
      3390.  
      3391.  
      3392.  
      3393.  
      3394.  
      3395. #
      3396. * BEGIN PERROR PROC.
      3397. #
      3398.  
      3399. IF (ERNM NQ 0) # NAME SPECIFIED #
      3400. THEN
      3401. BEGIN # FILL IN ERROR NAME #
      3402. SLOWFOR J=2 STEP 1 WHILE (C<J,1>ER$MS[ERCD] NQ DOLC)
      3403. DO; # LOOK FOR DOLLAR SIGN #
      3404.  
      3405. SLOWFOR L=0 STEP 1 WHILE (C<L,1>ERNM NQ 0)
      3406. AND (C<L,1>ERNM NQ BLKC)
      3407. DO
      3408. BEGIN
      3409. C<J,1>ER$MS[ERCD]=C<L,1>ERNM;
      3410. J=J+1;
      3411. END
      3412.  
      3413. C<J,1>ER$MS[ERCD]=PRDC;
      3414. END # FILL IN ERROR NAME #
      3415.  
      3416. MESSAGE(ER$MS[ERCD],3); # ISSUE ERROR MESSAGE #
      3417. IF (EROR NQ FATAL)
      3418. THEN
      3419. BEGIN
      3420. RETURN; # TO CALLING PROGRAM #
      3421. END
      3422.  
      3423. ABORT;
      3424. END # PERROR #
      3425.  
      3426. TERM
      3427. PROC PRDTEL((PVL),(DTY),(TMX));
      3428. # TITLE PRDTEL - PRINT ONE LINE OF DATA ELEMENT. #
      3429.  
      3430. BEGIN # PRDTEL #
      3431.  
      3432. #
      3433. ** PRDTEL - PRINT ONE LINE OF DATA ELEMENT.
      3434. *
      3435. * PRINT VALUES IN ONE LINE OF ONE DATA ELEMENT.
      3436. *
      3437. * PROC PRDTEL((PVL),(DTY),(TMX))
      3438. *
      3439. * ENTRY PVL = POINTER TO VALUES.
      3440. * DTY = DATA TYPE.
      3441. * TMX = POINTER TO CURRENT TOTAL MAXIMUM AND
      3442. * MINIMUM VALUES.
      3443. *
      3444. * EXIT ONE ROW OF THE DATA ELEMENT-S VALUES ARE PRINTED.
      3445. * THE SUBTOTAL IS ALSO PRINTED, ALONG WITH THE
      3446. * MAXIMUM AND MIN VALUES OF THAT ROW.
      3447. #
      3448.  
      3449. #
      3450. * PARAMETER LIST.
      3451. #
      3452.  
      3453. ITEM PVL U; # POINTER TO VALUES #
      3454. ITEM DTY I; # DATA TYPE #
      3455. ITEM TMX U; # POINTER TO TOTAL MAXIMUM VALUE #
      3456.  
      3457. #
      3458. **** PROC PRDTEL - XREF LIST BEGIN.
      3459. #
      3460.  
      3461. XREF
      3462. BEGIN
      3463. PROC DETMXM; # DETERMINE MAXIMUM AND MINIMUM #
      3464. PROC WRITEV; # WRITE VALUE #
      3465. END
      3466.  
      3467. #
      3468. **** PROC PRDTEL - XREF LIST END.
      3469. #
      3470.  
      3471. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      3472.  
      3473. *CALL COMUCPD
      3474.  
      3475. #
      3476. * LOCAL VARIABLES.
      3477. #
      3478.  
      3479. ITEM CL I; # COLUMN #
      3480. ITEM CR I; # CARRIAGE CONTROL #
      3481. ITEM I I; # FOR LOOP CONTROL #
      3482. ITEM IC I; # INCREMENTOR #
      3483. ITEM MN I; # MINIMUM INTERVAL #
      3484. ITEM MX I; # MAXIMUM INTERVAL #
      3485. ITEM X R; # TEMPORARY VARIABLE #
      3486.  
      3487. BASED
      3488. ARRAY MXN [0:0] S(2); # TOTAL MAXIMUM/MINIMUM VALUES #
      3489. BEGIN # ARRAY MXN #
      3490. ITEM MXN$MX R(00,00,60); # TOTAL MAXIMUM VALUE #
      3491. ITEM MXN$MN R(01,00,60); # TOTAL MINIMUM VALUE #
      3492. END # ARRAY MXN #
      3493.  
      3494. BASED
      3495. ARRAY VAL [1:11] P(1); # VALUES TO BE PRINTED #
      3496. BEGIN # ARRAY VAL #
      3497. ITEM VL$F R(00,00,60); # REAL VALUE #
      3498. ITEM VL$N I(00,00,60); # INTEGER VALUE #
      3499. END # ARRAY VAL #
      3500.  
      3501.  
      3502.  
      3503.  
      3504.  
      3505. #
      3506. * BEGIN PRDTEL PROC.
      3507. #
      3508.  
      3509. IF (NIPP LQ (DCDC-3)) # PRINT TOTAL ON SAME LINE #
      3510. THEN # DO NOT LINE FEED #
      3511. BEGIN
      3512. CR=NLFC;
      3513. END
      3514.  
      3515. ELSE
      3516. BEGIN
      3517. CR=LFDC; # LINE FEED #
      3518. END
      3519.  
      3520. #
      3521. * DETERMINE MINIMUM AND MAXIMUM INTERVALS.
      3522. #
      3523.  
      3524. P<VAL>=PVL;
      3525. P<MXN>=TMX;
      3526. MX=1;
      3527. MN=1;
      3528. FASTFOR I=1 STEP 1 UNTIL NIPP
      3529. DO
      3530. BEGIN # FIND MAXIMUM AND MINIMUM COLUMNS #
      3531. IF (VL$F[I] GR VL$F[MX])
      3532. THEN
      3533. BEGIN
      3534. MX=I; # CURRENT MAXIMUM POSITION #
      3535. END
      3536.  
      3537. IF (VL$F[I] LS VL$F[MN])
      3538. THEN
      3539. BEGIN
      3540. MN=I; # CURRENT MINIMUM POSITION #
      3541. END
      3542.  
      3543. END # FIND MAXIMUM AND MINIMUM COLUMNS #
      3544.  
      3545. #
      3546. * UPDATE CURRENT VALUES OF TOTAL MAXIMUM AND MINIMUM.
      3547. #
      3548.  
      3549. IF (VL$F[MX] GR MXN$MX[0]) # INTERVAL MAXIMUM .GT.
      3550.   TOTAL MAXIMUM #
      3551. THEN
      3552. BEGIN
      3553. MXN$MX[0]=VL$F[MX]; # UPDATE TOTAL MAXIMUM #
      3554. END
      3555.  
      3556. IF (VL$F[MN] LS MXN$MN[0]) # INTERVAL MINIMUM .LT.
      3557.   TOTAL MINIMUM #
      3558. THEN
      3559. BEGIN
      3560. MXN$MN[0]=VL$F[MN]; # UPDATE TOTAL MINIMUM #
      3561. END
      3562.  
      3563. IF (DTY NQ FLPC) # NOT FLOATING POINT #
      3564. THEN # CONVERT VALUES TO INTEGER #
      3565. BEGIN
      3566. FASTFOR I=1 STEP 1 UNTIL NIPP+1
      3567. DO
      3568. BEGIN
      3569. X=VL$F[I];
      3570. VL$N[I]=X;
      3571. END
      3572.  
      3573. END
      3574.  
      3575. #
      3576. * NOW PRINT THE VALUES IN ONE LINE STARTING FROM
      3577. * COLUMN *BCLC*.
      3578. #
      3579.  
      3580. CL=BCLC;
      3581. FASTFOR I=1 STEP 1 UNTIL NIPP
      3582. DO
      3583. BEGIN
      3584. WRITEV(VL$F[I],DTY,CL,10,NLFC);
      3585. CL=CL+10;
      3586. END
      3587.  
      3588. #
      3589. * INDICATE MINIMUM AND MAXIMUM INTERVAL VALUES BY ENCLOSING
      3590. * THEM IN PARENTHESES AND BRACKETS, RESPECTIVELY.
      3591. #
      3592.  
      3593. IF (MX NQ MN)
      3594. THEN
      3595. BEGIN
      3596. DETMXM(VL$F[MX],VL$F[MN],MX,MN,DTY);
      3597. END
      3598.  
      3599. IF (TCOL GR (DCDC-3))
      3600. THEN
      3601. BEGIN
      3602. WRITEV(VL$F[NIPP+1],DTY,CL+1,9,CR); # WRITE SUBTOTAL #
      3603. END
      3604.  
      3605. RETURN;
      3606. END # PRDTEL #
      3607.  
      3608. TERM
      3609. PROC PUTBLK((NSF),(FWA),(LWA));
      3610. # TITLE PUTBLK - PRINT ELEMENTS OF ONE LOOP OF DATA BLOCK. #
      3611.  
      3612. BEGIN # PUTBLK #
      3613.  
      3614. #
      3615. ** PUTBLK - PRINT ELEMENTS OF ONE LOOP OF DATA BLOCK.
      3616. *
      3617. * PUTBLK IS THE DRIVER IN PRINTING THE DATA BLOCK ELMENTS
      3618. * (FAST LOOP, MEDIUM LOOP, SLOW LOOP).
      3619. *
      3620. * PROC PUTBLK((NSF),(FWA),(LWA))
      3621. *
      3622. * ENTRY NSF = NUMBER OF RECORDS PER INTERVAL.
      3623. * FWA = FIRST WORD ADDRESS OF LOOP IN TABLE *DSPT*.
      3624. * LWA = LAST WORD ADDRESS OF LOOP IN TABLE *DSPT*.
      3625. *
      3626. * EXIT DATA ELEMENTS OF ONE LOOP ARE PRINTED BY THE
      3627. * ORDER SPECIFIED IN TABLE *DSPT*.
      3628. #
      3629.  
      3630. #
      3631. * PARAMETER LIST.
      3632. #
      3633.  
      3634. ITEM NSF I; # NUMBER OF RECORDS PER INTERVAL #
      3635. ITEM FWA I; # *FWA* OF BLOCK IN *DSPT* TABLE #
      3636. ITEM LWA I; # *LWA* OF BLOCK IN *DSPT* TABLE #
      3637.  
      3638. #
      3639. **** PROC PUTBLK - XREF LIST BEGIN.
      3640. #
      3641.  
      3642. XREF
      3643. BEGIN
      3644. PROC DATELM; # PROCESS ONE DATA BLOCK ELEMENT #
      3645. PROC GETMSG; # GET MESSAGE FROM *DSPTTXT* #
      3646. PROC WRITEV; # WRITE DATA ELEMENT #
      3647. END
      3648.  
      3649. #
      3650. **** PROC PUTBLK - XREF LIST END.
      3651. #
      3652.  
      3653. DEF BLKC #" "#; # BLANK #
      3654. DEF NSBC #O"777"#; # NO SUBBLOCK FLAG #
      3655.  
      3656. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      3657.  
      3658. *CALL COMUCPD
      3659.  
      3660. #
      3661. * LOCAL VARIABLES.
      3662. #
      3663.  
      3664. ITEM CT I; # INDEX OF *DSPT* TABLE #
      3665. ITEM FG B; # FLAG TO PRINT SUBBLOCK TITLE #
      3666. ITEM FW I; # INDEX OF *DCDT* TABLE #
      3667. ITEM I I; # FOR LOOP CONTROL #
      3668. ITEM IC I; # INCREMENTOR #
      3669. ITEM J I; # INDEX #
      3670. ITEM LN I; # LENGTH OF DATA ITEM #
      3671. ITEM MS1 C(50); # TEMPORARY BUFFER #
      3672. ITEM POS I; # RELATIVE POSITION OF *WFP* #
      3673. ITEM PT I; # INDEX OF *DDDT* TABLE #
      3674. ITEM SM I; # SAMPLE TIMES #
      3675. ITEM ST I; # POINTER TO SUBTABLE #
      3676. ITEM SUM I; # SAMPLE TIMES SUBTOTAL #
      3677. ITEM T I; # TEMPORARY STORAGE #
      3678. ITEM TY I; # DATA TYPE #
      3679. ITEM WA I; # WEIGHT FACTOR INFORMATION #
      3680. ITEM WIC I; # INCREMENTOR OF WEIGHT FACTOR #
      3681. ITEM WP I; # WEIGHT FACTOR #
      3682.  
      3683. ARRAY MS2 [0:2] P(1); # SUBBLOCK MESSAGE BUFFER #
      3684. BEGIN # ARRAY MS2 #
      3685. ITEM MS2$MS C(00,00,10)=[" "," "," "]; # MESSAGE BUFFER #
      3686. END # ARRAY MS2 #
      3687.  
      3688.  
      3689.  
      3690.  
      3691.  
      3692. #
      3693. * BEGIN PUTBLK PROC.
      3694. #
      3695.  
      3696. P<DCDT>=LOC(DBUF[DCHL]);
      3697. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      3698. PT=DSPT$PT[FWA]; # POINTER TO *DDDT* #
      3699. GETMSG(FWA,MS1);
      3700. WRITEV(MS1,CHRC,1,22,NLFC);
      3701.  
      3702. #
      3703. * PRINT SAMPLE TIMES. *NIPP* IS THE NUMBER OF COLUMNS PER PAGE.
      3704. #
      3705.  
      3706. J=BCLC; # STARTING POSITION TO PRINT #
      3707. SUM=0;
      3708. P<DDSC>=LOC(DDDT);
      3709.  
      3710. SLOWFOR I=1 STEP 1 UNTIL NIPP
      3711. DO
      3712. BEGIN
      3713. SM=DCDT$WD[(I-1)*DCDL + DDSC$FW[PT]];
      3714. WRITEV(SM,INTC,J,10,NLFC);
      3715. SUM=SUM+SM;
      3716. J=J+10;
      3717. END
      3718.  
      3719. IF (NIPP GR (DCDC-3)) # MORE THAN 7 COLUMNS #
      3720. THEN # NO TOTAL ON THIS PAGE #
      3721. BEGIN
      3722. WRITEV(SUM,INTC,J,10,LFDC); # PRINT SUBTOTAL #
      3723. END
      3724.  
      3725. ELSE # PRINT TOTAL ON SAME PAGE #
      3726. BEGIN
      3727. IF (NIPP GR 0) # MORE THAN 1 COLUMN COLLECTED #
      3728. AND (TCOL GR (DCDC-3))
      3729. THEN # PRINT SUBTOTAL #
      3730. BEGIN
      3731. WRITEV(SUM,INTC,J,10,NLFC);
      3732. J=J+10;
      3733. END
      3734.  
      3735. SUM=DDSM$IM[DDSC$FW[PT]]; # TOTAL SAMPLES #
      3736. WRITEV(SUM,INTC,J,10,LFDC);
      3737. END
      3738.  
      3739. #
      3740. * COMPUTE AND PRINT LOOP ELEMENTS.
      3741. * THE PROCESSING OF THE LOOP ELEMENTS WILL FOLLOW THE
      3742. * INSTRUCTIONS CONTAINED IN THE *DSPT* TABLE FROM
      3743. * *FWA* TO *LWA*.
      3744. #
      3745.  
      3746. CT=FWA+1;
      3747. FASTFOR I=0 WHILE (CT LQ LWA)
      3748. DO
      3749. BEGIN # FOLLOW TABLE *DSPT* #
      3750. PT=DSPT$PT[CT]; # POINTER TO *DDSC* TABLE #
      3751. IF NOT (DDSC$SD[PT]) # ELEMENT IS NOT SELECTED #
      3752. THEN
      3753. BEGIN
      3754. CT=CT+1;
      3755. TEST I; # SKIP IT #
      3756. END
      3757.  
      3758. ST=DSPT$ST[CT]; # POINTER TO SUBTITLE TABLE #
      3759. GETMSG(CT,MS1);
      3760. WA=DDSC$WA[PT]; # WEIGHT FACTOR INFORMATION #
      3761. WP=DDSC$WP[PT]; # WEIGHT FACTOR #
      3762. IF (WA EQ WGFC) # WEIGHT FACTOR SPECIFIED #
      3763. THEN
      3764. BEGIN # CHECK IF MULTIPLE WEIGHT FACTORS #
      3765. P<DDSC>=LOC(DDHD);
      3766. IF (DDSC$LN[WP] GR 1) # MORE THAN 1 WEIGHT FACTOR #
      3767. THEN
      3768. BEGIN
      3769. WIC=DDSC$IC[WP]; # WEIGHT FACTOR INCREMENTOR #
      3770. END
      3771.  
      3772. ELSE
      3773. BEGIN
      3774. WIC=0;
      3775. END
      3776.  
      3777. P<DDSC>=LOC(DDDT);
      3778. END # CHECK IF MULTIPLE WEIGHT FACTORS #
      3779.  
      3780. TY=DDSC$TY[PT]; # DATA TYPE #
      3781. FW=DDSC$FW[PT]; # POINTER TO *DCDT* TABLE #
      3782. LN=DDSC$LN[PT]; # NUMBER OF ENTRIES #
      3783. IC=DDSC$IC[PT]; # INCREMENTOR #
      3784.  
      3785. #
      3786. * IF THE POINTER TO SUBBLOCK TITLE TABLE *ST* IS NIL (*NSBC*),
      3787. * THE ELEMENT IS A SINGLE ENTRY ELEMENT OR HAS NO SUBTITLES.
      3788. #
      3789.  
      3790.  
      3791. IF (ST EQ NSBC) # SINGLE ENTRY OR NO SUBTITLE #
      3792. THEN
      3793. BEGIN # PROCESS SINGLE ENTRY OR NO SUBTITLE ELEMENT #
      3794. FG=FALSE; # DO NOT PRINT SUBBLOCK TITLE #
      3795. POS=0; # FIRST WEIGHT FACTOR POSITION #
      3796. SLOWFOR J=1 STEP 1 WHILE (J LS LN)
      3797. DO
      3798. BEGIN
      3799. DATELM(FG,BLKC,MS1,WA,WP,POS,TY,FW,NSF);
      3800. CT=CT+1;
      3801. GETMSG(CT,MS1);
      3802. FW=FW+IC;
      3803. POS=POS+WIC;
      3804. END
      3805.  
      3806. DATELM(FG,BLKC,MS1,WA,WP,POS,TY,FW,NSF);
      3807. END # PROCESS SINGLE ENTRY OR NO SUBTITLE ELEMENT #
      3808.  
      3809. #
      3810. * THE ELEMENT HAS SUBTITLES TO BE PROCESS. EACH ENTRY OF THE
      3811. * MULTIPLE-ENTRY ELEMENT HAS A SUBTITLE DEFINED IN TABLE *SMGT*.
      3812. #
      3813.  
      3814. ELSE
      3815. BEGIN # MULTIPLE ENTRIES #
      3816. T=ST;
      3817. FG=TRUE; # PRINT SUBBLOCK #
      3818. POS=0;
      3819. FASTFOR J=1 STEP 1 UNTIL LN
      3820. DO
      3821. BEGIN # PROCESS ONE ENTRY OF MULTIPLE-ENTRY ELEMENT #
      3822. MS2$MS[1]=SMGT$TX[T];
      3823. IF (MS2$MS[1] EQ BLKC) # END OF SUBBLOCK TABLE #
      3824. THEN
      3825. BEGIN
      3826. T=ST; # RESET *SMGT* POINTER #
      3827. CT=CT+1; # NEXT *DSPT* ELEMENT #
      3828. GETMSG(CT,MS1);
      3829. MS2$MS[1]=SMGT$TX[T];
      3830. FG=TRUE; # PRINT SUBBLOCK #
      3831. END
      3832.  
      3833. DATELM(FG,MS1,MS2,WA,WP,POS,TY,FW,NSF);
      3834.  
      3835. T=T+1;
      3836. FW=FW+IC;
      3837. POS=POS+WIC;
      3838. END # PROCESS ONE ENTRY OF MULTIPLE-ENTRY ELEMENT #
      3839.  
      3840. END # MULTIPLE ENTRIES #
      3841.  
      3842. CT=CT+1;
      3843. END # FOLLOW TABLE *DSPT* #
      3844.  
      3845. END # PUTBLK #
      3846.  
      3847. TERM
      3848. PROC PUTDAT((NSF),(NIN));
      3849. # TITLE PUTDAT - PRINT DATA BLOCK ELEMENTS. #
      3850.  
      3851. BEGIN # PUTDAT #
      3852.  
      3853. #
      3854. ** PUTDAT - PRINT DATA BLOCK ELEMENTS.
      3855. *
      3856. * PRINT FAST, MEDIUM, SLOW, AND SNAPSHOT LOOPS.
      3857. *
      3858. * PROC PUTDAT((NSF),(NIN))
      3859. *
      3860. * ENTRY NSF = NUMBER OF RECORDS PER INTERVAL.
      3861. * NIN = NUMBER OF INTERVALS PER PAGE.
      3862. * TABLE *DCDT* CONTAINS DATA BLOCK ELEMENT VALUES.
      3863. *
      3864. * EXIT DATA BLOCK ELEMENTS ARE PRINTED TO THE REPORT
      3865. * FILE.
      3866. #
      3867.  
      3868. #
      3869. * PARAMETER LIST.
      3870. #
      3871.  
      3872. ITEM NSF I; # NUMBER OF RECORDS PER INTERVAL #
      3873. ITEM NIN I; # NUMBER OF INTERVALS PER PAGE #
      3874.  
      3875. #
      3876. **** PROC PUTDAT - XREF LIST BEGIN.
      3877. #
      3878.  
      3879. XREF
      3880. BEGIN
      3881. PROC PUTBLK; # PRINT ONE LOOP DATA ELEMENTS #
      3882. PROC PUTSNS; # PRINT SNAPSHOT LOOP ELEMENTS #
      3883. PROC RPEJECT; # PAGE EJECT #
      3884. PROC WRITEV; # WRITE DATA ELEMENT #
      3885. END
      3886.  
      3887. #
      3888. **** PROC PUTDAT - XREF LIST END.
      3889. #
      3890.  
      3891. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      3892.  
      3893. *CALL COMUCPD
      3894.  
      3895. #
      3896. * LOCAL VARIABLES.
      3897. #
      3898.  
      3899. ITEM FW I; # LOOP BEGINNING INDEX #
      3900. ITEM LW I; # LOOP ENDING INDEX #
      3901. ITEM MSG C(30)="**********************";
      3902. # LOOP REPORT SEPARATOR #
      3903.  
      3904.  
      3905.  
      3906.  
      3907.  
      3908. #
      3909. * BEGIN PUTDAT PROC.
      3910. #
      3911.  
      3912. NIPP=NIN;
      3913. IF (P$L NQ NULL) # REPORT FILE SPECIFIED #
      3914. THEN
      3915. BEGIN
      3916. RPEJECT(OFFA); # PAGE EJECT #
      3917. END
      3918.  
      3919. P<DCHD>=LOC(DBUF);
      3920. P<DDSC>=LOC(DDHD);
      3921.  
      3922. IF (DCHD$WD[DDSC$FW[DLIL]] NQ 0) # FAST LOOP WAS COLLECTED #
      3923. THEN
      3924. BEGIN
      3925. FW=HDML;
      3926. LW=FW+FSML-1;
      3927. PUTBLK(NSF,FW,LW); # PROCESS FAST LOOP #
      3928. WRITEV(MSG,CHRC,1,22,LFDC);
      3929. END
      3930.  
      3931. IF (DCHD$WD[DDSC$FW[DLML]] NQ 0) # MEDIUM LOOP WAS COLLECTED #
      3932. THEN
      3933. BEGIN
      3934. FW=HDML+FSML;
      3935. LW=FW+MDML-1;
      3936. PUTBLK(NSF,FW,LW); # PROCESS MEDIUM LOOP #
      3937. WRITEV(MSG,CHRC,1,22,LFDC);
      3938. END
      3939.  
      3940. IF (DCHD$WD[DDSC$FW[DLOL]] NQ 0) # SLOW LOOP WAS COLLECTED #
      3941. THEN
      3942. BEGIN
      3943. FW=HDML+FSML+MDML;
      3944. LW=FW+SLML-1;
      3945. PUTBLK(NSF,FW,LW); # PROCESS SLOW LOOP #
      3946. WRITEV(MSG,CHRC,1,22,LFDC);
      3947. END
      3948.  
      3949. IF (NIN GR 0) # NUMBER OF COLUMNS .GT. 0 #
      3950. AND (DCHD$WD[DDSC$FW[DLFW]] NQ 0) # SNAPSHOT WAS COLLECTED #
      3951. THEN
      3952. BEGIN
      3953. FW=HDML+FSML+MDML+SLML;
      3954. LW=FW+SNML-1;
      3955. TLFG=2;
      3956. PUTSNS(FW,LW); # PROCESS SNAPSHOT LOOP ELEMENTS #
      3957. TLFG=1;
      3958. END
      3959.  
      3960. RETURN;
      3961. END # PUTDAT #
      3962.  
      3963. TERM
      3964. PROC PUTEST;
      3965. # TITLE PUTEST - PRINT *EST*. #
      3966.  
      3967. BEGIN # PUTEST #
      3968.  
      3969. #
      3970. ** PUTEST - PRINT *EST*.
      3971. *
      3972. * PRINT *EST* TABLE.
      3973. *
      3974. * PROC PUTEST
      3975. *
      3976. * ENTRY TABLE *DCHD* CONTAINS HEADER BLOCK ELEMENT VALUES.
      3977. *
      3978. * EXIT EST IS WRITTEN TO THE REPORT FILE.
      3979. *
      3980. * NOTE.
      3981. *
      3982. * THE SYMBOL *SROS* DEFINED IN THIS ROUTINE HAS TO HAVE
      3983. * THE SAME VALUE AS THE SYMBOL *SROS* DEFINED IN COMMON
      3984. * DECK *COMSCPS*.
      3985. * THE ITEMS *FATT* AND *FATL* HAVE TO BE CHANGED ACCORDINGLY
      3986. * IF CHANGE IS MADE TO THE FILE TYPES.
      3987. #
      3988.  
      3989. #
      3990. **** PROC PUTEST - XREF LIST BEGIN.
      3991. #
      3992.  
      3993. XREF
      3994. BEGIN
      3995. PROC RPEJECT; # PAGE EJECT #
      3996. PROC WRITEV; # WRITE DATA ELEMENT #
      3997. FUNC XCOD C(10); # BINARY TO DISPLAY OCTAL #
      3998. END
      3999.  
      4000. #
      4001. **** PROC PUTEST - XREF LIST END.
      4002. #
      4003.  
      4004. DEF BLKC #" "#; # BLANK #
      4005. DEF CHSC #"S"#; # CHARACTER S #
      4006. DEF CHXC #"X"#; # CHARACTER X #
      4007. DEF MGMC #"MT"#; # *MT* TAPE #
      4008. DEF MGNC #"NT"#; # *NT* TAPE #
      4009. DEF MNSC #"-"#; # MINUS SIGN #
      4010. DEF MXMSA #47#; # MAXIMUM MS ALLOCATABLE DEVICE #
      4011. DEF SROS #8#; # SECONDARY ROLLOUT DEVICE #
      4012.  
      4013. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      4014.  
      4015. *CALL COMUCPD
      4016. *CALL COMUEST
      4017.  
      4018. #
      4019. * LOCAL VARIABLES.
      4020. #
      4021.  
      4022. ITEM FATL C(12)
      4023. = "TIORDPLBSRRN"; # FILES TYPE #
      4024. ITEM FATT C(12); # TEMPORARY BUFFER #
      4025. ITEM I I; # FOR LOOP CONTROL #
      4026. ITEM J I; # FOR LOOP CONTROL #
      4027. ITEM L I; # FOR LOOP CONTROL #
      4028. ITEM M I; # TEMPORARY STORAGE #
      4029. ITEM MSG C(50); # TEMPORARY BUFFER #
      4030. ITEM MXRS I; # NUMBER OF *MSAL* CATEGORIES #
      4031. ITEM MSI I; # MST ORDINAL #
      4032. ITEM MSIC I; # MST INCREMENTOR #
      4033. ITEM MUI I; # MST ORDINAL #
      4034. ITEM MUIC I; # MST INCREMENTOR #
      4035. ITEM N I; # TEMPORARY STORAGE #
      4036.  
      4037. ARRAY CHNN [0:1] P(1); # CHANNELS #
      4038. BEGIN # ARRAY CHNN #
      4039. ITEM CH U(00,00,60); # CHANNEL WORD #
      4040. ITEM CHAPFLAG B(00,48,01); # CHANNEL ACCESS PATH FLAG #
      4041. ITEM CHSTATUS U(00,49,02); # CHANNEL STATUS #
      4042. ITEM CHNUMBER U(00,55,05); # CHANNEL NUMBER #
      4043. END # ARRAY CHNN #
      4044.  
      4045. ARRAY TEM [0:0] P(1); # TEMPORARY BUFFER #
      4046. BEGIN # ARRAY TEM #
      4047. ITEM TEM$TYPE U(00,01,11); # EQUIPMENT TYPE #
      4048. END # ARRAY TEM #
      4049.  
      4050.  
      4051.  
      4052.  
      4053.  
      4054. #
      4055. * BEGIN PUTEST PROC.
      4056. #
      4057.  
      4058. P<DCHD>=LOC(DBUF);
      4059. P<DDSC>=LOC(DDHD);
      4060.  
      4061. TLFG=3; # INDICATES PRINTING EST #
      4062. RPEJECT(OFFA);
      4063.  
      4064. #
      4065. * PRINT EST ENTRY.
      4066. #
      4067.  
      4068. P<EST>=LOC(DCHD$WD[DDSC$FW[ESTB]]);
      4069. MSI=0;
      4070. MSIC=DDSC$IC[TRKC];
      4071. MUI=0;
      4072. MUIC=DDSC$IC[MSUN];
      4073.  
      4074. SLOWFOR I=0 STEP 1 UNTIL DCHD$WD[DDSC$FW[ESTL]] - 1
      4075. DO
      4076. BEGIN # PROCESS ONE EST ENTRY #
      4077. IF (EST$EQDE[I] EQ NULL) # ENTRY NOT DEFINED #
      4078. THEN
      4079. BEGIN
      4080. TEST I;
      4081. END
      4082.  
      4083. WRITEV(I,OC2C,4,3,NLFC); # EST ORDINAL #
      4084. TEM$TYPE[0]=EST$TYPE[I];
      4085. WRITEV(TEM,CHRC,11,2,NLFC); # DEVICE TYPE #
      4086.  
      4087. IF EST$STATUS[I] EQ 0 # ON DEVICE #
      4088. THEN
      4089. MSG="ON";
      4090. ELSE
      4091. BEGIN
      4092. IF EST$STATUS[I] EQ 1 # IDLE DEVICE #
      4093. THEN
      4094. MSG="IDLE";
      4095. ELSE
      4096. BEGIN
      4097. IF EST$STATUS[I] EQ 2 # OFF DEVICE #
      4098. THEN
      4099. MSG="OFF";
      4100. ELSE # DOWN DEVICE #
      4101. MSG="DOWN";
      4102. END
      4103.  
      4104. END
      4105.  
      4106. WRITEV(MSG,CHRC,16,3,NLFC); # DEVICE STATUS #
      4107.  
      4108. IF (NOT EST$MS[I]) # NOT MASS STORAGE DEVICE #
      4109. THEN
      4110. BEGIN
      4111. N=EST$EQU[I];
      4112. WRITEV(N,OC2C,22,2,NLFC); # EQUIPMENT NUMBER #
      4113. N=EST$UN[I];
      4114. WRITEV(N,OC2C,26,2,NLFC); # UNIT NUMBER #
      4115. END
      4116.  
      4117. ELSE # MASS STORAGE DEVICE #
      4118. BEGIN
      4119. IF (EST$RMVE[I]) # REMOVABLE MASS STORAGE DEVICE #
      4120. THEN
      4121. BEGIN
      4122. N=DCHD$WD[DDSC$FW[MSUN]+MUI];
      4123. WRITEV(N,OC2C,26,2,NLFC);
      4124. END
      4125.  
      4126. MUI=MUI + MUIC;
      4127. END
      4128.  
      4129. #
      4130. * PRINT CHANNELS.
      4131. #
      4132.  
      4133. CH[0]=EST$CHANA[I]; # CHANNEL A #
      4134. CHAPFLAG[0]=EST$CHAAE[I]; # CHANNEL A ACCESS ENABLED FLAG #
      4135. CHSTATUS[0]=EST$CHAST[I]; # CHANNEL A STATUS #
      4136. CH[1]=EST$CHANB[I]; # CHANNEL B #
      4137. CHAPFLAG[1]=EST$CHBAE[I]; # CHANNEL B ACCESS ENABLED FLAG #
      4138. CHSTATUS[1]=EST$CHBST[I]; # CHANNEL B STATUS #
      4139.  
      4140. FASTFOR L=0 STEP 1 UNTIL 1
      4141. DO
      4142. BEGIN # PRINT CHANNEL NUMBER #
      4143. IF (CHAPFLAG[L]) # CHANNEL ACCESS PATH ENABLED #
      4144. THEN
      4145. BEGIN
      4146. IF (CHSTATUS[L] EQ 0) # CHANNEL IS UP #
      4147. THEN
      4148. BEGIN
      4149. WRITEV(CHNUMBER[L],OC2C,30+3*L,2,NLFC);
      4150. END
      4151.  
      4152. ELSE
      4153. BEGIN
      4154. WRITEV("**",CHRC,30+3*L,2,NLFC);
      4155. END
      4156.  
      4157. END
      4158.  
      4159.  
      4160. END # PRINT CHANNEL NUMBER #
      4161.  
      4162. #
      4163. * PRINT EST ENTRY IN FULL WORD, AND DEVICE TRACK CAPACITY.
      4164. #
      4165.  
      4166. N=EST$LHDE[I];
      4167. WRITEV(N,OC3C,42,10,NLFC);
      4168. N=EST$RHDE[I];
      4169. WRITEV(N,OC3C,52,10,NLFC);
      4170. N=EST$LHAE[I];
      4171. WRITEV(N,OC3C,63,10,NLFC);
      4172. N=EST$RHAE[I];
      4173. IF (NOT EST$MS[I]) # NOT MASS STORAGE DEVICE #
      4174. THEN
      4175. BEGIN
      4176. WRITEV(N,OC3C,73,10,LFDC);
      4177. TEST I;
      4178. END
      4179.  
      4180. ELSE
      4181. BEGIN # MASS STORAGE DEVICE #
      4182. WRITEV(N,OC3C,73,10,NLFC);
      4183. N=DCHD$WD[DDSC$FW[TRKC] + MSI];
      4184. WRITEV(N,OC2C,87,4,NLFC); # TRACK CAPACITY #
      4185. MSI=MSI+MSIC;
      4186.  
      4187. #
      4188. * PRINT THE MASS STORAGE ALLOCATION TABLE.
      4189. #
      4190.  
      4191. IF (I GR MXMSA) # EST ORDINAL .GT. *MXMSA* #
      4192. THEN
      4193. BEGIN
      4194. WRITEV(BLKC,CHRC,95,1,LFDC); # LINE FEED #
      4195. END
      4196.  
      4197. ELSE # EST ORDINAL .LE. *MXMSA* #
      4198. BEGIN # CHECK FILE TYPE ON THE DEVICE #
      4199. FATT="------------";
      4200. MXRS=DCHD$WD[DDSC$FW[CON8]];
      4201. SLOWFOR J=0 STEP 1 UNTIL MXRS-1
      4202. DO
      4203. BEGIN
      4204. L=DDSC$FW[MSAA] + J;
      4205. IF (B<12+I,1>DCHD$WD[L] EQ 1)
      4206. THEN
      4207. BEGIN
      4208. C<J,1>FATT=C<J,1>FATL;
      4209. END
      4210.  
      4211. END
      4212.  
      4213. IF (EST$SYS[I]) # SYSTEM FILE ON DEVICE #
      4214. THEN
      4215. BEGIN
      4216. MSG=CHXC;
      4217. END
      4218.  
      4219. ELSE
      4220. BEGIN
      4221. MSG=MNSC;
      4222. END
      4223.  
      4224. WRITEV(MSG,CHRC,94,1,NLFC);
      4225.  
      4226. #
      4227. * PRINT THE THRESHOLD OF THE NUMBER OF SECTORS ROLLED IF
      4228. * THE DEVICE IS SECONDARY ROLLOUT.
      4229. #
      4230.  
      4231. IF (C<SROS,1>FATT NQ CHSC) # NOT SECONDARY ROLLOUT #
      4232. THEN
      4233. BEGIN
      4234. WRITEV(FATT,CHRC,95,MXRS,LFDC);
      4235. END
      4236.  
      4237. ELSE # SECONDARY ROLLOUT #
      4238. BEGIN
      4239. WRITEV(FATT,CHRC,95,MXRS,NLFC);
      4240. WRITEV("THRESHOLD = ",CHRC,109,12,NLFC);
      4241. WRITEV(DCHD$WD[DDSC$FW[SROT]],OC1C,121,5,NLFC);
      4242. WRITEV("SECTORS",CHRC,127,7,LFDC);
      4243. END
      4244.  
      4245. END # CHECK FILE TYPE ON THE DEVICE #
      4246.  
      4247. END # MASS STORAGE DEVICE #
      4248.  
      4249. END # PROCESS ONE EST ENTRY #
      4250.  
      4251. RETURN;
      4252. END # PUTEST #
      4253.  
      4254. TERM
      4255. PROC PUTHDR;
      4256. # TITLE PUTHDR - PROCESS HEADER BLOCK. #
      4257.  
      4258. BEGIN # PUTHDR #
      4259.  
      4260. #
      4261. ** PUTHDR - PROCESS HEADER BLOCK.
      4262. *
      4263. * PRINT FIRST PAGE OF HEADER BLOCK ELEMENTS.
      4264. *
      4265. * PROC HEADER
      4266. *
      4267. * ENTRY TABLE *DCHD* CONTAINS HEADER BLOCK ELEMENT VALUES.
      4268. *
      4269. * EXIT HEADER BLOCK ELEMENTS ARE PRINTED TO THE REPORT
      4270. * FILE.
      4271. #
      4272.  
      4273. #
      4274. **** PROC PUTHDR - XREF LIST BEGIN.
      4275. #
      4276.  
      4277. XREF
      4278. BEGIN
      4279. PROC HDRELM; # PROCESS HEADER BLOCK ELEMENT #
      4280. PROC RPEJECT; # PAGE EJECT #
      4281. PROC RPSPACE; # LINE FEED #
      4282. PROC WRITEV; # WRITE ONE ELEMENT #
      4283. END
      4284.  
      4285. #
      4286. **** PROC PUTHDR - XREF LIST END.
      4287. #
      4288.  
      4289. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      4290.  
      4291. *CALL COMUCPD
      4292.  
      4293. #
      4294. * LOCAL VARIABLES.
      4295. #
      4296.  
      4297. ITEM I I; # FOR LOOP CONTROL #
      4298. ITEM MSG C(50); # TEMPORARY BUFFER #
      4299.  
      4300.  
      4301.  
      4302.  
      4303.  
      4304. #
      4305. * BEGIN PUTHDR PROC.
      4306. #
      4307.  
      4308. TLFG=0; # INDICATES NO SUBTITLE #
      4309. RPEJECT(OFFA);
      4310. RPSPACE(OFFA,2,1);
      4311.  
      4312. #
      4313. * PRINT START DATE AND START TIME OF THE DATA FILE.
      4314. #
      4315.  
      4316. HDRELM(0,11,34); # START DATE #
      4317. HDRELM(1,11,34); # START TIME #
      4318.  
      4319. #
      4320. * PRINT *ACPD* PARAMETERS.
      4321. #
      4322.  
      4323. RPSPACE(OFFA,2,1);
      4324. WRITEV("DATA FILE NAME",CHRC,11,14,NLFC);
      4325. WRITEV(P$FN,CHRC,40,7,LFDC);
      4326. IF (P$IN NQ 0)
      4327. THEN
      4328. BEGIN
      4329. WRITEV("REPORT INTERVAL (MINUTES)",CHRC,11,25,NLFC);
      4330. WRITEV(P$IN,INTC,37,10,LFDC);
      4331. END
      4332.  
      4333. ELSE
      4334. BEGIN
      4335. WRITEV("REPORT INTERVAL (RECORDS)",CHRC,11,25,NLFC);
      4336. WRITEV(P$IC,INTC,37,10,LFDC);
      4337. END
      4338.  
      4339. RPSPACE(OFFA,2,1);
      4340. FASTFOR I=APPM STEP 1 UNTIL HWCF-1
      4341. DO
      4342. BEGIN
      4343. HDRELM(I,11,40);
      4344. END
      4345.  
      4346. #
      4347. * PRINT THE HARDWARE CONFIGURATION.
      4348. #
      4349.  
      4350. RPSPACE(OFFA,2,1);
      4351. FASTFOR I=HWCF STEP 1 UNTIL CMCF-1
      4352. DO
      4353. BEGIN
      4354. HDRELM(I,11,40);
      4355. END
      4356.  
      4357. #
      4358. * PRINT THE CMR CONFIGURATION.
      4359. #
      4360.  
      4361. RPSPACE(OFFA,2,1);
      4362. FASTFOR I=CMCF STEP 1 UNTIL SASC-1
      4363. DO
      4364. BEGIN
      4365. HDRELM(I,11,40);
      4366. END
      4367.  
      4368. #
      4369. * PRINT THE SYSTEM ASSEMBLY CONSTANTS.
      4370. #
      4371.  
      4372. RPSPACE(OFFA,2,1);
      4373. FASTFOR I=SASC STEP 1 UNTIL SDLP-1
      4374. DO
      4375. BEGIN
      4376. HDRELM(I,11,47);
      4377. END
      4378.  
      4379. #
      4380. * PRINT THE SYSTEM DELAY PARAMETERS.
      4381. #
      4382.  
      4383. RPSPACE(OFFA,2,1);
      4384. FASTFOR I=SDLP STEP 1 UNTIL BFIO-1
      4385. DO
      4386. BEGIN
      4387. HDRELM(I,11,47);
      4388. END
      4389.  
      4390. #
      4391. * PRINT THE TOTAL NUMBER OF HIGH SPEED DISK BUFFERS
      4392. * AND EXTENDED MEMORY/PP BUFFERS.
      4393. #
      4394.  
      4395. RPSPACE(OFFA,2,1);
      4396. FASTFOR I=BFIO STEP 1 UNTIL HDML-1
      4397. DO
      4398. BEGIN
      4399. HDRELM(I,11,47);
      4400. END
      4401.  
      4402. RETURN;
      4403. END # PUTHDR #
      4404.  
      4405. TERM
      4406. PROC PUTSCI;
      4407. # TITLE PUTSCI - PRINT SYSTEM CONTROL INFORMATION. #
      4408.  
      4409. BEGIN # PUTSCI #
      4410.  
      4411. #
      4412. ** PUTSCI - PRINT SYSTEM CONTROL INFORMATION.
      4413. *
      4414. * PRINT SYSTEM CONTROL INFORMATION.
      4415. *
      4416. * PROC PUTSCI
      4417. *
      4418. * ENTRY TABLE *DCHD* CONTAINS HEADER BLOCK ELEMENT VALUES.
      4419. *
      4420. * EXIT SYSTEM CONTROL INFORMATION (SERVICE CLASSES,
      4421. * PRIORITY, ETC.) ARE PRINTED TO THE REPORT FILE.
      4422. #
      4423.  
      4424. #
      4425. **** PROC PUTSCI - XREF LIST BEGIN.
      4426. #
      4427.  
      4428. XREF
      4429. BEGIN
      4430. PROC RPEJECT; # PAGE EJECT #
      4431. PROC RPSPACE; # LINE FEED #
      4432. PROC WRITEV; # WRITE DATA ELEMENT #
      4433. END
      4434.  
      4435. #
      4436. **** PROC PUTSCI - XREF LIST END.
      4437. #
      4438.  
      4439. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      4440.  
      4441. *CALL COMUCPD
      4442. *CALL COMUJCA
      4443.  
      4444. #
      4445. * LOCAL VARIABLES.
      4446. #
      4447.  
      4448. ITEM I I; # FOR LOOP CONTROL #
      4449. ITEM VALUE I; # TEMPORARY STORAGE #
      4450.  
      4451.  
      4452.  
      4453.  
      4454.  
      4455. #
      4456. * BEGIN PUTSCI PROC.
      4457. #
      4458.  
      4459. TLFG=0; # INDICATES NO SUBTITLE #
      4460. P<DCHD>=LOC(DBUF);
      4461. P<DDSC>=LOC(DDHD);
      4462.  
      4463. RPEJECT(OFFA);
      4464. RPSPACE(OFFA,2,1);
      4465. WRITEV("SYSTEM CONTROL INFORMATION",CHRC,11,26,LFDC);
      4466.  
      4467. RPSPACE(OFFA,2,1);
      4468. WRITEV("SERVICE QUEUE",CHRC,11,15,NLFC);
      4469. WRITEV(" PRIORITIES",CHRC,26,25,NLFC);
      4470. WRITEV("SERVICE LIMITS",CHRC,77,14,LFDC);
      4471.  
      4472. WRITEV("CLASS",CHRC,11,5,NLFC);
      4473. WRITEV("CP CT CM NJ TD",CHRC,69,29,LFDC);
      4474.  
      4475. WRITEV("FL AM TP AJ DT",CHRC,69,29,LFDC);
      4476.  
      4477. WRITEV("IL LP UP WF IP",CHRC,31,28,NLFC);
      4478. WRITEV("EC EM DS FC CS FS",CHRC,69,29,LFDC);
      4479.  
      4480. WRITEV("PR SE RS US",CHRC,69,23,LFDC);
      4481.  
      4482. P<JBCA>=LOC(DCHD$WD[DDSC$FW[JCBA]]);
      4483.  
      4484. #
      4485. * PRINT SERVICE CLASS INFORMATION.
      4486. #
      4487.  
      4488. SLOWFOR I=1 STEP 1 UNTIL DCHD$WD[DDSC$FW[MXNS]]-2
      4489. DO
      4490. BEGIN # PROCESS ONE SERVICE CLASS #
      4491. RPSPACE(OFFA,2,1);
      4492. WRITEV(JCST$SC[I],CHRC,13,2,NLFC); # SERVICE CLASS NAME #
      4493. WRITEV("IN",CHRC,22,2,NLFC);
      4494. WRITEV(JCA$INLP[I],OC2C,36,4,NLFC);
      4495. WRITEV(JCA$INUP[I],OC2C,43,4,NLFC);
      4496. VALUE=2**JCA$INWF[I];
      4497. WRITEV(VALUE,OC2C,49,4,NLFC);
      4498. WRITEV(JCA$CP[I],OC2C,67,4,NLFC);
      4499. WRITEV(JCA$CT[I],OC2C,75,4,NLFC);
      4500. WRITEV(JCA$CM[I],OC2C,81,4,NLFC);
      4501. WRITEV(JCA$NJ[I],OC2C,88,4,NLFC);
      4502. WRITEV(JCA$TD[I],OC2C,94,4,LFDC);
      4503.  
      4504. WRITEV("EX",CHRC,22,2,NLFC);
      4505. WRITEV(JCA$EXIL[I],OC2C,29,4,NLFC);
      4506. WRITEV(JCA$EXLP[I],OC2C,36,4,NLFC);
      4507. WRITEV(JCA$EXUP[I],OC2C,43,4,NLFC);
      4508. VALUE=2**JCA$EXWF[I];
      4509. WRITEV(VALUE,OC2C,49,4,NLFC);
      4510. WRITEV(JCA$EXIP[I],OC2C,55,4,NLFC);
      4511. WRITEV(JCA$FL[I],OC2C,67,4,NLFC);
      4512. WRITEV(JCA$AM[I],OC2C,71,8,NLFC);
      4513. WRITEV(JCA$TP[I],OC2C,81,4,NLFC);
      4514. WRITEV(JCA$AJ[I],OC2C,88,4,NLFC);
      4515. WRITEV(JCST$SC[JCA$DT[I]],CHRC,96,2,LFDC);
      4516.  
      4517. WRITEV("OT",CHRC,22,2,NLFC);
      4518. WRITEV(JCA$OTLP[I],OC2C,36,4,NLFC);
      4519. WRITEV(JCA$OTUP[I],OC2C,43,4,NLFC);
      4520. VALUE=2**JCA$OTWF[I];
      4521. WRITEV(VALUE,OC2C,49,4,NLFC);
      4522. WRITEV(JCA$EC[I],OC2C,67,4,NLFC);
      4523. WRITEV(JCA$EM[I],OC2C,75,4,NLFC);
      4524. WRITEV(JCA$DS[I],OC2C,84,1,NLFC);
      4525. WRITEV(JCA$FC[I],OC2C,89,1,NLFC);
      4526. WRITEV(JCA$CS[I],OC2C,93,1,NLFC);
      4527. WRITEV(JCA$FS[I],OC2C,97,1,LFDC);
      4528.  
      4529. WRITEV(JCA$PR[I],OC2C,67,4,NLFC);
      4530. WRITEV(JCA$SE[I],OC2C,75,4,NLFC);
      4531. WRITEV(JCA$RS[I],OC2C,81,4,NLFC);
      4532. WRITEV(JCA$US[I],OC2C,88,4,LFDC);
      4533.  
      4534. END # PROCESS ONE SERVICE CLASS #
      4535.  
      4536. RETURN;
      4537. END # PUTSCI #
      4538.  
      4539. TERM
      4540. PROC PUTSNS((FWA),(LWA));
      4541. # TITLE PUTSNS - PROCESS SNAPSHOT LOOP ELEMENTS. #
      4542.  
      4543. BEGIN # PUTSNS #
      4544.  
      4545. #
      4546. ** PUTSNS - PROCESS SNAPSHOT LOOP ELEMENTS.
      4547. *
      4548. * PUTSNS IS THE DRIVER OF THE SNAPSHOT LOOP ELEMENTS.
      4549. *
      4550. * PROC PUTSNS((FWA),(LWA))
      4551. *
      4552. * ENTRY FWA = FIRST WORD ADDRESS OF SNAPSHOT LOOP
      4553. * ELEMENTS IN TABLE *DSPT*.
      4554. * LWA = LAST WORD ADDRESS OF SNAPSHOT LOOP
      4555. * ELEMENTS IN TABLE *DSPT*.
      4556. *
      4557. * EXIT SNAPSHOT LOOP ELEMENTS ARE PRINTED TO THE REPORT
      4558. * FILE.
      4559. #
      4560.  
      4561. #
      4562. * PARAMETER LIST.
      4563. #
      4564.  
      4565. ITEM FWA I; # *FWA* IN *DSPT* TABLE #
      4566. ITEM LWA I; # *LWA* IN *DSPT* TABLE #
      4567.  
      4568. #
      4569. **** PROC PUTSNS - XREF LIST BEGIN.
      4570. #
      4571.  
      4572. XREF
      4573. BEGIN
      4574. PROC GETMSG; # GET TITLE FROM TABLE *DSPTTXT* #
      4575. PROC WRITEV; # WRITE DATA ELEMENT #
      4576. END
      4577.  
      4578. #
      4579. **** PROC PUTSNS - XREF LIST END.
      4580. #
      4581.  
      4582. DEF BLKC #" "#; # BLANK #
      4583. DEF BPCC #6#; # NUMBER OF BITS PER CHAR #
      4584. DEF NSBC #O"777"#; # NO SUBBLOCK FLAG #
      4585.  
      4586. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      4587.  
      4588. *CALL COMUCPD
      4589.  
      4590. #
      4591. * LOCAL VARIABLES.
      4592. #
      4593.  
      4594. ITEM BL U; # BIT LENGTH #
      4595. ITEM BT I; # BIT POSITION #
      4596. ITEM FW I; # POINTER TO *DCDT* TABLE #
      4597. ITEM I I; # FOR LOOP CONTROL #
      4598. ITEM IC I; # INCREMENTOR #
      4599. ITEM J I; # FOR LOOP CONTROL #
      4600. ITEM K I; # FOR LOOP CONTROL #
      4601. ITEM L I; # FOR LOOP CONTROL #
      4602. ITEM LN U; # TITLE LENGTH IN CHARACTERS #
      4603. ITEM MSG C(50); # TEMPORARY BUFFER #
      4604. ITEM N I; # TEMPORARY STORAGE #
      4605. ITEM PT I; # POINTER TO *DDDT* TABLE #
      4606. ITEM ST U; # POINTER TO SUBTITLE TABLE #
      4607. ITEM VL I; # TEMPORARY VALUE #
      4608. ITEM WC I; # WORD COUNT #
      4609.  
      4610.  
      4611.  
      4612.  
      4613.  
      4614.  
      4615. #
      4616. * BEGIN PUTSNS PROC.
      4617. #
      4618.  
      4619. P<DCDT>=LOC(DBUF[DCHL]);
      4620. P<DDSC>=LOC(DDDT);
      4621.  
      4622. FASTFOR I=FWA STEP 1 UNTIL LWA
      4623. DO
      4624. BEGIN # FOLLOW TABLE *DSPT* #
      4625. PT=DSPT$PT[I]; # POINTER TO *DDSC* #
      4626. ST=DSPT$ST[I]; # POINTER TO *SMGT* #
      4627. BL=DSPT$BL[I]; # BIT LENGTH #
      4628. LN=DSPT$LN[I];
      4629. GETMSG(I,MSG);
      4630. FW=DDSC$FW[PT];
      4631. IC=DDSC$IC[PT]; # INCREMENTOR #
      4632.  
      4633. #
      4634. * IF BIT LENGTH *BL* IS ZERO, THE VALUE IS A FULL WORD VALUE.
      4635. * THE VALUE IS PRINTED IN FIVE 12-BIT BYTES, IN SUCCESSIVE ROWS.
      4636. #
      4637.  
      4638. IF (BL EQ 0) # NO BIT LENGTH #
      4639. THEN
      4640. BEGIN # ACCESS FULL WORD #
      4641. WRITEV(MSG,CHRC,1,LN,LFDC);
      4642. FASTFOR J=1 STEP 1 UNTIL DDSC$LN[PT]
      4643. DO
      4644. BEGIN # PROCESS ONE ENTRY #
      4645. IF (ST NQ NSBC) # SUBTITLE PRESENT #
      4646. THEN # PRINT SUBTITLE #
      4647. BEGIN
      4648. MSG=SMGT$TX[ST+J-1];
      4649. WRITEV(MSG,CHRC,10,10,NLFC);
      4650. END
      4651.  
      4652. FASTFOR L=0 STEP 1 UNTIL 4
      4653. DO
      4654. BEGIN # BREAK A WORD INTO FIVE BYTES #
      4655. N=31;
      4656. SLOWFOR K=1 STEP 1 UNTIL NIPP
      4657. DO # PRINT BYTE L OF COLUMN K #
      4658. BEGIN
      4659. VL=C<L*2,2>DCDT$CW[(K-1)*DCDL + FW];
      4660. WRITEV(VL,OC3C,N,4,NLFC);
      4661. N=N+10;
      4662. END
      4663.  
      4664. WRITEV(BLKC,CHRC,N+2,1,LFDC); # LINE FEED #
      4665. END # BREAK A WORD INTO FIVE BYTES #
      4666.  
      4667. FW=FW+IC;
      4668. END # PROCESS ONE ENTRY #
      4669.  
      4670. END # ACCESS FULL WORD #
      4671.  
      4672. #
      4673. * IF BIT LENGTH *BL* IS NON ZERO, THE VALUE IS A PARTIAL WORD
      4674. * VALUE. *WC* IS THE WORD COUNT INDICATING WHAT WORD IN A
      4675. * MULTIPLE-ENTRY ELEMENT THAT CONTAINS THE VALUE. IF THE ELEMENT
      4676. * IS A SINGLE-ENTRY ELEMENT, *WC* IS ZERO. *BL* AND *BT* ARE
      4677. * THE NUMBER OF BITS AND THE STARTING BIT POSITION, RESPECTIVELY.
      4678. #
      4679.  
      4680. ELSE
      4681. BEGIN # ACCESS PARTIAL WORD #
      4682. WRITEV(MSG,CHRC,1,LN,NLFC);
      4683. BT=DSPT$BT[I]/BPCC; # CHARACTER POSITION #
      4684. WC=DSPT$WC[I]; # WORD POSITION #
      4685. BL=BL/BPCC; # NUMBER OF CHARACTERS #
      4686. N=BCLC + 2;
      4687.  
      4688. SLOWFOR J=1 STEP 1 UNTIL NIPP
      4689. DO
      4690. BEGIN
      4691. VL=C<BT,BL>DCDT$CW[(J-1)*DCDL + FW + WC];
      4692. WRITEV(VL,INTC,N,8,NLFC);
      4693. N=N+10;
      4694. END
      4695.  
      4696. WRITEV(BLKC,CHRC,N+2,1,LFDC); # LINE FEED #
      4697. END # ACCESS PARTIAL WORD #
      4698.  
      4699. END # FOLLOW TABLE *DSPT* #
      4700.  
      4701. RETURN;
      4702. END # PUTSNS #
      4703.  
      4704. TERM
      4705. PROC READRC(STAT);
      4706. # TITLE READRC - READ DATA FILE. #
      4707.  
      4708. BEGIN # READRC #
      4709.  
      4710. #
      4711. ** READRC - READ DATA FILE.
      4712. *
      4713. * READ ONE RECORD FROM THE DATA FILE.
      4714. *
      4715. * PROC READRC(STAT)
      4716. *
      4717. * ENTRY THE DATA FILE.
      4718. *
      4719. * EXIT STAT = STATUS CODE.
      4720. * ONE RECORD OF THE DATA FILE IS READ TO
      4721. * WORKING STORAGE AREA *WSAI*.
      4722. * THE NUMBER OF WORDS READ *IBNW* IS UPDATED.
      4723. #
      4724.  
      4725. #
      4726. * PARAMETER LIST.
      4727. #
      4728.  
      4729. ITEM STAT I; # STATUS CODE #
      4730.  
      4731. #
      4732. **** PROC READRC - XREF LIST BEGIN.
      4733. #
      4734.  
      4735. XREF
      4736. BEGIN
      4737. PROC READSKP; # READ AND SKIP #
      4738. END
      4739.  
      4740. #
      4741. **** PROC READRC - XREF LIST END.
      4742. #
      4743.  
      4744. DEF RFETL #8#; # FET LENGTH #
      4745.  
      4746. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      4747.  
      4748. *CALL COMAFET
      4749. *CALL COMUCPD
      4750.  
      4751. #
      4752. * LOCAL VARIABLES.
      4753. #
      4754.  
      4755. ARRAY STT [0:0] P(1); # STATUS CODE #
      4756. BEGIN # ARRAY STT #
      4757. ITEM STT$STAT U(00,42,18); # STATUS #
      4758. ITEM STT$LN U(00,42,04); # LEVEL NUMBER #
      4759. ITEM STT$AT U(00,46,04); # ABNORMAL TERMINATION CODE #
      4760. ITEM STT$CODE U(00,50,10); # REQUEST/RETURN CODE #
      4761. END # ARRAY STT #
      4762.  
      4763.  
      4764.  
      4765.  
      4766. #
      4767. * BEGIN READRC PROC.
      4768. #
      4769.  
      4770. P<FETSET>=LOC(FETI);
      4771. FET$IN[0]=FET$FRST[0]; # SET *IN* = *FIRST* #
      4772. FET$OUT[0]=FET$FRST[0]; # SET *OUT* = *FIRST* #
      4773. READSKP(FETSET,0,1);
      4774. IBNW = FET$IN[0] - FET$OUT[0]; # NUMBER OF WORDS READ #
      4775. STT$LN[0]=FET$LN[0];
      4776. STT$AT[0]=FET$AT[0];
      4777. STT$CODE[0]=FET$CODE[0];
      4778.  
      4779. STAT=STT$STAT[0];
      4780. RETURN;
      4781. END # READRC #
      4782.  
      4783. TERM
      4784. PROC REPTLE;
      4785. # TITLE REPTLE - PRINT REPORT SUBTITLE. #
      4786.  
      4787. BEGIN # REPTLE #
      4788.  
      4789. #
      4790. ** REPTLE - PRINT REPORT SUBTITLE.
      4791. *
      4792. * *REPTLE* PRINTS THE SUBTITLE AT EACH PAGE EJECT.
      4793. * THE SUBTITLE TO BE PRINTED DEPENDS ON THE VALUE
      4794. * OF *TLFG* (COMMON BLOCK *CIOCOMM*).
      4795. *
      4796. * PROC REPTLE
      4797. *
      4798. * ENTRY NIPP = NUMBER OF INTERVALS PER PAGE
      4799. * (COMMON BLOCK *CIOCOMM*).
      4800. * TLFG = SUBTITLE FLAG (COMMON BLOCK *CIOCOMM*).
      4801. * IF *TLFG* IS :
      4802. * 0 NO SUBTITLE.
      4803. * 1 PRINT SUBTITLE FOR DATA BLOCK.
      4804. * 2 PRINT SUBTITLE FOR SNAPSHOT.
      4805. * 3 PRINT SUBTITLE FOR EST REPORT.
      4806. *
      4807. * EXIT SUBTITLE IS PRINTED ON TOP OF EACH PAGE.
      4808. #
      4809.  
      4810. #
      4811. **** PROC REPTLE - XREF LIST BEGIN.
      4812. #
      4813.  
      4814. XREF
      4815. BEGIN
      4816. FUNC EDATE C(10); # CONVERT NUMBER TO DATE #
      4817. FUNC ETIME C(10); # CONVERT NUMBER TO TIME #
      4818. PROC RPLINEX; # PRINT ONE LINE #
      4819. FUNC XCDD C(10); # CONVERT TO DISPLAY DECIMAL #
      4820. END
      4821.  
      4822. #
      4823. **** PROC REPTLE - XREF LIST END.
      4824. #
      4825.  
      4826. DEF ASTC #"*"#; # ASTERISK #
      4827. DEF BLKC #" "#; # BLANK #
      4828. DEF PRDC #"."#; # PERIOD #
      4829. DEF SLSC #"/"#; # SLASH #
      4830. DEF ZERC #"0"#; # CHARACTER ZERO #
      4831.  
      4832. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      4833.  
      4834. *CALL COMUCPD
      4835.  
      4836. #
      4837. * LOCAL VARIABLES.
      4838. #
      4839.  
      4840. ITEM ESTFS B=TRUE; # FIRST EST SUBTITLE FLAG #
      4841. ITEM HRS I; # HOUR #
      4842. ITEM I I; # FOR LOOP CONTROL #
      4843. ITEM J I; # TEMPORARY VARIABLE #
      4844. ITEM MNS I; # MINUTE #
      4845. ITEM MSG C(40); # TEMPORARY STORAGE #
      4846. ITEM N I; # TEMPORARY VARIABLE #
      4847. ITEM N1 I; # TEMPORARY VARIABLE #
      4848. ITEM N2 I; # TEMPORARY VARIABLE #
      4849. ITEM OF I; # OFFSET #
      4850.  
      4851. ARRAY T [0:0] P(1); # TEMPORARY STORAGE #
      4852. BEGIN
      4853. ITEM T$WD C(00,00,10); # TEN CHARACTER WORD #
      4854. ITEM T$3C C(00,00,03); # THREE CHARACTER ITEM #
      4855. ITEM T$2C C(00,00,02); # TWO CHARACTER ITEM #
      4856. ITEM T$1C C(00,00,01); # ONE CHARACTER ITEM #
      4857. ITEM T$ZC C(00,06,01); # ZERO FILL #
      4858. END
      4859.  
      4860. ARRAY TEM [0:0] P(1); # TEMPORARY STORAGE #
      4861. BEGIN # ARRAY TEM #
      4862. ITEM TEM$WD C(00,00,10); # TEN CHARACTER ITEM #
      4863. ITEM TEM$3C C(00,42,03); # THREE CHARACTER ITEM #
      4864. ITEM TEM$2C C(00,48,02); # TWO CHARACTER ITEM #
      4865. END
      4866.  
      4867.  
      4868.  
      4869.  
      4870.  
      4871.  
      4872. #
      4873. * BEGIN REPTLE PROC.
      4874. #
      4875.  
      4876. IF (TLFG EQ 0) OR (P$L EQ NULL) # NO TITLE OR NO REPORT FILE #
      4877. THEN
      4878. BEGIN
      4879. RETURN; # NO SUBTITLE #
      4880. END
      4881.  
      4882. IF (TLFG EQ 3) # PRINTING EST #
      4883. THEN
      4884. BEGIN # PRINT EST SUBTITLE #
      4885. RPLINEX(OFFA,BLKC,1,1,LFDC);
      4886. RPLINEX(OFFA,BLKC,1,1,LFDC);
      4887. IF (ESTFS) # FIRST EST SUBTITLE #
      4888. THEN
      4889. BEGIN
      4890. MSG="EQUIPMENT STATUS TABLE";
      4891. RPLINEX(OFFA,MSG,5,22,LFDC);
      4892. ESTFS=FALSE;
      4893. END
      4894.  
      4895. ELSE # SECOND EST SUBTITLE #
      4896. BEGIN
      4897. MSG="EQUIPMENT STATUS TABLE (CONTINUED)";
      4898. RPLINEX(OFFA,MSG,5,35,LFDC);
      4899. END
      4900.  
      4901. MSG="NO. TYPE STAT EQ UN CHANNELS";
      4902. RPLINEX(OFFA,MSG,5,33,NLFC);
      4903. MSG="EST ENTRY";
      4904. RPLINEX(OFFA,MSG,42,9,NLFC);
      4905. MSG="TRACK FILES";
      4906. RPLINEX(OFFA,MSG,86,17,LFDC);
      4907. RPLINEX(OFFA,BLKC,1,1,LFDC);
      4908. RETURN;
      4909. END # PRINT EST SUBTITLE #
      4910.  
      4911. P<DCDT>=LOC(DBUF[DCHL]);
      4912. P<DDSM>=LOC(DBUF[DCHL + DCDC*DCDL*2]);
      4913. P<DDSC>=LOC(DDDT);
      4914.  
      4915. #
      4916. * PRINT INTERVAL TIMES.
      4917. #
      4918.  
      4919. RPLINEX(OFFA,BLKC,1,1,LFDC); # LINE FEED #
      4920. IF(P$IN NQ 0)
      4921. THEN
      4922. BEGIN
      4923. TEM$WD=XCDD(P$IN);
      4924. END
      4925.  
      4926. ELSE
      4927. BEGIN
      4928. TEM$WD=XCDD(P$IC);
      4929. END
      4930.  
      4931. T$3C[0]=TEM$3C[0];
      4932. RPLINEX(OFFA,T,1,3,NLFC);
      4933. IF (P$IN NQ 0) # INTERVAL TIME SPECIFIED #
      4934. THEN
      4935. BEGIN
      4936. RPLINEX(OFFA," MINS INTERVAL ",5,14,NLFC);
      4937. END
      4938.  
      4939. ELSE
      4940. BEGIN
      4941. RPLINEX(OFFA," RECS INTERVAL ",5,14,NLFC);
      4942. END
      4943.  
      4944. J = BCLC + 1;
      4945. OF=DCDC*DCDL + DDSC$FW[PDTM];
      4946.  
      4947. SLOWFOR I=1 STEP 1 UNTIL NIPP
      4948. DO
      4949. BEGIN # PRINT INTERVAL TIME #
      4950. N=DCDT$ET[(I-1)*DCDL + OF]; # INTERVAL END TIME #
      4951. T$WD[0]=ETIME(N); # CONVERT TO DISPLAY TIME #
      4952. RPLINEX(OFFA,T,J,9,NLFC);
      4953. J=J+10;
      4954. END # PRINT INTERVAL TIME #
      4955.  
      4956. #
      4957. * PRINT TITLES OF SUBTOTAL AND TOTAL. IF SNAPSHOT
      4958. * LOOP IS BEING PRINTED, THESE TITLES WILL NOT BE
      4959. * PRINTED.
      4960. #
      4961.  
      4962. IF (TLFG EQ 1) # NOT PRINTING SNAPSHOT ELEMENTS #
      4963. THEN
      4964. BEGIN # PRINT TIME #
      4965.  
      4966. #
      4967. * PRINT SUBTOTAL HEADER. SUBTOTAL IS NOT PRINTED IF THE SUBTOTAL
      4968. * AND THE TOTAL COLUMNS ARE THE SAME, I.E. IF THE TOTAL COLUMNS
      4969. * PRINTED *TCOL* IS LESS THAN 7 COLUMNS. THE SUBTOTAL HEADER IS
      4970. * NOT PRINTED IF THE CURRENT PAGE IS USED TO PRINT THE TOTAL
      4971. * STATISTICS ONLY (*NIPP* IS 0).
      4972. #
      4973.  
      4974. IF (NIPP GR 0) AND (TCOL GR (DCDC-3))
      4975. THEN
      4976. BEGIN # COMPUTE AND PRINT LENGTH OF SUBTOTAL #
      4977. N=P$IN*NIPP; # LENGTH OF SUBTOTAL #
      4978. HRS=N/60; # NUMBER OF HOURS #
      4979. MNS=N - (HRS*60); # NUMBER OF MINUTES #
      4980. TEM$WD=XCDD(HRS);
      4981. T$3C[0]=TEM$3C[0];
      4982. IF (T$2C[0] EQ BLKC)
      4983. THEN
      4984. BEGIN
      4985. T$ZC[0]=ZERC;
      4986. END
      4987.  
      4988. RPLINEX(OFFA,T,J,3,NLFC);
      4989. RPLINEX(OFFA,":",J+3,1,NLFC);
      4990. TEM$WD=XCDD(MNS);
      4991. T$2C[0]=TEM$2C[0];
      4992. IF (T$1C[0] EQ BLKC)
      4993. THEN
      4994. BEGIN
      4995. T$1C[0]=ZERC;
      4996. END
      4997.  
      4998. RPLINEX(OFFA,T,J+4,2,NLFC);
      4999. END # COMPUTE AND PRINT LENGTH OF SUBTOTAL #
      5000.  
      5001. #
      5002. * PRINT TOTAL HEADER. TOTAL HEADER IS NOT PRINTED IF MORE
      5003. * THAN 7 COLUMNS ARE PRINTED ON THE CURRENT PAGE.
      5004. #
      5005.  
      5006. IF (NIPP GR (DCDC-3))
      5007. THEN
      5008. BEGIN
      5009. RPLINEX(OFFA," HR",J+6,3,LFDC);
      5010. END
      5011.  
      5012. ELSE
      5013. BEGIN # COMPUTE AND PRINT LENGTH OF TOTAL #
      5014. IF (NIPP GR 0) AND (TCOL GR (DCDC-3))
      5015. THEN
      5016. BEGIN
      5017. RPLINEX(OFFA," HR",J+6,3,NLFC);
      5018. J=J+10;
      5019. END
      5020.  
      5021. P<DCHD>=LOC(DBUF);
      5022. P<DDSC>=LOC(DDHD);
      5023. N=(DCHD$WD[DDSC$FW[DLFW]]*ACNS)/60; # TOTAL MINUTES #
      5024. HRS=N/60; # TOTAL HOURS #
      5025. MNS=N - (HRS*60);
      5026. TEM$WD[0]=XCDD(HRS);
      5027. T$3C[0]=TEM$3C[0];
      5028. IF (T$2C[0] EQ BLKC)
      5029. THEN
      5030. BEGIN
      5031. T$ZC[0]=ZERC;
      5032. END
      5033.  
      5034. RPLINEX(OFFA,T,J,3,NLFC);
      5035. RPLINEX(OFFA,":",J+3,1,NLFC);
      5036. TEM$WD[0]=XCDD(MNS);
      5037. T$2C[0]=TEM$2C[0];
      5038. IF (T$1C[0] EQ BLKC)
      5039. THEN
      5040. BEGIN
      5041. T$1C[0]=ZERC;
      5042. END
      5043.  
      5044. RPLINEX(OFFA,T,J+4,2,NLFC);
      5045. RPLINEX(OFFA," HR",J+6,3,NLFC);
      5046.  
      5047. #
      5048. * PRINT HEADERS FOR THE MAXIMUM AND MINIMUM STATISTIC COLUMNS.
      5049. #
      5050.  
      5051. P<DDSC>=LOC(DDDT);
      5052. N1=DDSM$BT[DDSC$FW[PDTM]]; # TOTAL BEGIN TIME #
      5053. N2=DDSM$ET[DDSC$FW[PDTM]]; # TOTAL END TIME #
      5054. T$WD[0]=EDATE(N1/SHFC); # CONVERT TO DATE #
      5055. RPLINEX(OFFA,T,J+11,9,NLFC);
      5056. RPLINEX(OFFA,"TO ",J+21,3,NLFC);
      5057. T$WD[0]=EDATE(N2/SHFC);
      5058. RPLINEX(OFFA,T,J+23,9,LFDC);
      5059. END # COMPUTE AND PRINT LENGTH OF TOTAL #
      5060.  
      5061. END # PRINT TIME #
      5062.  
      5063. ELSE # PRINTING SNAPSHOT ELEMENTS #
      5064. BEGIN
      5065. RPLINEX(OFFA,BLKC,J,1,LFDC);
      5066. END
      5067.  
      5068. #
      5069. * PRINT SECOND LINE OF THE SUBTITLE.
      5070. #
      5071.  
      5072. J=BCLC + 1;
      5073. SLOWFOR I=1 STEP 1 UNTIL NIPP
      5074. DO
      5075. BEGIN
      5076. RPLINEX(OFFA," INTERVAL",J,9,NLFC);
      5077. J=J+10;
      5078. END
      5079.  
      5080. IF (TLFG EQ 1) # NOT PRINTING SNAPSHOT ELEMENTS #
      5081. THEN
      5082. BEGIN # PRINT SUBTOTAL AND TOTAL HEADERS #
      5083. IF (NIPP GR (DCDC-3))
      5084. THEN # PRINT TOTAL ON NEXT PAGE #
      5085. BEGIN
      5086. RPLINEX(OFFA," SUBTOTAL",J,9,LFDC);
      5087. END
      5088.  
      5089. ELSE # PRINT TOTAL ON THE SAME PAGE #
      5090. BEGIN # PRINT SUBTOTAL AND TOTAL HEADERS ON SAME PAGE #
      5091. IF (NIPP GR 0) # TOTAL IS NOT FIRST COLUMN #
      5092. AND (TCOL GR (DCDC-3))
      5093. THEN
      5094. BEGIN
      5095. RPLINEX(OFFA," SUBTOTAL",J,9,NLFC);
      5096. J=J+10;
      5097. END
      5098.  
      5099. RPLINEX(OFFA," TOTAL",J,9,NLFC);
      5100. RPLINEX(OFFA," *MAX* ",J+10,10,NLFC);
      5101. RPLINEX(OFFA," *MIN* ",J+20,10,LFDC);
      5102. END # PRINT SUBTOTAL AND TOTAL HEADERS ON SAME PAGE #
      5103.  
      5104. END # PRINT SUBTOTAL AND TOTAL HEADERS #
      5105.  
      5106. ELSE # PRINTING SNAPSHOT ELEMENTS #
      5107. BEGIN
      5108. RPLINEX(OFFA,BLKC,J,1,LFDC);
      5109. END
      5110.  
      5111. RPLINEX(OFFA,BLKC,1,1,LFDC); # LINE FEED #
      5112. RETURN;
      5113. END # REPTLE #
      5114.  
      5115. TERM
      5116. PROC WRITEV(PVL,(DTY),(BCL),(FWD),(CRC));
      5117. # TITLE WRITEV - WRITE TO REPORT FILE. #
      5118.  
      5119. BEGIN # WRITEV #
      5120.  
      5121. #
      5122. ** WRITEV - WRITE TO REPORT FILE.
      5123. *
      5124. * WRITE ONE VALUE TO THE REPORT FILE.
      5125. *
      5126. * PROC WRITEV(PVL,(DTY),(BCL),(FWD),(CRC))
      5127. *
      5128. * ENTRY PVL = VALUE TO BE PRINTED.
      5129. * DTY = DATA TYPE.
      5130. * BCL = BEGINNING COLUMN TO WRITE.
      5131. * FWD = FIELD WIDTH.
      5132. * CRC = CARRIAGE CONTROL.
      5133. * *LFD* IF LINE FEED AT THE END OF THE LINE
      5134. * *NLF* IF NO LINE FEED
      5135. *
      5136. * EXIT THE VALUE IS PRINTED TO THE REPORT FILE ACCORDING
      5137. * TO THE SPECIFIED FORMAT.
      5138. #
      5139.  
      5140. #
      5141. * PARAMETER LIST.
      5142. #
      5143.  
      5144. ITEM PVL U; # ADDRESS OF VALUE #
      5145. ITEM DTY I; # DATA TYPE #
      5146. ITEM BCL I; # BEGINNING COLUMN #
      5147. ITEM FWD I; # FIELD WIDTH #
      5148. ITEM CRC I; # CARRIAGE CONTROL #
      5149.  
      5150. #
      5151. **** PROC WRITEV - XREF LIST BEGIN.
      5152. #
      5153.  
      5154. XREF
      5155. BEGIN
      5156. PROC BZFILL; # BLANK/ZERO FILL ITEM #
      5157. PROC RPLINE; # PRINT ONE REPORT LINE #
      5158. FUNC XCDD C(10); # BINARY TO DISPLAY DECIMAL #
      5159. FUNC XCED C(10); # BINARY TO DISPLAY *E* FORMAT #
      5160. FUNC XCFD C(10); # BINARY TO DISPLAY REAL #
      5161. FUNC XCOD C(10); # BINARY TO DISPLAY OCTAL #
      5162. END
      5163.  
      5164. #
      5165. **** PROC WRITEV - XREF LIST END.
      5166. #
      5167.  
      5168. DEF BLKC #" "#; # BLANK #
      5169. DEF MAXF #1.0E4#; # MAXIMUM VALUE OF *F* FORMAT #
      5170. DEF ZERC #"0"#; # CHARACTER 0 #
      5171.  
      5172. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      5173.  
      5174. *CALL COMUCPD
      5175. *CALL COMABZF
      5176.  
      5177. #
      5178. * LOCAL VARIABLES.
      5179. #
      5180.  
      5181. ITEM N I; # TEMPORARY VARIABLE #
      5182. ITEM NF R; # TEMPORARY VARIABLE #
      5183. ITEM T1 I; # TEMPORARY VARIABLE #
      5184. ITEM T2 I; # TEMPORARY VARIABLE #
      5185.  
      5186. ARRAY P [0:0] P(1); # TEMPORARY BUFFER #
      5187. BEGIN # ARRAY P #
      5188. ITEM P$WD C(00,00,10); # 10 CHAR VALUE #
      5189. ITEM P$WF C(00,06,09); # 9 LEAST SIGNIFICANT DIGITS #
      5190. END # ARRAY P #
      5191.  
      5192. ARRAY TEM [0:0] P(1); # DISPLAY CODE VALUE #
      5193. BEGIN # ARRAY TEM #
      5194. ITEM T$WD C(00,00,10); # VALUE #
      5195. ITEM T$W1 C(00,00,09); # VALUE WITH NO POSTFIX #
      5196. ITEM T$W2 C(00,54,01); # *B* POSTFIX #
      5197. END # ARRAY TEM #
      5198.  
      5199. BASED
      5200. ARRAY VAL [0:0] P(1); # VALUE TO BE PRINTED #
      5201. BEGIN # ARRAY VAL #
      5202. ITEM VAL$C C(00,00,50); # CHARACTER TYPE #
      5203. ITEM VAL$N I(00,00,60); # INTEGER TYPE #
      5204. ITEM VAL$F R(00,00,60); # REAL TYPE #
      5205. END # ARRAY VAL #
      5206.  
      5207. SWITCH TYPE
      5208. CHRS, # CHARACTER #
      5209. FLPS, # FLOATING POINT #
      5210. INTS, # INTEGER #
      5211. OC1S, # OCTAL WITH *B* POSTFIX #
      5212. OC2S, # OCTAL WITH NO POSTFIX #
      5213. OC3S, # *B* POSTFIX, ZERO FILLED #
      5214. OC4S, # OCTAL, ALLOWING FOR *UESC* #
      5215. ; # END OF TYPE #
      5216.  
      5217. LABEL EXIT; # END CASE #
      5218.  
      5219.  
      5220.  
      5221.  
      5222.  
      5223. #
      5224. * BEGIN WRITEV PROC.
      5225. #
      5226.  
      5227. IF (P$L EQ NULL) # NO REPORT FILE #
      5228. THEN # SUPPRESS REPORT FILE #
      5229. BEGIN
      5230. RETURN;
      5231. END
      5232.  
      5233. P<VAL>=LOC(PVL);
      5234. GOTO TYPE[DTY];
      5235.  
      5236. CHRS: # CHARACTER #
      5237. BZFILL(VAL,TYPFILL"BFILL",FWD);
      5238. RPLINE(OFFA,C<0,FWD>VAL$C[0],BCL,FWD,CRC);
      5239. RETURN;
      5240.  
      5241. FLPS: # FLOATING POINT #
      5242. IF (VAL$F[0] GQ MAXF) # PRINT IN *E* FORMAT #
      5243. THEN
      5244. BEGIN
      5245. NF=VAL$F[0];
      5246. T$WD[0]=XCED(NF);
      5247. END
      5248.  
      5249. ELSE # PRINT IN *F* FORMAT #
      5250. BEGIN
      5251. N=VAL$F[0]*1000.0 + 0.5;
      5252. T$WD[0]=XCFD(N);
      5253. END
      5254.  
      5255. GOTO EXIT;
      5256.  
      5257. INTS: # INTEGER #
      5258. T$WD[0]=XCDD(VAL$N[0]);
      5259. GOTO EXIT;
      5260.  
      5261. OC1S: # OCTAL POSTFIXED WITH *B* #
      5262. P$WD[0]=XCOD(VAL$N[0]);
      5263. T$W1[0]=P$WF[0];
      5264. T$W2[0]="B";
      5265. GOTO EXIT;
      5266.  
      5267. OC2S: # OCTAL WITHOUT *B* POSTFIX #
      5268. T$WD[0]=XCOD(VAL$N[0]);
      5269. GOTO EXIT;
      5270.  
      5271. OC3S: # OCTAL NO POSTFIX, ZERO FILLED #
      5272. T$WD[0]=XCOD(VAL$N[0]);
      5273. SLOWFOR N=0 STEP 1 WHILE C<N,1>T$WD[0] EQ BLKC
      5274. DO # CONVERT BLANK TO DISPLAY 0 #
      5275. BEGIN
      5276. C<N,1>T$WD[0]=ZERC;
      5277. END
      5278. GOTO EXIT;
      5279.  
      5280. OC4S: # OCTAL WITH *B*, SHIFTED *UESC* #
      5281. T1 = P<DCHD>;
      5282. T2 = P<DDSC>;
      5283. P<DCHD> = LOC(DBUF);
      5284. P<DDSC> = LOC(DDHD);
      5285. P$WD[0]=XCOD(VAL$N[0]*2**DCHD$WD[DDSC$FW[UESC]]);
      5286. P<DCHD> = T1;
      5287. P<DDSC> = T2;
      5288. T$W1[0]=P$WF[0];
      5289. T$W2[0]="B";
      5290.  
      5291. EXIT:
      5292. RPLINE(OFFA,C<10-FWD,FWD>T$WD[0],BCL,FWD,CRC);
      5293. RETURN;
      5294. END # WRITEV #
      5295.  
      5296. TERM
      5297. PROC WRTSUM((NIP));
      5298. # TITLE WRTSUM - WRITE SUMMARY FILE. #
      5299.  
      5300. BEGIN # WRTSUM #
      5301.  
      5302. #
      5303. ** WRTSUM - WRITE SUMMARY FILE.
      5304. *
      5305. * WRITE DATA BLOCK ELEMENTS TO SUMMARY FILE.
      5306. *
      5307. * PROC WRTSUM((NIP))
      5308. *
      5309. * ENTRY TABLE *DCDT*.
      5310. * NIP = NUMBER OF INTERVALS PER PAGE.
      5311. *
      5312. * EXIT THE AVERAGE AND STANDARD DEVIATION OF EACH
      5313. * DATA BLOCK ELEMENT ARE WRITTEN TO THE SUMMARY
      5314. * FILE.
      5315. #
      5316.  
      5317. #
      5318. * PARAMETER LIST.
      5319. #
      5320.  
      5321. ITEM NIP I; # NUMBER OF INTERVALS PER PAGE #
      5322.  
      5323. #
      5324. **** PROC WRTSUM - XREF LIST BEGIN.
      5325. #
      5326.  
      5327. XREF
      5328. BEGIN
      5329. PROC WRITER; # WRITE EOR #
      5330. PROC WRITEW; # *CIO* WRITEW #
      5331. END
      5332.  
      5333. #
      5334. **** PROC WRTSUM - XREF LIST END.
      5335. #
      5336.  
      5337. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      5338.  
      5339. *CALL COMUCPD
      5340.  
      5341. #
      5342. * LOCAL VARIABLES.
      5343. #
      5344.  
      5345. ITEM I I; # FOR LOOP CONTROL #
      5346. ITEM WA I; # ADDRESS OF DECODED BUFFER #
      5347.  
      5348. BASED
      5349. ARRAY SUM [0:0] P(1);; # DUMMY BUFFER #
      5350.  
      5351.  
      5352.  
      5353.  
      5354.  
      5355. #
      5356. * BEGIN WRTSUM PROC.
      5357. #
      5358.  
      5359. P<DCDT>=LOC(DBUF[DCHL]);
      5360. WA=1;
      5361. SLOWFOR I=1 STEP 1 UNTIL NIP
      5362. DO
      5363. BEGIN
      5364. P<SUM>=LOC(DCDT$WD[WA]);
      5365. WRITEW(FETS,SUM,DCDL,0); # WRITE AVERAGE #
      5366. P<SUM>=LOC(DCDT$WD[DCDC*DCDL + WA]);
      5367. WRITEW(FETS,SUM,DCDL,0); # WRITE STANDARD DEVIATION #
      5368. WRITER(FETS,1); # WRITE EOR #
      5369. WA=WA + DCDL;
      5370. END
      5371.  
      5372. RETURN;
      5373. END # WRTSUM #
      5374.  
      5375. TERM
      5376. FUNC XCED((NUM)) C(10);
      5377. # TITLE XCED - CONVERT NUMBER TO THE DISPLAY *E* FORMAT. #
      5378.  
      5379. BEGIN # XCED #
      5380.  
      5381. #
      5382. ** XCED - CONVERT NUMBER TO THE DISPLAY *E* FORMAT.
      5383. *
      5384. * *XCED* CONVERTS A REAL NUMBER TO THE FORTRAN *E* FORMAT.
      5385. * THE NUMBER HAS TO BE GREATER THAN 1.0E4 AND LESS THAN
      5386. * (2**32 - 1).
      5387. * THE RESULT IS A NORMALIZED NUMBER IN DISPLAY CODE.
      5388. * THE FORMAT OF THE CONVERTED NUMBER IS :
      5389. *
      5390. * BB.XXXXEYY
      5391. *
      5392. * THE VALUE IS RIGHT-JUSTIFIED, BLANK FILLED.
      5393. * IF THE EXPONENT *YY* IS ONLY ONE DIGIT LONG,
      5394. * THE MANTISSA *XXXX* IS INCREASED TO FIVE DIGITS.
      5395. *
      5396. * FUNC XCED((NUM)) C(10)
      5397. *
      5398. * ENTRY NUM = NUMBER TO BE CONVERTED.
      5399. *
      5400. * EXIT THE NUMBER IS NORMALIZED AND CONVERTED TO
      5401. * DISPLAY CODE.
      5402. #
      5403.  
      5404. #
      5405. * PARAMETER LIST.
      5406. #
      5407.  
      5408. ITEM NUM R; # NUMBER TO BE CONVERTED #
      5409.  
      5410. #
      5411. **** FUNC XCED - XREF LIST BEGIN.
      5412. #
      5413.  
      5414. XREF
      5415. BEGIN
      5416. FUNC XCDD C(10); # BINARY TO DISPLAY DECIMAL #
      5417. END
      5418.  
      5419. #
      5420. **** FUNC XCED - XREF LIST END.
      5421. #
      5422.  
      5423. DEF LISTCON #0#; # TURN OFF COMMON DECK LISTING #
      5424.  
      5425. *CALL COMUCPD
      5426.  
      5427. #
      5428. * LOCAL VARIABLES.
      5429. #
      5430.  
      5431. ITEM EXP I; # EXPONENT #
      5432. ITEM I I; # FOR LOOP CONTROL #
      5433. ITEM J I; # FOR LOOP CONTROL #
      5434. ITEM NUMF R; # TEMPORARY VARIABLE #
      5435. ITEM NUMI I; # TEMPORARY VARIABLE #
      5436. ITEM P I; # POSITION OF *E* #
      5437. ITEM TEM1 C(10); # TEMPORARY VARIABLE #
      5438.  
      5439. ARRAY TEM [0:0] P(1); # TEMPORARY STORAGE #
      5440. BEGIN # ARRAY TEM #
      5441. ITEM T$WD C(00,00,10); # CONVERTED NUMBER #
      5442. ITEM T$DP C(00,12,01); # DECIMAL POINT #
      5443. END # ARRAY TEM #
      5444.  
      5445.  
      5446.  
      5447.  
      5448.  
      5449. #
      5450. * BEGIN XCED FUNC.
      5451. #
      5452.  
      5453. NUMF=NUM;
      5454. EXP=0;
      5455.  
      5456. #
      5457. * NORMALIZE THE NUMBER.
      5458. #
      5459.  
      5460. SLOWFOR I=1 WHILE (NUMF GQ 1.0)
      5461. DO
      5462. BEGIN
      5463. NUMF=NUMF/10.0;
      5464. EXP=EXP + 1;
      5465. END
      5466.  
      5467. T$WD[0]=XCDD(EXP);
      5468. T$DP[0]="."; # DECIMAL POINT #
      5469. P=8; # POSITION OF *E* #
      5470. IF (EXP GQ 10)
      5471. THEN
      5472. BEGIN
      5473. P=7;
      5474. END
      5475.  
      5476. NUMI=NUM;
      5477. TEM1=XCDD(NUMI);
      5478.  
      5479. #
      5480. * MOVE THE MOST SIGNIFICANT DIGITS TO *TEM*.
      5481. #
      5482.  
      5483. SLOWFOR I=0 STEP 1 WHILE (C<I,1>TEM1 EQ " ")
      5484. DO; # FIND THE FIRST DIGIT #
      5485.  
      5486. FASTFOR J=3 STEP 1 UNTIL P-1
      5487. DO
      5488. BEGIN # MOVE THE MOST SIGNIFICANT DIGITS #
      5489. C<J,1>T$WD[0]=C<I,1>TEM1;
      5490. I=I+1;
      5491. END # MOVE THE MOST SIGNIFICANT DIGITS #
      5492.  
      5493. C<P,1>T$WD[0]="E"; # PLACE THE *E* CHARACTER #
      5494. XCED=T$WD[0];
      5495. RETURN;
      5496. END # XCED #
      5497.  
      5498. TERM
    cdc/nos2.source/opl871/acpd.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator