User Tools

Site Tools


cdc:nos2.source:opl871:taflog

TAFLOG

Table Of Contents

  • [00351] READJ - READ TAF JOURNAL FILE.
  • [00436] READFR - READ FIRST RECORD.
  • [00447] READNR - READ NEXT RECORD.
  • [00455] SUBROUTINES.
  • [00457] PRS - PRESET.
  • [00487] RNX - READ NEXT RECORD.

Source Code

TAFLOG.txt
  1. IDENTIFICATION DIVISION.
  2. PROGRAM-ID. TAFLOG.
  3. AUTHOR. R L ERICKSON - DATA MANAGEMENT CONSULTING SERVICES.
  4. * T E SCHULL - 2/27/87.
  5. *
  6. * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  7. *
  8. * THIS PROGRAM PRODUCES A FORMATTED LISTING OF ALL THE
  9. * INFORMATION CONTAINED IN THE TAF SYSTEM JOURNAL FILE *JOUR0*
  10. * ON A FILE CALLED *JOURNAL*. TO EXECUTE THIS PROGRAM, *JOUR0*
  11. * MUST BE A LOCAL FILE.
  12. *
  13. * THE OUTPUT ON FILE *JOURNAL* IS FORMATTED ACCORDING TO THE
  14. * FOLLOWING HEADERS.
  15. *
  16. * SEQ - TRANSACTION SEQUENCE INDICATOR IN OCTAL.
  17. *
  18. * ORG - ORIGIN INDICATOR IN OCTAL.
  19. *
  20. * CNT - LENGTH OF JOURNAL MESSAGE IN CHARACTERS (ROUNDED UP TO
  21. * A WORD BOUNDARY).
  22. *
  23. * TASK - NAME OF TASK.
  24. *
  25. * TIME - HH.MM.SS IN DECIMAL.
  26. *
  27. * USER - USER NAME ASSOCIATED WITH THE TRANSACTION, IF TASK
  28. * ORIGIN.
  29. *
  30. * JOURNAL MESSAGE - MESSAGE JOURNALIZED BY TAF.
  31. *
  32. * DATE - YY/MM/DD (DATE WHEN TAF WAS BROUGHT UP) IN DECIMAL.
  33. *
  34. ENVIRONMENT DIVISION.
  35. CONFIGURATION SECTION.
  36. SOURCE-COMPUTER. CYBER-170.
  37. OBJECT-COMPUTER. CYBER-170.
  38. SPECIAL-NAMES.
  39. "TERMINAL" IS SCREEN
  40. .
  41. INPUT-OUTPUT SECTION.
  42. FILE-CONTROL.
  43. SELECT RPT-FILE
  44. ASSIGN TO JOURNAL
  45. USE "RT=Z"
  46. .
  47. DATA DIVISION.
  48. FILE SECTION.
  49. FD RPT-FILE
  50. LABEL RECORDS ARE OMITTED.
  51. 01 RPT-RECORD PIC X(136).
  52. *
  53. WORKING-STORAGE SECTION.
  54. 01 LOG-RECORD.
  55. *
  56. * THE LOG RECORD HEADER IS 30 CHARACTERS LONG.
  57. *
  58. 05 LOG-HEADER.
  59.  
  60. 07 WORD-ONE.
  61.  
  62. 10 FILLER PIC X(07).
  63. 10 LOG-TRAILER-CHARACTER-COUNT
  64. COMP-4 PIC 9(05).
  65.  
  66. 07 WORD-TRANEX REDEFINES WORD-ONE.
  67. 10 TRANEX PIC X(07).
  68. 10 FILLER PIC X(03).
  69.  
  70. 07 WORD-TWO.
  71. 10 TAF-TASK-NAME PIC X(07).
  72. 10 TAF-TIME.
  73. 15 TAF-HR PIC X(01).
  74. 15 TAF-MN PIC X(01).
  75. 15 TAF-SC PIC X(01).
  76.  
  77. 07 WORD-DATE REDEFINES WORD-TWO.
  78. 10 FILLER PIC X(04).
  79. 10 TAF-YR PIC X(01).
  80. 10 TAF-MT PIC X(01).
  81. 10 TAF-DY PIC X(01).
  82. 10 FILLER PIC X(03).
  83.  
  84. 07 WORD-THREE.
  85. 10 TAF-USERNAME PIC X(07).
  86. 10 FILLER PIC X(03).
  87.  
  88. *
  89. * END OF LOG RECORD HEADER
  90. *
  91.  
  92. *
  93. * LOG TRAILER DEFINITION FOLLOWS
  94. *
  95. 05 LOG-TRAILER PIC X(01) OCCURS 0 TO 65535 TIMES
  96. DEPENDING ON LOG-TRAILER-CHARACTER-COUNT.
  97. *
  98. 01 PRINT-A-LINE.
  99. 03 PRINT-HEADER.
  100. 05 FILLER PIC X(01) VALUE " ".
  101. 05 P-TAF-SEQ PIC X(08).
  102. 05 FILLER PIC X(01).
  103. 05 P-TAF-ORG PIC X(02).
  104. 05 FILLER PIC X(01).
  105. 05 P-CHAR-COUNT PIC ZZZZ9.
  106. 05 FILLER PIC X(01).
  107. 05 P-TASK-NAME PIC X(07).
  108. 05 FILLER PIC X(01).
  109. 05 P-TAF-HR PIC 9(02).
  110. 05 P-POINT-1 PIC X(01) VALUE ".".
  111. 05 P-TAF-MN PIC 9(02).
  112. 05 P-POINT-2 PIC X(01) VALUE ".".
  113. 05 P-TAF-SC PIC 9(02).
  114. 05 FILLER PIC X(01).
  115. 05 P-TAF-USERNAME PIC X(07).
  116. 05 FILLER PIC X(01).
  117. 03 P-LOG-TRAILER.
  118. 05 P-LOG PIC X(01) OCCURS 90.
  119. *
  120. 01 PRINT-DATE.
  121. 05 FILLER PIC X(15) VALUE " --------------".
  122. 05 FILLER PIC X(15) VALUE "---------------".
  123. 05 FILLER PIC X(14) VALUE "------------- ".
  124. 05 FILLER PIC X(07) VALUE "DATE - ".
  125. 05 P-TAF-YR PIC 9(02).
  126. 05 FILLER PIC X(01) VALUE "/".
  127. 05 P-TAF-MT PIC 9(02).
  128. 05 FILLER PIC X(01) VALUE "/".
  129. 05 P-TAF-DY PIC 9(02).
  130. 05 FILLER PIC X(15) VALUE " --------------".
  131. 05 FILLER PIC X(15) VALUE "---------------".
  132. 05 FILLER PIC X(15) VALUE "---------------".
  133. 05 FILLER PIC X(15) VALUE "---------------".
  134. 05 FILLER PIC X(12) VALUE "------------".
  135. *
  136. 01 RPT-HDG-1.
  137. 05 FILLER PIC X(09) VALUE "1 SEQ".
  138. 05 FILLER PIC X(06) VALUE "ORG".
  139. 05 FILLER PIC X(05) VALUE "CNT".
  140. 05 FILLER PIC X(08) VALUE "TASK".
  141. 05 FILLER PIC X(08) VALUE "TIME".
  142. 05 FILLER PIC X(08) VALUE "USER".
  143. 05 FILLER PIC X(15) VALUE "JOURNAL MESSAGE".
  144. 05 FILLER PIC X(29) VALUE " ".
  145. 05 FILLER PIC X(09) VALUE "(RECORDS".
  146. 05 REC-FROM PIC Z(05).
  147. 05 FILLER PIC X(02) VALUE " -".
  148. 05 REC-TO PIC Z(05).
  149. 05 FILLER PIC X(10) VALUE ") PAGE".
  150. 05 PAGE-CNT PIC Z(04).
  151. 01 RPT-HDG-2 PIC X(10) VALUE SPACES.
  152. 01 DET-COUNT COMP-1 PIC 9(10) VALUE 20.
  153. 01 REC-COUNT PIC 9(10) VALUE 0.
  154. 01 CNT-FROM PIC 9(06) VALUE 1.
  155. 01 CNT-TO PIC 9(06) VALUE 20.
  156. 01 CNT-PAGE PIC 9(05) VALUE 0.
  157. 01 SUB1 COMP-1 PIC 9(10).
  158. 01 PER-PAGE PIC 9(10) VALUE 58.
  159. 01 COMP-1-WORD COMP-1 PIC 9(10) VALUE 0.
  160. 01 COMP-1-WORD-R REDEFINES COMP-1-WORD.
  161. 05 FILLER PIC X(09).
  162. 05 ONE-CHARACTER PIC X(01).
  163. 01 LINE-LENGTH PIC 9(10) VALUE 90.
  164. 01 YEAR-OFFSET PIC 9(02) VALUE 70.
  165. 01 CHAR-COUNT PIC 9(10).
  166. 01 BLANK-LINE PIC X(132).
  167. 01 POINT PIC X(01) VALUE ".".
  168. 01 ZERO-COUNT PIC 9(10) VALUE 0.
  169. 01 NBR-WORDS COMP-1 PIC 9(10) VALUE 0.
  170. 01 W-TAF-SEQ.
  171. 05 FILLER PIC X(02).
  172. 05 TAF-SEQ PIC X(08).
  173. *
  174. * TAF-ORG CONTAINS ONE OF THE FOLLOWING:
  175. *
  176. * 0 TASK ORIGIN (JOURNAL REQUEST).
  177. * 1 TRANSACTION SUBSYSTEM ORIGIN (INPUT).
  178. * 2 DATA MANAGER ORIGIN.
  179. * 3 TRANSACTION SUBSYSTEM RECOVERY/STATISTICAL DATA.
  180. * 4 END OF TRANSACTION INDICATOR.
  181. * 5 INCOMPLETE BLOCK OF TERMINAL INPUT DATA.
  182. * 6 TERMINAL INPUT FOR AN INTERACTIVE TASK.
  183. * 7 ILLEGAL INTERCONTROL POINT TRANSFER.
  184. * 10 ON LINE LIBTASK UPDATE (TT OPTION).
  185. * 11 CDCS DETECTED ERROR (ERROR MESSAGE FOLLOWS HEADER).
  186. * 12 *MSG* REQUEST WITH ZERO FUNCTION CODE. NORMAL FORTRAN
  187. * MESSAGES ARE LOGGED WITH THIS FUNCTION CODE.
  188. *
  189. 01 W-TAF-ORG.
  190. 05 FILLER PIC X(08).
  191. 05 TAF-ORG PIC X(02).
  192. *
  193. * ERR-STATUS WILL CONTAIN ONE OF THE FOLLOWING:
  194. *
  195. * -3 CIO ERROR ENCOUNTERED
  196. * -2 EOI ENCOUNTERED
  197. * -1 EOF ENCOUNTERED
  198. * 0 NO ERROR ENCOUNTERED
  199. * 1 EOR ENCOUNTERED
  200. * 2 ZERO LENGTH RECORD ENCOUNTERED
  201. *
  202. 01 ERR-STATUS COMP-1 PIC S9(10) VALUE 0.
  203. *
  204. PROCEDURE DIVISION.
  205.  
  206.  
  207. *** MAIN PROGRAM.
  208.  
  209.  
  210. DO-IT.
  211. MOVE PER-PAGE TO DET-COUNT CNT-TO.
  212. OPEN OUTPUT RPT-FILE.
  213. *
  214. READ-FIRST.
  215. ENTER COMPASS "READFR"
  216. USING
  217. LOG-RECORD
  218. NBR-WORDS
  219. ERR-STATUS
  220. W-TAF-SEQ
  221. W-TAF-ORG
  222. .
  223. PERFORM ERROR-CHECKING.
  224. GO TO PROCESS-ONE.
  225. *
  226. READ-ONE.
  227. ENTER COMPASS "READNR"
  228. USING
  229. LOG-RECORD
  230. NBR-WORDS
  231. ERR-STATUS
  232. W-TAF-SEQ
  233. W-TAF-ORG
  234. .
  235. PERFORM ERROR-CHECKING.
  236. *
  237. PROCESS-ONE.
  238. ADD 1 TO REC-COUNT.
  239. COMPUTE LOG-TRAILER-CHARACTER-COUNT =
  240. (LOG-TRAILER-CHARACTER-COUNT * 10).
  241. SUBTRACT 30 FROM LOG-TRAILER-CHARACTER-COUNT.
  242. ADD 1 TO ZERO-COUNT.
  243. PERFORM PRINT-DETAIL.
  244. GO TO READ-ONE.
  245. *
  246. CIO-ERROR.
  247. DISPLAY "CIO ERROR DETECTED" UPON SCREEN.
  248. GO TO END-OF-JOB.
  249. *
  250. END-OF-JOB.
  251. CLOSE RPT-FILE.
  252. DISPLAY "RECORDS READ =" REC-COUNT UPON SCREEN.
  253. DISPLAY "AFTER IMAGES PROCESSED =" ZERO-COUNT UPON SCREEN.
  254. DISPLAY "OUTPUT ON FILE *JOURNAL*.".
  255. STOP RUN.
  256.  
  257.  
  258. *** SUBROUTINES.
  259.  
  260.  
  261. ERROR-CHECKING.
  262. IF (ERR-STATUS EQUAL -1) OR (ERR-STATUS EQUAL 1)
  263. OR (ERR-STATUS EQUAL 2)
  264. GO TO READ-ONE.
  265. IF ERR-STATUS EQUAL -2
  266. GO TO END-OF-JOB.
  267. IF ERR-STATUS EQUAL -3
  268. GO TO CIO-ERROR.
  269. * END OF PROCEDURE ERROR-CHECKING.
  270.  
  271.  
  272. INSPECT-LOG-TRAILER.
  273. INSPECT P-TASK-NAME REPLACING ALL ":" BY " ".
  274. INSPECT P-TAF-USERNAME REPLACING ALL ":" BY " ".
  275. INSPECT P-LOG-TRAILER REPLACING ALL ":" BY " ".
  276. * END OF PROCEDURE INSPECT-LOG-TRAILER.
  277.  
  278.  
  279. PRINT-DETAIL.
  280. ADD 1 TO DET-COUNT.
  281. IF DET-COUNT GREATER THAN PER-PAGE
  282. MOVE 1 TO DET-COUNT
  283. ADD 1 TO CNT-PAGE
  284. MOVE CNT-PAGE TO PAGE-CNT
  285. MOVE CNT-FROM TO REC-FROM
  286. MOVE CNT-TO TO REC-TO
  287. WRITE RPT-RECORD FROM RPT-HDG-1
  288. WRITE RPT-RECORD FROM RPT-HDG-2
  289. ADD PER-PAGE TO CNT-FROM
  290. ADD PER-PAGE TO CNT-TO
  291. WRITE RPT-RECORD FROM RPT-HDG-2
  292. .
  293. MOVE TAF-SEQ TO P-TAF-SEQ.
  294. MOVE TAF-ORG TO P-TAF-ORG.
  295. MOVE LOG-TRAILER-CHARACTER-COUNT
  296. TO P-CHAR-COUNT.
  297. MOVE TAF-TASK-NAME TO P-TASK-NAME.
  298. MOVE TAF-HR TO ONE-CHARACTER.
  299. MOVE COMP-1-WORD TO P-TAF-HR.
  300. MOVE TAF-MN TO ONE-CHARACTER.
  301. MOVE COMP-1-WORD TO P-TAF-MN.
  302. MOVE TAF-SC TO ONE-CHARACTER.
  303. MOVE COMP-1-WORD TO P-TAF-SC.
  304. MOVE TAF-USERNAME TO P-TAF-USERNAME.
  305. MOVE 1 TO SUB1.
  306. MOVE SPACES TO P-LOG-TRAILER.
  307. PERFORM WRITE-RECORD
  308. UNTIL (SUB1 > LOG-TRAILER-CHARACTER-COUNT)
  309. OR (TRANEX = "*TRANEX").
  310. IF (TRANEX = "*TRANEX")
  311. MOVE TAF-DY TO ONE-CHARACTER
  312. MOVE COMP-1-WORD TO P-TAF-DY
  313. MOVE TAF-MT TO ONE-CHARACTER
  314. MOVE COMP-1-WORD TO P-TAF-MT
  315. MOVE TAF-YR TO ONE-CHARACTER
  316. MOVE COMP-1-WORD TO P-TAF-YR
  317. ADD YEAR-OFFSET TO P-TAF-YR
  318. WRITE RPT-RECORD FROM PRINT-DATE
  319. ELSE IF (LOG-TRAILER-CHARACTER-COUNT = 0)
  320. PERFORM WRITE-LINE.
  321. MOVE POINT TO P-POINT-1.
  322. MOVE POINT TO P-POINT-2.
  323. * END OF PROCEDURE PRINT-DETAIL.
  324.  
  325.  
  326. TRANSFER.
  327. MOVE LOG-TRAILER (SUB1) TO P-LOG (CHAR-COUNT).
  328. ADD 1 TO CHAR-COUNT.
  329. ADD 1 TO SUB1.
  330. * END OF PROCEDURE TRANSFER.
  331.  
  332.  
  333. WRITE-LINE.
  334. PERFORM INSPECT-LOG-TRAILER.
  335. WRITE RPT-RECORD FROM PRINT-A-LINE.
  336. MOVE BLANK-LINE TO PRINT-A-LINE.
  337. * END OF PROCEDURE WRITE-LINE.
  338.  
  339.  
  340. WRITE-RECORD.
  341. MOVE 1 TO CHAR-COUNT.
  342. PERFORM TRANSFER UNTIL (CHAR-COUNT > LINE-LENGTH) OR
  343. (SUB1 > LOG-TRAILER-CHARACTER-COUNT).
  344. PERFORM WRITE-LINE.
  345. * END OF PROCEDURE WRITE-RECORD.
  346.  
  347.  
  348. * END OF PROGRAM TAFLOG.
  349. *WEOR
  350. IDENT READJ
  351. TITLE READJ - READ TAF JOURNAL FILE.
  352. ENTRY READFR
  353. ENTRY READNR
  354. SST
  355. SYSCOM B1
  356. *COMMENT TAFLOG - READ TAF JOURNAL FILE.
  357. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  358. SPACE 4,10
  359. *** READJ - READ TAF JOURNAL FILE.
  360. *
  361. * *READJ* READS ENTRIES (RECORDS) FROM THE TAF JOURNAL FILE ONE
  362. * AT A TIME. *READJ* CAN BE CALLED BY COBOL OR FORTRAN
  363. * PROGRAMS. *READJ* WILL READ PAST EOR AND EOF ON THE JOURNAL
  364. * FILE. THE TAF JOURNAL FILE MUST BE A LOCAL FILE WITH THE
  365. * NAME *JOUR0*. THE ENTRY POINTS IN *READJ* ARE *READFR*
  366. * AND *READNR*. ENTRY POINT *READFR* IS USED TO READ THE FIRST
  367. * RECORD FROM THE JOURNAL FILE. ALL SUBSEQUENT RECORDS ARE
  368. * READ BY CALLING *READNR*. THERE MUST BE ONLY ONE CALL
  369. * (FIRST) TO *READFR* IN ANY PROGRAM READING THE JOURNAL FILE.
  370. * THE CALLS TO *READFR* AND *READNR* ARE EXACTLY THE SAME.
  371. *
  372. * FORTRAN CALL TO *READFR* IS:
  373. *
  374. * CALL READFR(IREC,LEN,ISTAT,SEQ,ORG)
  375. *
  376. * COBOL CALL TO *READFR* IS:
  377. *
  378. * ENTER COMPASS "READFR" USING IREC, LEN, ISTAT, SEQ, ORG.
  379. *
  380. * FORTRAN CALL TO *READNR* IS:
  381. *
  382. * CALL READNR(IREC,LEN,ISTAT,SEQ,ORG)
  383. *
  384. * COBOL CALL TO *READNR* IS:
  385. *
  386. * ENTER COMPASS "READNR" USING IREC, LEN, ISTAT, SEQ, ORG.
  387. *
  388. * THE PARAMETERS ARE AS FOLLOWS:
  389. *
  390. * IREC = FWA OF THE WORKING BUFFER WHERE THE FIRST
  391. * OR NEXT RECORD WILL BE READ. THIS BUFFER
  392. * MUST BE LARGE ENOUGH TO HOLD THE LARGEST
  393. * RECORD ON THE JOURNAL FILE.
  394. *
  395. * LEN = THIS IS AN INTEGER VARIBLE FOR FORTRAN AND
  396. * COMP-1 FOR COBOL5.
  397. * THE LENGTH OF RECORD READ IN WORDS IS
  398. * RETURNED TO THE CALLER. THIS IS MEANINGFUL
  399. * ONLY WHEN ISTAT IS 0.
  400. *
  401. * ISTAT = THIS IS AN INTEGER VARIABLE FOR FORTRAN AND
  402. * COMP-1 FOR COBOL5.
  403. * THE STATUS OF THE REQUEST IS RETURNED TO THE USER
  404. * IN THIS PARAMETER AFTER COMPLETION OF THE REQUEST.
  405. * -3 = CIO ERROR ON READ.
  406. * -2 = EOI READ.
  407. * -1 = EOF READ.
  408. * 0 = NORMAL TERMINATION.
  409. * 1 = EOR READ.
  410. * 2 = ZERO LENGTH RECORD READ.
  411. *
  412. * SEQ = THIS IS A CHARACTER VARIABLE FOR FORTRAN AND COBOL5.
  413. * THE TAF SEQUENCE INDICATOR IS RETURNED TO THE
  414. * CALLER AS A DISPLAY CODED OCTAL VALUE.
  415. *
  416. * ORG = THIS IS A CHARACTER VARIABLE FOR FORTRAN AND COBOL5.
  417. * THE TAF ORIGIN INDICATOR IS RETURNED TO THE CALLER
  418. * AS A DISPLAY CODED OCTAL VALUE.
  419. *
  420. * TO READ PAST EOR/EOF ON JOURNAL FILE THE CALLER SHOULD IGNORE
  421. * EOR/EOF STATUS. THE FILE MAY BE READ UNTIL EOI IS REACHED OR
  422. * UNTIL A CIO ERROR IS ENCOUNTERED.
  423. SPACE 4,10
  424. *CALL COMCMAC
  425. SPACE 4,10
  426. JBUFL EQU 6401D JOURNAL FILE BUFFER LENGTH
  427. SPACE 4,10
  428. J BSS 0 JOURNAL FILE FET
  429. JOUR0 FILEB JBUF,JBUFL
  430. FWA BSS 1 FWA OF USER BUFFER
  431. NWORDS BSS 1 ADDRESS FOR NUMBER OF WORDS TRANSFERRED
  432. STATUS BSS 1 ADDRESS OF STATUS WORD
  433. SEQADR BSS 1 ADDRESS OF TAF SEQUENCE INDICATOR
  434. ORGADR BSS 1 ADDRESS OF TAF ORIGIN
  435. READFR SPACE 4,10
  436. ** READFR - READ FIRST RECORD.
  437.  
  438.  
  439. READFR SUBR ENTRY/EXIT
  440. SB1 1
  441. RJ PRS PRESET
  442. REWIND J
  443. READ J READ FIRST X PRU-S
  444. RJ RNX READ FIRST RECORD
  445. EQ READFRX RETURN
  446. READNR SPACE 4,10
  447. ** READNR - READ NEXT RECORD.
  448.  
  449.  
  450. READNR SUBR ENTRY/EXIT
  451. SB1 1
  452. RJ PRS PRESET
  453. RJ RNX READ NEXT RECORD
  454. EQ READNRX RETURN
  455. TITLE SUBROUTINES.
  456. PRS SPACE 4,10
  457. ** PRS - PRESET.
  458. *
  459. * EXIT (FWA) = FIRST WORD OF USER BUFFER.
  460. * (NWORDS) = SECOND PARAMETER ADDRESS.
  461. * (STATUS) = STATUS WORD ADDRESS.
  462. * (SEQADR) = TAF SEQUENCE INDICATOR WORD ADDRESS.
  463. * (ORGADR) = TAF ORIGIN WORD ADDRESS.
  464.  
  465.  
  466. PRS SUBR ENTRY/EXIT
  467. SX6 X1
  468. SA6 FWA SAVE FWA OF USER BUFFER
  469. SA2 A1+B1
  470. SX7 X2
  471. SA7 NWORDS SAVE SECOND PARAMETER ADDRESS
  472. SA2 A2+B1
  473. SX7 X2
  474. SA7 STATUS SAVE STATUS WORD ADDRESS
  475. MX6 0
  476. SA6 X7 ZERO OUT ERROR STATUS
  477. SA2 A2+B1
  478. SX7 X2
  479. SA7 SEQADR SAVE TAF SEQUENCE INDICATOR WORD ADDRESS
  480. SA6 X7 ZERO OUT TAF SEQUENCE INDICATOR
  481. SA2 A2+B1
  482. SX7 X2
  483. SA7 ORGADR SAVE TAF ORIGIN WORD ADDRESS
  484. SA6 X7 ZERO OUT TAF ORIGIN
  485. EQ PRSX RETURN
  486. RNX SPACE 4,10
  487. ** RNX - READ NEXT RECORD.
  488. *
  489. * USES X - 0, 1, 2, 6, 7.
  490. * A - 1, 2, 6, 7.
  491. * B - 6, 7.
  492. *
  493. * CALLS COD.
  494. *
  495. * MACROS READO, READW.
  496.  
  497.  
  498. RNX SUBR ENTRY/EXIT
  499. READO J READ HEADER WORD
  500. NZ X1,RNX4 IF EOR/EOF
  501. BX0 X6 SAVE (X6)
  502. SA2 RNXA
  503. BX2 X6-X2 CHECK FOR LABEL RECORD
  504. NZ X2,RNX1 IF NOT LABEL RECORD
  505. SB7 2 NUMBER OF WORDS TO TRANSFER
  506. SX7 3 LENGTH OF RECORD IN WORDS
  507. EQ RNX2 PROCESS LABEL RECORD
  508.  
  509. RNX1 MX1 24
  510. BX1 X1*X6 GET TAF SEQUENCE INDICATOR
  511. LX1 -36
  512. MX2 1
  513. LX2 -30
  514. BX1 X1+X2 ASSURE THAT LEADING ZEROES ARE CONVERTED
  515. RJ COD CONVERT OCTAL TO DISPLAY CODE
  516. BX6 X4
  517. SA2 SEQADR
  518. SA6 X2 RETURN TAF SEQUENCE INDICATOR TO CALLER
  519. MX1 6
  520. LX1 -24
  521. BX1 X1*X0 GET TAF ORIGIN
  522. LX1 -30
  523. MX2 1
  524. LX2 -30
  525. BX1 X1+X2 ASSURE THAT LEADING ZEROES ARE CONVERTED
  526. RJ COD CONVERT OCTAL TO DISPLAY CODE
  527. BX6 X4
  528. SA2 ORGADR
  529. SA6 X2 RETURN TAF ORIGIN TO CALLER
  530. SB7 X0-1 NUMBER OF WORDS TO TRANSFER
  531. SX7 X0
  532. RNX2 SA2 NWORDS
  533. SA7 X2 RETURN WORD COUNT TO CALLER
  534. SA1 FWA FWA OF USER BUFFER
  535. BX6 X0 RESTORE (X6)
  536. ZR B7,RNX3 IF ONLY 1 WORD RECORD
  537. NG B7,RNX5 IF ZERO LENGTH RECORD
  538. SA6 X1 RETURN FIRST WORD OF RECORD
  539. SX1 X1+B1
  540. READW J,X1,B7 READ REST OF RECORD
  541. NZ X1,RNX4 IF EOR/EOF
  542. MX6 0 SET ERROR FLAG TO ZERO
  543. EQ RNX6 COMPLETE REQUEST
  544.  
  545. RNX3 SA6 X1 RETURN 1 WORD TO USER BUFFER
  546. MX6 0
  547. EQ RNX6 COMPLETE REQUEST
  548.  
  549.  
  550. * PROCESS EOR/EOF.
  551.  
  552. RNX4 SX6 X1 EOR/EOF/EOI
  553. SA1 J CLEAR EOR/EOF STATUS FOR NEXT READ
  554. SX0 30B
  555. BX7 -X0*X1
  556. SA7 A1 CLEAR EOR/EOF STATUS
  557. EQ RNX6 COMPLETE REQUEST
  558.  
  559. * PROCESS ZERO-LENGTH RECORD.
  560.  
  561. RNX5 SX6 2 ZERO LENGTH RECORD
  562. EQ RNX6 COMPLETE REQUEST
  563.  
  564. * RETURN STATUS TO CALLER.
  565.  
  566. RNX6 SA1 STATUS
  567. SA6 X1 RETURN STATUS TO CALLER
  568. EQ RNXX RETURN TO CALLER
  569.  
  570. RNXA DATA C/*TRANEX*/
  571. SPACE 4,10
  572. *CALL COMCCOD
  573. SPACE 4,10
  574. JBUF BSSZ JBUFL
  575. END
cdc/nos2.source/opl871/taflog.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator