User Tools

Site Tools


cdc:nos2.source:nam5871:hapfail

HAPFAIL

Table Of Contents

  • [00024] PRGM HAPFAIL
  • [00099] PROC ABORT
  • [00100] PROC BLINK
  • [00101] PROC HCSTTP
  • [00102] PROC MGETS
  • [00103] PROC MRELS
  • [00104] PROC OVLCALL
  • [00105] PROC OMSG
  • [00106] PROC OSCCALL
  • [00107] PROC OSCHAPP
  • [00108] PROC RDUMP
  • [00109] PROC XRECALL
  • [00110] PROC XTRACE

Source Code

HAPFAIL.txt
  1. *DECK HAPFAIL
  2. USETEXT NIPDEF
  3. USETEXT ACB
  4. USETEXT ACNB
  5. USETEXT AHEADER
  6. USETEXT ACNT
  7. USETEXT APPSTAT
  8. USETEXT AT
  9. USETEXT DISTAIL
  10. USETEXT DRHDR
  11. USETEXT DUMPFLG
  12. USETEXT FLIST
  13. USETEXT KDIS
  14. USETEXT MSGIDX
  15. USETEXT NWLHEAD
  16. USETEXT NWLNTRY
  17. USETEXT OVERLAY
  18. USETEXT PARAMS
  19. USETEXT PT
  20. USETEXT SUPABH
  21. USETEXT SUPMSG
  22. USETEXT PWL
  23. USETEXT SWAPIN
  24. PRGM HAPFAIL; # PROCESS A FAILED APPLICATION #
  25.  
  26. STARTIMS;
  27. #
  28. *1DC HAPFAIL
  29. *
  30. * 1. PROC NAME AUTHOR DATE
  31. * HAPFAIL E. GEE 77/07/27
  32. *
  33. * 2. FUNCTIONAL DESCRIPTION.
  34. * THIS ROUTINE IS RESPONSIBLE FOR PROCESSING A *FAILED-APP*
  35. * STATUS FROM A NWL OR A *RCUCPGONE* RETURN CODE FROM A SCP CALL.
  36. *
  37. * 3. METHOD USED.
  38. * CHECK IF FAILURE OCCURRED WHILE PROCESSING WORKLIST (APP IS
  39. * NO LONGER IN SYSTEM) OR OPERATING SYSTEM INFORMED US OF
  40. * APPLICATION-FAILED STATUS.
  41. * IF NIP RECEIVED APPLICATION-FAILED STATUS, CHECK TO SEE IF
  42. * ACB OR (NO ACB) SWAPIN ENTRY EXISTS. IF SO CLEAN UP
  43. * APPROPRIATE ENTRIES.
  44. * IF ACB EXISTS, CHECK IF IT IS NVF THAT FAILED. IF SO, ABORT.
  45. * IF APP STILL HAS CONNECTIONS WITH NETWORK, ISSUE SCP FUNCTION
  46. * TO CLEAR ALL CONNECTIONS.
  47. * SEND FAIL/APPL SUP MSG TO NVF IF NECESSARY
  48. * CLEAN UP WORKLIST
  49. *
  50. * 4. ENTRY PARAMETERS.
  51. * FAILADR ACB ADDRESS OR NWL ADDRESS
  52. *
  53. * 5. EXIT PARAMETERS.
  54. * FAILADR = 0.
  55. *
  56. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  57. * ACB APPSTAT AT DRHDR DUMPFLG
  58. * FLIST MSGIDX NIPDEF NWLHEAD
  59. * NWLNTRY OPSIZE OVERLAY PARAMS
  60. * PT SWAPIN
  61. * ACNB AHEADER ACNT KDIS
  62. * SUPABH SUPMSG
  63. *
  64. * 7. ROUTINES CALLED.
  65. * ABORT ABORT PROGRAM AND DAYFILE MESSAGES
  66. * BLINK LINK MESSAGE ON DATA RING
  67. * HCSTTP HOST CONNECTION STATE TABLE PROCESSOR
  68. * MGETS ALLOCATE BUFFER
  69. * MRELS RELEASE BUFFER SIZE
  70. * OMSG ISSUE DAYFILE MESSAGE
  71. * OSCHAPP SCHEDULE APPLICATION
  72. * OSCCALL SYSTEM-CONTROL-POINT CALL
  73. * OVLCALL LOAD OVERLAY
  74. * RDUMP DUMP NIP-S FIELD LENGTH
  75. * XRECALL ISSUE EVENT RECALL
  76. * XSAPPDL OVL DELINK (NO ACB) SWAPIN ENTRY
  77. * XTRACE TRACES CALLS
  78. * XERRMSG OVL DAYFILE MESSAGE
  79. *
  80. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
  81. * NVF FAILURE.
  82. * NIP UNABLE TO FIND FAILED APP XXXX .
  83. *
  84. * THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE OVLCALL.
  85. * WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO LOCATION RJMAIN
  86. * TO RETURN TO THE CALLING PROGRAM.
  87. *
  88. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
  89. *CALL OPSIZE
  90. *
  91. * THIS OVERLAY IS CALLED BY HHIR AND XSACB.
  92. *
  93.  #
  94. STOPIMS;
  95. #
  96.   EXTERNAL VARIABLES
  97. #
  98. XREF BEGIN
  99. PROC ABORT; # ABORT PROGRAM AND DAYFILE MESSAGES #
  100. PROC BLINK ;
  101. PROC HCSTTP ;
  102. PROC MGETS ;
  103. PROC MRELS; # RELEASE BUFFER SPACE #
  104. PROC OVLCALL; # LOAD OVERLAY #
  105. PROC OMSG; # DAYFILE MESSAGE #
  106. PROC OSCCALL;
  107. PROC OSCHAPP ;
  108. PROC RDUMP; # DUMP NIP-S FIELD LENGTH #
  109. PROC XRECALL; # ISSUE EVENT RECALL #
  110. PROC XTRACE; # TRACE CALLS #
  111. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  112. END
  113. #
  114.   INTERNAL VARIABLES
  115. #
  116. ITEM BLKADDR ;
  117. ITEM I ;
  118. ITEM LIMIT ;
  119. ITEM FOUND B; # TRUE = FOUND SWAPIN ENTRY FOR FAILED APP#
  120. ITEM IDX;
  121. ITEM OLDACNT; # ADDR OF ACNT OF FAILED APP #
  122. ITEM SECACN; # APP CON NUM FOR SECONDARY APPLICATION #
  123. ITEM HWHERE; # INDEX TO UNASSIGNED APP NAME IN ALERT #
  124. ITEM HAPNO;
  125. ITEM HINDEX;
  126. ITEM FAILANAME C(7);
  127. ARRAY LOCALFL S(FLSIZE) ;
  128. BEGIN
  129. ITEM WORD U(0,0,WL) ;
  130. END
  131. BASED ARRAY HALTNR [1:1] S(1);
  132. BEGIN
  133. ITEM HALTN C(00,00,07);
  134. END
  135. SWITCH HHN HM,HA,HB,HC,HD,HHE;
  136. #**********************************************************************#
  137. BEGIN
  138. CONTROL IFEQ DEBUG,1 ;
  139. XTRACE("HAPFA") ;
  140. CONTROL FI;
  141. #
  142.   DETERMINE IF APP FAILED WHILE NIP WAS PROCESSING ITS WORKLIST OR
  143.   NIP RECEIVED APPLICATION FAILED STATUS FROM CPU MONITOR
  144. #
  145. P<DRHDRWD> = FAILADR;
  146. IF BLKID[0] NQ NWLIDVALUE
  147. THEN
  148. BEGIN # APPL FAILS WHILE PROCESSING #
  149. ACBADDR = FAILADR ; # NWL OR PWL #
  150. P<ACB> = ACBADDR ;
  151. END # #
  152. ELSE
  153. BEGIN # NORMAL FAILURE CASE #
  154. P<NWLHEADER> = FAILADR ; # NWL BUFFER #
  155. JOBID = NWLJOBID[0] ; # JOB ID WORD #
  156. FOUND = FALSE ; # INITIALIZE #
  157. ACBADDR = 0 ;
  158. #
  159.   SEARCH FOR ACB
  160. #
  161. FOR I = 1 STEP 1 WHILE I LQ ATHAN[0]
  162. AND NOT FOUND
  163. DO
  164. BEGIN # SEARCHING #
  165. P<ACB> = ATACBA[I] ;
  166. IF ACBJNWD[0] EQ JOBID
  167. THEN
  168. BEGIN # SAME ID WORD #
  169. ACBADDR = P<ACB> ;
  170. FOUND = TRUE ;
  171. IF ATASBI[I] # SWAPIN IN PROGRESS #
  172. AND ACBSCPCB[0] EQ 0 # WAITING FOR SWAPIN COMPLETION #
  173. THEN
  174. BEGIN
  175. XRECALL(LOC(ACBSWAPWR[0])); # ISSUE EVENT RECALL #
  176. ACBID[0] = ACBIDVALUE;
  177. END
  178. ATASB[I]=FALSE;# CLEAR APPLICATION STATUS BITS #
  179. END # SAME ID WORD #
  180. END # SEARCHING #
  181.  
  182. IF NOT FOUND
  183. OR ATNVFN[ACBAN[0]] # NETOFF IN PROGRESS #
  184. THEN
  185. BEGIN # ACN NOT FOUND #
  186. #
  187.   LOOK INTO THE SWAP-IN RING
  188. #
  189. FOR IDX = SWAPINFP WHILE IDX NQ 0
  190. AND IDX NQ LOC(SWAPINFP)
  191. DO
  192. BEGIN # SEARCH SWAP-IN RING #
  193. P<SWPIE> = IDX ;
  194. IF SWPIJOBID[0] EQ JOBID
  195. THEN
  196. BEGIN # IN SWAP-IN RING #
  197. FOUND = TRUE ;
  198. IF SWPICB[0] EQ 0
  199. THEN # WAITING FOR SCP REQUEST COMPLETION #
  200. XRECALL(LOC(SWPIFW[0])); # ISSUE EVENT RECALL #
  201. IDX = SWPIWR[0] ;
  202. IF IDX NQ 0
  203. THEN
  204. MRELS(IDX) ;
  205. IDX = SWPIFL[0] ;
  206. IF IDX NQ 0
  207. THEN
  208. MRELS(IDX) ;
  209. IDX = SWPINFP[0];
  210. PARAMS1 = P<SWPIE> ; # REMOVE ENTRY FOR SWAP IN RING #
  211. OVLNAME = XSAPPDLP ;
  212. OVLCALL ;
  213. MRELS(P<SWPIE>) ; # RELEASE SWAP-IN RING ENTRY #
  214. END # IN SWAPPING IN RING #
  215.  
  216. ELSE
  217. IDX = SWPINFP[0] ;
  218. END # SEARCHING #
  219.  
  220. END # ACB NOT FOUND #
  221.  
  222. IF NOT FOUND
  223. THEN
  224. BEGIN # ACB NOT FOUND IN *AT* AND #
  225. CONTROL IFEQ DEBUG,1;
  226. PARAMS1 = DFMSG04 ; # IN SWAP-IN RING #
  227. PARAMS2 = JOBID ; # ISSUE A DAYFILE MESSAGE #
  228. OVLNAME = XERRMSGP ;
  229. OVLCALL ;
  230. CONTROL FI;
  231. P<FLHEAD> = LOC(LOCALFL) - 1 ; # BLOCK FOR SCP CALL #
  232. FLFW[0] = 0 ;
  233. FLUCPA[0] = -1 ;
  234. FLFC[0] = SFENDT ;
  235. FLJOBID[0] = JOBID ;
  236. P<FLE> = LOC(LOCALFL) ;
  237. HFCALL = TRUE ;
  238. OSCCALL(FLE) ;
  239. HFCALL = FALSE ;
  240.  
  241. IF FLRC[0] EQ RCUCPAOOR
  242. THEN
  243. BEGIN # BAD REASON CODE RETURNED #
  244. D25M2[0] = "HAPFAIL" ;
  245. OMSG(DFMSG25,0); # NIP DUMP TAKEN #
  246. RDUMP ;
  247. END # BAD REASON CODE RETURNED #
  248. END
  249.  
  250. MRELS(P<NWLHEADER>) ; # RELEASE THE NWL #
  251.  
  252. END # APPL. FAILURE CASE #
  253. #
  254.   IF ACB EXISTS , CALL STATE TABLE PROCESSOR
  255. #
  256. IF ACBADDR NQ 0
  257. THEN
  258. BEGIN # ACB STILL EXISTS #
  259. FAILANAME = ACBANAME[0]; # SAVE FAILED APPLICATION NAME #
  260. IF ACBAN[0] EQ NVFAN
  261. THEN
  262. ABORT(DFMSG10,0) ; # NVF NETTING OFF #
  263.  
  264. IF ATNVFA[ACBAN[0]]
  265. THEN
  266. BEGIN # APPLIACTION DID NOT NETON O.K. #
  267. PARAMS1 = ACBAN[0] ; # RELEASE ACB AND NOT SEND APPL/FAIL#
  268. OVLNAME = RELACBP ; # TO NVF #
  269. OVLCALL ;
  270. END # NET/ON/A RECEIVED FOR THIS APPL #
  271.  
  272. ELSE
  273.  
  274. BEGIN # APPLICATION NETTED ON O.K. #
  275. IF NOT ATNVFN[ACBAN[0]]
  276. AND NOT ATNVFF[ACBAN[0]]
  277. THEN # APPLICATION NOT AWAITING NET/OFF/N FROM NVF #
  278. BEGIN
  279.  
  280. P<ACNT> = ACBACNT[0] ; # ACNT TABLE #
  281. OLDACNT = P<ACNT>;
  282.  
  283. LIMIT = ACNTHCN[0] - ACNTMINACN[0] + ACNTHSIZE ;
  284. FOR IDX = ACNTHSIZE STEP 1 UNTIL LIMIT
  285. DO
  286. BEGIN # CALL HC STATE TABLE #
  287. # WITH APP FAILED TRIGGER #
  288. IF ACNTACNB[IDX] NQ 0
  289. THEN
  290. BEGIN
  291. P<ACNB> = ACNTACNB[IDX] ;
  292. ACNBRC[0] = RCRC"AF" ; # RC= 2, APPL FAILURE #
  293. HCSTTP(ACBADDR,ACNBACN[0],FAILAP,0) ;
  294. END
  295. ELSE
  296. BEGIN # IN-ACTIVE ENTRY #
  297. IF ACNTSECID[IDX] NQ 0 # SEC ID NOT ZERO #
  298. THEN
  299. BEGIN # LOANED CONN. EXIT #
  300. SECACN = ACNTSECACN[IDX]; # ACN FOR SECONDARY APP #
  301. P<ACB> = ATACBA[ACNTSECAN[IDX]]; # ACB OF SECONDARY AP#
  302. P<ACNT> = ACBACNT[0]; # ACNT OF SECONDARY APP #
  303. P<ACNB> = ACNTACNB[SECACN-ACNTMINACN[0]-ACNTHSIZE];
  304. IF P<ACNB> NQ 0
  305. THEN # CON STILL EXISTS IN SEC APP #
  306. BEGIN
  307. ACNBPRAF[0] = TRUE; # SET PRI APP FAILED FLAG #
  308. END
  309. P<ACNT> = OLDACNT; # RESTORE ACNT ADR OF FAILED APP#
  310. END # LOANED CONN. EXIT #
  311. END # IN-ACTIVE ENTRY #
  312. END # CALL HC STATE TABLE #
  313. IF ACBFNTW0[0] NQ 0
  314. THEN
  315. BEGIN # FILE LOANNING EXISTED #
  316. IF ACBFNTMAS[0]
  317. THEN
  318. PARAMS1 = TMAB ; # MASTER HAS FAILED #
  319. ELSE
  320. PARAMS1 = TSAB ; # ELSE IS SLAVE #
  321. PARAMS2 = ACBAN[0] ; # AC OF FAILED APPLICATION#
  322. PARAMS3 = 0 ;
  323. OVLNAME = HFNTSMP ;
  324. OVLCALL ;
  325. END
  326. #
  327.   FORMAT APP/FAIL/U SM SEND TO NVF
  328.   #
  329. MGETS(LAPPF + BLKHSIZE + ABHSIZE,BLKADDR,TRUE) ;
  330. P<AHEADER> = BLKADDR + BLKHSIZE ;
  331. ABHWORD[0] = SMABHW[0] ;
  332. ABHTLC[0] = LAPPF ;
  333.  
  334. P<SUPMSG> = BLKADDR + BLKHSIZE + ABHSIZE ;
  335.  
  336. P<SMNVF> = P<SUPMSG> ;
  337. FAILAN[0] = ACBAN[0] ;
  338. PFCSFC[0] = FAIAPP ;
  339.  
  340. BLINK(BLKADDR,ATACBA[NVFAN]) ;
  341. OSCHAPP(ATACBA[NVFAN]) ;
  342. ATNVFF[ACBAN[0]] = TRUE; # SET WAITING FOR FAIL/APPL/N #
  343. END # SEND APPL/FAIL/U TO NVF #
  344. END # APPLICATION NETTED ON O.K. #
  345. IF KDAM[0] # NAM K DISPLAY IN APPLICATION MODE #
  346. AND KDAN[0] EQ ACBAN[0] # ASSIGNED TO FAILED APPLICATION #
  347. THEN # CLEAN UP NAM K DISPLAY TABLES #
  348. BEGIN
  349. OVLNAME = KPCLNUPP;
  350. OVLCALL;
  351. END
  352. IF NOT KDAM[0] # KDISPLAY IN NAME MODE #
  353. THEN
  354. BEGIN
  355. IF KDNAL[0] GR 0 # SOME APPL IN ALERT #
  356. THEN
  357. BEGIN # CHECK IF THIS IS THE ONE IN ALERT #
  358. HWHERE = 0;
  359. P<HALTNR> = LOC(KAPALT1[0]);
  360. FOR HINDEX = 1 STEP 1 WHILE HWHERE EQ 0 AND HINDEX LQ
  361. KMAXALT
  362. DO
  363. BEGIN
  364. IF HALTN[HINDEX] EQ FAILANAME # IF NAME ON ALERT BUFFER #
  365. THEN # SAME AS FAILED APPL NAME #
  366. BEGIN
  367. HWHERE = HINDEX; # MARK THE INDEX #
  368. END
  369. END # END OF FOR #
  370. IF HWHERE NQ 0 # START SHIFT APPL NAMES IN ALERT BUFFER #
  371. THEN
  372. BEGIN
  373. FOR HINDEX = HWHERE STEP 1 UNTIL KMAXALT -1
  374. DO
  375. BEGIN
  376. HALTN[HINDEX] = HALTN[HINDEX + 1];
  377. END
  378. KAPALT5[0] = " ";
  379. GOTO HHN[HWHERE];
  380. HM: ;
  381. HA: KDALAN1[0] = KDALAN2[0];
  382. HB: KDALAN2[0] = KDALAN3[0];
  383. HC: KDALAN3[0] = KDALAN4[0];
  384. HD: KDALAN4[0] = KDALAN5[0];
  385. HHE: KDALAN5[0] = 0;
  386. KDNAL[0] = KDNAL[0] - 1;
  387. END # END OF APPL SHIFT #
  388. END # END OF SOME KAPPL #
  389. END # END OF KDAM #
  390. END # END OF NON-ZERO ACB ADDRESS #
  391. FAILADR = 0 ; # APPL/FAILURE PROCESSED #
  392. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  393. END
  394. TERM
cdc/nos2.source/nam5871/hapfail.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator