User Tools

Site Tools


cdc:nos2.source:nam5871:np_pioe

NP$PIOE

Table Of Contents

  • [00005] PROC NP$PIOE(FET)
  • [00101] PROC NP$BKSP
  • [00102] PROC NP$CLK
  • [00103] PROC NP$DATE
  • [00104] PROC NP$MSG
  • [00105] PROC NP$READ
  • [00106] PROC NP$RETN
  • [00107] PROC NP$RTIM
  • [00108] PROC NP$RWD
  • [00109] PROC NP$WRTO
  • [00110] PROC NP$WRTR
  • [00111] PROC NP$WRTW

Source Code

NP$PIOE.txt
  1. *DECK NP$PIOE
  2. USETEXT AIPDEF
  3. USETEXT NP$DB
  4. USETEXT NP$ZHDR
  5. PROC NP$PIOE(FET); # PROCESS I/O ERROR AFTER WRITE FUNCTION #
  6. *IF,DEF,IMS
  7. #
  8. *1DC NP$PIOE
  9. *
  10. * 1. SUBROUTINE AUTHOR DATE
  11. * NP$PIOE E. GEE 86/01/28
  12. *
  13. * 2. FUNCTIONAL DESCRIPTION.
  14. * PROCESS I/O ERROR AFTER WRITE OPERATION ON AIP FILE.
  15. *
  16. * 3. METHOD USED.
  17. * CALL NP$MSG TO ISSUE INFORMATIVE DAYFILE MESSAGE.
  18. * CALL NP$RETN TO RETURN FILE.
  19. * REINITIALIZE FET.
  20. * IF FILE IS AIP DEBUG LOG FILE,
  21. * IF JOB RECORD FILE EXISTS,
  22. * IF JOB RECORD FILE NEEDS TO BE REWOUND,
  23. * CALL NP$RWD TO REWIND JOB RECORD FILE.
  24. * ELSE (JOB RECORD FILE SHOULD NOT BE REWOUND),
  25. * CALL NP$BKSP TO BACKSPACE TO PREVIOUS RECORD ON FILE.
  26. * IF NO I/O ERROR ON JOB RECORD FILE,
  27. * CALL NP$READ TO READ UP JOB RECORD.
  28. * IF I/O ERROR ON JOB RECORD FILE,
  29. * CALL NP$MSG TO ISSUE INFORMATIVE DAYFILE MESSAGE.
  30. * ELSE (NO I/O ERROR ON JOB RECORD FILE),
  31. * CALL NP$WRTR TO WRITE JOB RECORD + EOR TO TRACE FILE.
  32. * CALL NP$RTIM TO GET SYSTEM RTIME.
  33. * CALL NP$CLK TO GET CURRENT CLOCK TIME.
  34. * CALL NP$DATE TO GET TODAY'S DATE.
  35. * CREATE HEADER ENTRY.
  36. * CALL NP$WRTW TO WRITE OUT HEADER ENTRY TO CIO BUFFER.
  37. * CALL NP$WRTR TO WRITE END OF RECORD TO FILE.
  38. * CALL NP$WRTO TO WRITE CLOCK TIME TO CIO BUFFER.
  39. *
  40. * 4. ENTRY PARAMETERS.
  41. * DB$JR TRUE IF JOB RECORD FILE EXISTS
  42. * DB$LFN LFN OF JOB RECORD FILE IF ONE EXISTS
  43. * DB$RWD TRUE IF JOB RECORD FILE NEEDS TO BE REWOUND
  44. * FET FET OF FILE WHICH GOT I/O ERROR
  45. *
  46. * 5. EXIT PARAMETERS.
  47. * NONE.
  48. *
  49. * 6. COMMON DECKS CALLED AND SYMPL TEXT USED.
  50. * AIPDEF AIP CONSTANT DEFINITIONS
  51. * NP$DB DEBUG LOG FILE BUFFER
  52. * NP$CRT CONTROL DATA COPYRIGHT
  53. * NP$ZHDR AIP DEBUG LOG FILE HEADER ENTRY
  54. *
  55. * 7. SUBROUTINES AND MACROS CALLED.
  56. * NP$BKSP BACKSPACE FILE ONE LOGICAL RECORD
  57. * NP$CLK GET CURRENT CLOCK TIME
  58. * NP$DATE GET TODAY'S DATE
  59. * NP$MSG ISSUE DAYFILE MESSAGE
  60. * NP$READ READ DATA FROM FILE
  61. * NP$RETN RETURN FILE TO SYSTEM
  62. * NP$RWD REWIND FILE
  63. * NP$RTIM GET SYSTEM RTIME
  64. * NP$WRTO WRITE SINGLE WORD FROM WSA TO CIO BUFFER
  65. * NP$WRTR WRITE END OF RECORD TO FILE
  66. * NP$WRTW WRITE DATA FROM WSA TO CIO BUFFER
  67. *
  68. * 8. DAYFILE MESSAGES.
  69. * " BKSP ERROR ON FILE XXXXXXX - AT=YYB."
  70. * " READ ERROR ON FILE XXXXXXX - AT=YYB."
  71. * " REWIND ERROR ON FILE XXXXXXX - AT=YYB."
  72. * " WRITE ERROR ON FILE ZZZZZDN - AT=YYB."
  73. *
  74.  #
  75. *ENDIF
  76. BEGIN
  77. #
  78.   INPUT PARAMETERS
  79. #
  80. ARRAY FET S(8);
  81. BEGIN
  82. ITEM FETLFN C(0,00,07); # LOCAL FILE NAME #
  83. ITEM FETLN U(0,42,04); # LEVEL NUMBER #
  84. ITEM FETAT U(0,46,05); # ABNORMAL TERMINATION CODE #
  85. ITEM FETCODE U(0,51,08); # REQUEST/RETURN CODE #
  86. ITEM FETUP B(1,14,01); # USER PROCESSING FLAG #
  87. ITEM FETEP B(1,15,01); # ERROR PROCESSING FLAG #
  88. ITEM FETFB B(1,23,01); # FLUSH BIT #
  89. ITEM FETLEN U(1,36,06); # NO OF ADDITIONA WORDS IN FET #
  90. ITEM FETFIRST U(1,42,18); # FWA OF CIO BUFFER #
  91. ITEM FETWD1 U(1,00,60);
  92. ITEM FETIN U(2,42,18); # IN PTR FOR CIO BUFFER #
  93. ITEM FETOUT U(3,42,18); # OUT PTR FOR CIO BUFFER #
  94. ITEM FETLIMIT U(4,42,18); # LWA+1 OF CIO BUFFER #
  95. END
  96. #
  97.   EXTERNAL ROUTINES CALLED
  98. #
  99. XREF
  100. BEGIN
  101. PROC NP$BKSP; # BACKSPACE FILE 1 LOGICAL REC #
  102. PROC NP$CLK; # GET CURRENT CLOCK TIME #
  103. PROC NP$DATE; # GET CURRENT DATE #
  104. PROC NP$MSG; # ISSUE DAYFILE MESSAGE #
  105. PROC NP$READ; # READ DATA FROM FILE #
  106. PROC NP$RETN; # RETURN FILE TO SYSTEM #
  107. PROC NP$RTIM; # GET SYSTEM RTIME #
  108. PROC NP$RWD; # REWIND FILE #
  109. PROC NP$WRTO; # WRITE 1 WD FROM WSA TO CIO BUF#
  110. PROC NP$WRTR; # WRITE END OF REC TO FILE #
  111. PROC NP$WRTW; # WRITE DATA FROM WSA TO CIO BUF#
  112. END
  113.  
  114. *IF DEF,DEBUG
  115. #
  116.   LOCAL VARIABLES
  117. #
  118. ARRAY ERRMSG S(5); # ERROR MESSAGE IF ROUTE FAILS #
  119. BEGIN
  120. ITEM ERRMSGT C(0,0,07); # TYPE OF FUNCTION PERFORMED ON FILE #
  121. ITEM ERRMSG1 C(0,42,3) = [" ER"];
  122. ITEM ERRMSG2 C(1,0,10) = ["ROR ON FIL"];
  123. ITEM ERRMSG3 C(2,0,02) = ["E "];
  124. ITEM ERRMSGF C(2,12,7); # NAME OF FILE WITH ERROR #
  125. ITEM ERRMSG4 C(2,54,6) = [" "];
  126. ITEM ERRMSG5 C(3,0,05) = ["- AT="];
  127. ITEM ERRMSGAT U(3,30,12); # ERROR CODE FROM CIO #
  128. ITEM ERRMSG6 C(3,42,3) = ["B. "];
  129. ITEM ERRMSGE U(4,0,60) = [0];
  130. END
  131.  
  132. ITEM AT; # ABNORMAL TERM CODE FROM CIO #
  133. ITEM TIMEWD; # WORD TO CONTAIN CURRENT RTIME #
  134. ITEM CHARWD C(10); # WORD TO CONTAIN CLOCK/DATE #
  135.  
  136. #**********************************************************************#
  137. #
  138.   EXECUTABLE CODE BEGINS HERE
  139. #
  140. #
  141.   ISSUE INFORMATIVE DAYFILE MESSAGE
  142. #
  143. ERRMSGT[0] = " WRITE "; # TYPE OF FUNCTION PERFORMED #
  144. ERRMSGF[0] = FETLFN[0]; # STORE LOCAL FILE NAME IN MSG #
  145. ERRMSGAT[0] = ((FETAT[0]/8)+27)*64 + FETAT[0] - (FETAT[0]/8)*8+27;
  146. NP$MSG(ERRMSG,3); # ISSUE DAYFILE MESSAGE #
  147. #
  148.   RETURN FILE WITH I/O ERROR
  149. #
  150. FETCODE[0] = 0; # CLEAR FET REQUEST/RETURN CODE #
  151. FETAT[0] = 0; # CLEAR ABNORMAL TERM CODE FIELD#
  152. NP$RETN(FET); # RETURN FILE TO SYSTEM #
  153. #
  154.   REINITIALIZE FET
  155. #
  156. FETLN[0] = 0; # INITIALIZE LEVEL NUMBER FIELD #
  157. FETAT[0] = 0; # INITIALIZE ABNORMAL TERM FIELD#
  158. FETCODE[0] = 0; # INITIALIZE REQUEST/RETURN CODE#
  159. FETIN[0] = FETFIRST[0]; # INITIALIZE FET IN POINTER #
  160. FETOUT[0] = FETFIRST[0]; # INITIALIZE FET OUT POINTER #
  161. #
  162. , CHECK IF FILE IS AIP DEBUG LOG FILE
  163. #
  164. IF FETLFN[0] EQ "ZZZZZDN"
  165. THEN # AIP DEBUG LOG FILE HAD I/O ERR#
  166. BEGIN
  167. IF DB$JR
  168. THEN # NEED TO TRY TO COPY JOB RECORD#
  169. BEGIN
  170. FETLFN[0] = DB$LFN; # LFN OF JOB RECORD FILE #
  171. IF DB$RWD
  172. THEN # NEED TO REWIND JOB RECORD FILE#
  173. BEGIN
  174. NP$RWD(FET); # REWIND FILE TO BOI #
  175. ERRMSGT[0] = " REWIND"; # TYPE OF FUNCTION PERFORMED #
  176. END
  177. ELSE # NEED TO BACKSPACE JOB REC FILE#
  178. BEGIN
  179. NP$BKSP(FET); # BACKSPACE FILE ONE LOGICAL REC#
  180. ERRMSGT[0] = " BKSP "; # TYPE OF FUNCTION PERFORMED #
  181. END
  182. AT = FETAT[0]; # CIO ABNORMAL TERMINATION CODE #
  183.  
  184. IF AT EQ 0
  185. THEN # NO I/O ERROR ON JOB REC FILE #
  186. BEGIN
  187. NP$READ(FET,1); # READ LOGICAL RECORD OF LFN #
  188. IF (FETAT[0] NQ 0) AND # NO ABNORMAL TERMINATION CODE #
  189. (FETAT[0] NQ 1) # EOI NOT ENCOUNTERED #
  190. THEN # NO ERROR OCCURRED ON READ #
  191. BEGIN
  192. ERRMSGT[0] = " READ "; # TYPE OF FUNCTION PERFORMED #
  193. AT = FETAT[0]; # ABNORMAL TERMINATION CODE #
  194. END
  195. END
  196. FETLFN = "ZZZZZDN"; # RESET FILE NAME IN FET #
  197. FETAT[0] = 0;
  198. FETLN[0] = 0; # INITIALIZE LEVEL NUMBER FIELD #
  199. IF AT NQ 0
  200. THEN # ISSUE DAYFILE MSG FOR I/O ERR #
  201. BEGIN
  202. ERRMSGF[0] = DB$LFN; # FILE NAME #
  203. ERRMSGAT[0] = ((AT/8)+27)*64 + AT - (AT/8)*8 + 27;
  204. NP$MSG(ERRMSG,3); # ISSUE DAYFILE MESSAGE #
  205. END
  206. ELSE # JOB RECORD WAS NOT READ #
  207. BEGIN
  208. NP$WRTR(FET,1); # WRITE EOR TO FILE ZZZZZDN #
  209. END
  210. END
  211. NP$RTIM(TIMEWD); # GET SYSTEM RTIME #
  212. ZH$TIM[0] = TIMEWD; # STORE IN LOG FILE HEADER ENTRY#
  213. NP$CLK(CHARWD); # GET CURRENT CLOCK TIME #
  214. ZH$CLK[0] = CHARWD; # STORE CLOCK TIME IN HDR ENTRY #
  215. NP$DATE(CHARWD); # GET CURRENT DATE #
  216. ZH$DATE[0] = CHARWD; # STORE DATE IN HEADER ENTRY #
  217. NP$WRTW(FET,ZHDR,4); # WRITE HDR ENTRY TO CIO BUFFER #
  218. NP$WRTR(FET,1); # WRITE END OF RECORD TO FILE #
  219. NP$CLK(CHARWD); # GET CURRENT CLOCK TIME #
  220. NP$WRTO(FET,CHARWD); # WRITE CLOCK TIME IN CIO BUFFER#
  221. END
  222. *ENDIF
  223.  
  224. END
  225. TERM
cdc/nos2.source/nam5871/np_pioe.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator