User Tools

Site Tools


cdc:nos2.source:nam5871:opitrce

OPITRCE

Table Of Contents

  • [00005] PROC OPITRCE1)
  • [00082] PROC DAYTIME
  • [00083] PROC ILOFS
  • [00084] PROC ITRACE
  • [00085] PROC OMSG
  • [00086] PROC OPRETN
  • [00087] PROC READ
  • [00088] PROC REWIND
  • [00089] PROC WRITEO
  • [00090] PROC WRITER
  • [00091] PROC XTRACE

Source Code

OPITRCE.txt
  1. *DECK OPITRCE
  2. USETEXT NIPDEF
  3. USETEXT BPIPBUF
  4. USETEXT DBGBUF
  5. PROC OPITRCE((LFN),(FRWD)); # INITIALIZE NIP DEBUG LOG FILE #
  6. STARTIMS;
  7. #
  8. *1DC OPITRCE
  9. *
  10. * 1. SUBROUTINE AUTHOR DATE
  11. * OPITRCE E. GEE 86/02/03
  12. *
  13. * 2. FUNCTIONAL DESCRIPTION.
  14. * INITIALIZE NIP DEBUG LOG FILE.
  15. *
  16. * 3. METHOD USED.
  17. * IF JOB RECORD FILE NEEDS TO BE READ,
  18. * RESET FET FOR JOB RECORD FILE.
  19. * IF JOB RECORD FILE NEEDS TO BE REWOUND,
  20. * CALL REWIND TO REWIND JOB RECORD FILE.
  21. * IF NO I/O ERROR,
  22. * CALL READ TO READ IN JOB RECORD.
  23. * IF I/O ERROR,
  24. * CALL OMSG TO ISSUE INFORMATIVE DAYFILE MESSAGE.
  25. * ELSE (NO I/O ERROR OCCURRED),
  26. * CALL WRITER TO WRITE JOB RECORD AND EOR TO ZZZZZDN.
  27. * IF I/O ERROR ON ZZZZZDN FILE,
  28. * CALL OMSG TO ISSUE INFORMATIVE DAYFILE MESSAGE.
  29. * CALL OPRETN TO RETURN BAD ZZZZZDN FILE.
  30. * RESET FET POINTERS.
  31. * CALL ILOFS TO SET FLUSH FET LIST.
  32. * CALL ITRACE TO SET UP HEADER ENTRY IN CIO BUFFER.
  33. * CALL WRITER TO FLUSH CIO BUFFER AND WRITE END OF RECORD.
  34. * IF NO I/O ERROR,
  35. * CALL DAYTIME TO GET CURRENT CLOCK TIME.
  36. * CALL WRITEO TO COPY CLOCK TIME TO CIO BUFFER.
  37. * ELSE (I/O ERROR ON DEBUG LOG FILE),
  38. * CALL OMSG TO ISSUE INFORMATIVE DAYFILE MESSAGE.
  39. *
  40. * 4. ENTRY PARAMETERS.
  41. * LFN NAME OF FILE WITH JOB RECORD IF NEEDED
  42. * FRWD REWIND FILE FLAG
  43. * = 0 REWIND FILE BEFORE READ
  44. * = 1 NO REWIND
  45. *
  46. * 5. EXIT PARAMETERS.
  47. * BPAT[0] NONZERO IF I/O ERROR
  48. *
  49. * 6. COMMON DECKS CALLED AND SYMPL TEXT USED.
  50. * BPIPBUF FET AND CIO BUFFER FOR DEBUG LOG FILE
  51. * DBGBUF DEBUG BUFFERS
  52. * NIPDEF NIP CONSTANT DEFINITIONS
  53. *
  54. * 7. SUBROUTINES AND MACROS CALLED.
  55. * DAYTIME GET CURRENT TIME
  56. * ILOFS EXECUTE SETLOF MACRO
  57. * ITRACE CREATE HEADER ENTRY IN CIO BUFFER
  58. * OMSG ISSUE DAYFILE MESSAGE
  59. * OPRETN RETURN FILE
  60. * READ READ FILE
  61. * REWIND REWIND FILE
  62. * WRITEO WRITE ONE WORD TO CIO BUFFER
  63. * WRITER WRITE END OF RECORD TO FILE
  64. * XTRACE RECORD PROCEDURE CALL
  65. *
  66. * 8. DAYFILE MESSAGES.
  67. * " CIO ERROR XXB, LFN = ZZZZZZZ."
  68. *
  69.  #
  70. STOPIMS;
  71. BEGIN
  72. #
  73.   INPUT PARAMETERS
  74. #
  75. ITEM LFN C(10); # NAME OF LOCAL JOB RECORD #
  76. ITEM FRWD B; # REWIND FLAG #
  77. #
  78.   EXTERNAL ROUTINES CALLED
  79. #
  80. XREF
  81. BEGIN
  82. PROC DAYTIME; # GET CURRENT TIME #
  83. PROC ILOFS; # EXECUTE SETLOF MACRO #
  84. PROC ITRACE; # WRITE HDR ENTRY TO CIO BUFFER #
  85. PROC OMSG; # ISSUE DAYFILE MESSAGE #
  86. PROC OPRETN; # RETURN FILE #
  87. PROC READ; # READ FILE #
  88. PROC REWIND; # REWIND FILE #
  89. PROC WRITEO; # WRITE 1 WD FROM WSA TO CIO BUF#
  90. PROC WRITER; # WRITE END OF REC TO FILE #
  91. PROC XTRACE; # RECORD PROCEDURE CALL #
  92. END
  93. #
  94.   LOCAL VARIABLES
  95. #
  96. CONTROL IFEQ ZZDN,1;
  97.  
  98. ITEM DTIME; # WORD TO CONTAIN CURRENT TIME #
  99.  
  100. ARRAY WRMSG S(4); # ERROR MESSAGE IF WRITE FAILS #
  101. BEGIN
  102. ITEM WRMSG1 C(0,0,30) = [" CIO ERROR XXB, LFN = ZZZZZDN."];
  103. ITEM WRMSGAT U(1,6,12); # ABNORMAL TERMINATION CODE FROM CIO #
  104. ITEM WRMSGLN C(2,12,7); # NAME OF FILE WITH I/O ERROR #
  105. ITEM WRMSGE U(4,00,60) = [0];
  106. END
  107.  
  108. CONTROL FI;
  109.  
  110. #**********************************************************************#
  111. #
  112.   EXECUTABLE CODE BEGINS HERE
  113. #
  114. CONTROL IFEQ ZZDN,1;
  115.  
  116. CONTROL IFEQ DEBUG,1;
  117. XTRACE("OPITRC"); # RECORD PROCEDURE CALL #
  118. CONTROL FI;
  119. #
  120.   IF MC IS NONZERO, THERE IS A JOB RECORD FILE WHICH MUST BE READ
  121. #
  122. IF MC NQ 0
  123. THEN # JOB RECORD FILE TO READ #
  124. BEGIN
  125. BPNAME[0] = LFN; # INITIALIZE LOCAL FILE NAME #
  126. BPIN[0] = BPFIRS[0]; # INITIALIZE FET IN POINTER #
  127. BPOUT[0] = BPFIRS[0]; # INITIALIZE FET OUT POINTER #
  128. BPAT[0] = 0; # INITIALIZE ABNORMAL TERM FIELD#
  129. IF NOT FRWD
  130. THEN # NEED TO REWIND JOB RECORD FILE#
  131. BEGIN
  132. REWIND(BPFET); # REWIND JOB RECORD FILE #
  133. END
  134. IF BPAT[0] EQ 0
  135. THEN # NO I/O ERR ON JOB RECORD FILE #
  136. BEGIN
  137. READ(BPFET,1); # READ JOB RECORD INTO CIO BUF #
  138. END
  139. IF BPAT[0] EQ 0
  140. THEN # NO I/O ERR ON JOB RECORD FILE #
  141. BEGIN
  142. BPNAME[0] = "ZZZZZDN"; # NAME OF NIP DEBUG LOG FILE #
  143. WRITER(BPFET,1); # WRITE JOB REC PLUS EOR TO FILE#
  144. IF BPAT[0] NQ 0
  145. THEN # I/O ERR ON NIP DEBUG LOG FILE #
  146. BEGIN
  147. WRMSGAT[0] = ((BPAT[0]/8)+27)*64 + BPAT[0]-(BPAT[0]/8)*8+27;
  148. WRMSGLN[0] = BPNAME[0]; # NAME OF FILE WITH I/O ERROR #
  149. OMSG(WRMSG,0); # ISSUE DAYFILE MESSAGE #
  150. OPRETN(BPFET); # RETURN BAD FILE #
  151. END
  152. END
  153. ELSE # I/O ERR ON JOB RECORD FILE #
  154. BEGIN
  155. WRMSGAT[0] = ((BPAT[0]/8)+27)*64 + BPAT[0] - (BPAT[0]/8)*8+27;
  156. WRMSGLN[0] = BPNAME[0]; # NAME OF FILE WITH I/O ERROR #
  157. OMSG(WRMSG,0); # ISSUE DAYFILE MESSAGE #
  158. END
  159. END
  160. #
  161.   REINITIALIZE FET
  162. #
  163. BPNAME[0] = "ZZZZZDN"; # INITIALIZE LOCAL FILE NAME #
  164. BPIN[0] = BPFIRS[0]; # INITIALIZE FET IN POINTER #
  165. BPOUT[0] = BPFIRS[0]; # INITIALIZE FET OUT POINTER #
  166. BPAT[0] = 0; # INITIALIZE ABNORMAL TERM FIELD#
  167.  
  168. MSGCNT = 0; # REINITIALIZE MESSAGE COUNT #
  169.  
  170. ILOFS; # EXECUTE SETLOF MACRO #
  171. ITRACE(BPFET); # WRITE HDR ENTRY TO CIO BUFFER #
  172. WRITER(BPFET,1); # FLUSH CIO BUF AND WRITE EOR #
  173. #
  174. , CHECK FOR I/O ERROR AFTER WRITING END OF RECORD
  175. #
  176. IF BPAT[0] EQ 0
  177. THEN # NO I/O ERROR ON ZZZZZDN FILE #
  178. BEGIN
  179. DAYTIME(DTIME); # GET CURRENT TIME #
  180. WRITEO(BPFET,1); # WRITE CURRENT TIME TO CIO BUF #
  181. END
  182. ELSE # I/O ERROR OCCURRED ON ZZZZZDN #
  183. BEGIN
  184. #
  185.   ISSUE INFORMATIVE DAYFILE MESSAGE
  186. #
  187. WRMSGAT[0] = ((BPAT[0]/8)+27)*64 + BPAT[0] - (BPAT[0]/8)*8+27;
  188. WRMSGLN[0] = BPNAME[0]; # NAME OF FILE WITH I/O ERROR #
  189. OMSG(WRMSG,0); # ISSUE DAYFILE MESSAGE #
  190. END
  191. CONTROL FI;
  192.  
  193. RETURN;
  194. END
  195. TERM
1)
LFN),(FRWD
cdc/nos2.source/nam5871/opitrce.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator