User Tools

Site Tools


cdc:nos2.source:opl871:sxstge

SXSTGE

Table Of Contents

  • [00001] PROC ST$$DOC
  • [00003] ST$$DOC - DOCUMENTATION FOR FILE STAGING.
  • [00271] PROC STAGER1)
  • [00273] STAGER - STAGE A FILE FROM CARTRIDGE TO DISK.
  • [00278] STAGER - STAGE A FILE.
  • [00319] PROC ABORT
  • [00320] PROC ACQ$FCT
  • [00321] PROC ADD$LNK
  • [00322] PROC ASIGNPF
  • [00323] PROC CFLUSH
  • [00324] PROC CKPFETC
  • [00325] PROC CRDAST
  • [00326] PROC CWTAST
  • [00327] PROC DELAY
  • [00328] PROC EESET
  • [00329] PROC HLCPYCD
  • [00330] PROC HLLOAD
  • [00331] PROC HLLDSET
  • [00332] PROC UPUSAGE
  • [00333] PROC MESSAGE
  • [00334] PROC MSGAFDF
  • [00335] PROC RECALL
  • [00336] PROC REQWEST
  • [00337] PROC RETERN
  • [00338] PROC RLS$FCT
  • [00339] PROC SETAF
  • [00340] PROC SETDA
  • [00341] PROC STERCAT
  • [00342] PROC STERPFM
  • [00343] PROC STNTDAM
  • [00344] PROC TELLSLV
  • [00345] PROC UREPLAC
  • [00346] PROC ZSETFET
  • [01293] ENTRY #
  • [01377] PROC STERCAT2)
  • [01379] STERCAT - PROCESS STAGE CATALOG ACCESS ERRORS.
  • [01384] STERCAT - PROCESS STAGE CATALOG ACCESS ERRORS.
  • [01410] PROC ABORT
  • [01411] PROC MESSAGE
  • [01469] PROC STERPFM3)
  • [01471] STERPFM - PROCESS STAGE *PFM* ERRORS.
  • [01476] STERPFM - PROCESS STAGE *PFM* ERRORS.
  • [01509] PROC ABORT
  • [01510] PROC MESSAGE
  • [01511] PROC PFMEC
  • [01574] PROC STNTDAM4)
  • [01576] STNTDAM - GET NEXT STAGING REQUEST
  • [01581] STNTDAM - GET NEXT STAGING REQUEST.
  • [01614] PROC ADD$LNK
  • [01615] PROC DEL$LNK
  • [01616] PROC ZFILL
  • [01728] PROC TDAM$RP
  • [01730] TDAM$RP - *TDAM* REQUEST PROCESSOR.
  • [01735] TDAM$RP - *TDAM* REQUEST PROCESSOR.
  • [01787] PROC ADD$LNK
  • [01788] PROC CRELSLK
  • [01789] PROC CRELSMM
  • [01790] PROC DEL$LNK
  • [01791] PROC HLRQENQ
  • [01792] PROC SSOVL
  • [01793] PROC MSG
  • [01794] PROC MSGAFDF
  • [01795] PROC ZFILL

Source Code

SXSTGE.txt
  1. PROC ST$$DOC;
  2.  
  3. # TITLE ST$$DOC - DOCUMENTATION FOR FILE STAGING. #
  4.  
  5. BEGIN # ST$$DOC #
  6.  
  7. #
  8. *
  9. *
  10. * S T A G I N G O V E R V I E W
  11. *
  12. * A USER MAKES A PERMANENT FILE MANAGER (*PFM*) REQUEST TO *ATTACH*
  13. * OR *GET* A PERMANENT FILE. *PFM* DETECTS THAT THE FILE DOES NOT
  14. * EXIST ON DISK AND NEEDS TO BE STAGED TO DISK FROM THE M860.
  15. * *PFM* BUILDS A STAGING (*TDAM*) REQUEST WHICH TOGETHER WITH THE
  16. * M860 CATALOGS (*SFMCAT* FILES) PROVIDES ALL THE INFORMATION
  17. * NEEDED BY THE *SSEXEC* TO LOCATE THE DATA FOR THE FILE ON THE
  18. * M860 CARTRIDGE(S) AND STAGE THIS DATA BACK TO DISK.
  19. *
  20. * *PFM* MAKES A SYSTEM MONITOR REQUEST TO TRANSFER THIS *TDAM*
  21. * ENTRY TO *SSEXEC* WHERE IT IS STORED AT LOCATION *RA$TDAM* IN THE
  22. * FIELD LENGTH OF *SSEXEC*.
  23. *
  24. * ON A MASTER MAINFRAME, THE STAGING *TDAM* REQUEST IS MOVED FROM
  25. * *RA$TDAM* TO A QUEUE CALLED THE REAL TIME REQUEST QUEUE (*RTRQ*).
  26. * ITS STAYS IN THIS QUEUE UNTIL IT CAN BE SCHEDULED FOR STAGING AT
  27. * WHICH TIME IT IS PLACED INTO AN *HLRQ* ENTRY. WHEN THE FILE IS
  28. * STAGED, A SYSTEM EVENT IS POSTED WHICH WILL RESTART ANY JOB
  29. * WAITING FOR THIS FILE SO THE ORIGINAL *ATTACH* OR *GET* REQUEST
  30. * CAN BE SATISFIED.
  31. *
  32. * ON A SLAVE MAINFRAME, THE STAGING *TDAM* REQUEST IS WRITTEN TO A
  33. * FILE (IN *ECS*) USED TO COMMUNICATE *TDAM* REQUESTS FROM THE
  34. * SLAVE MAINFRAME TO THE MASTER MAINFRAME. *SSEXEC* ON THE MASTER
  35. * MAINFRAME PERIODICALLY EXAMINES THIS COMMUNICATION FILE. WHEN IT
  36. * SEES A NEW STAGING REQUEST, IT ADDS IT TO THE *RTRQ*. WHEN THE
  37. * FILE HAS BEEN STAGED, A RESPONSE TO THE STAGE REQUEST IS WRITTEN
  38. * ON A COMPANION COMMUNICATION FILE USED TO SEND INFORMATION FROM
  39. * THE MASTER TO THE SLAVE MAINFRAME. UPON RECEIPT OF THE RESPONSE,
  40. * THE SLAVE MAINFRAME ISSUES A SYSTEM EVENT TO RESTART ANY JOBS
  41. * WAITING FOR THE FILE TO BE STAGED.
  42. #
  43.  
  44. CONTROL EJECT;
  45.  
  46. #
  47. * R O U T I N E S U S E D T O S T A G E F I L E S
  48. *
  49. * F O R M A S T E R M A I N F R A M E J O B S
  50. *
  51. * 1) MAINLOOP/NEWWORK WHEN *MAINLP* SENSES A *TDAM* REQUEST IN
  52. * *RA$TDAM*, IT CALLS *TRYTDAM* TO PUT THE *TDAM* ENTRY INTO THE
  53. * *RTRQ*. *MAINLP* ALSO SENSES *TDAM* ENTRIES IN THE *RTRQ* AND
  54. * WHEN APPROPRIATE, CALLS *NEWWORK* TO CALL *TDAM$RP* TO PROCESS
  55. * THESE *TDAM* REQUESTS. FOR STAGING *TDAM* REQUESTS, THIS
  56. * CONSISTS OF BUILDING AN *HLRQ* ENTRY FOR THE FILE TO BE STAGED.
  57. *
  58. * 2) TRYTDAM CALLS *ENTDAM* TO ADD THE STAGING REQUEST TO THE
  59. * *RTRQ*. IT SETS A BIT IN THE *TDAM* REQUEST TO INDICATE THAT THE
  60. * REQUEST CAME FROM A JOB ON THE MASTER MAINFRAME. IT ALSO CLEARS
  61. * *RA$TDAM* SO THE NEXT *TDAM* REQUEST CAN BE SUBMITTED.
  62. *
  63. * 3) ENTDAM SEARCHES THE *RTRQ* AND ACTIVE *HLRQ* CHAINS TO SEE
  64. * IF A DUPLICATE OF THIS REQUEST ALREADY EXISTS. IF ITS NOT A
  65. * DUPLICATE AND AN *RTRQ* ENTRY IS AVAILABLE, THE *TDAM* ENTRY IS
  66. * ADDED TO THE *RTRQ*.
  67. *
  68. * 4) TDAM$RP IS CALLED BY *NEWWORK* TO SCHEDULE A FILE TO BE
  69. * STAGED. *TDAM$RP* WILL NOT SCHEDULE A FILE TO BE STAGED WHEN ITS
  70. * CARTRIDGE IS IN USE, OR IF THE STORAGE MODULE TO BE USED HAS NO
  71. * AVAILABLE TRANSPORTS ON WHICH THE CARTRIDGE CAN BE MOUNTED. IF A
  72. * FILE IS BEING DESTAGED TO THE SAME CARTRIDGE, THE *DOSTG* FLAG
  73. * IS SET IN THE *HLRQ* ENTRY SO THE *HLRQ* CAN BE PREEMPTED FROM
  74. * DESTAGING AND USED TO STAGE THIS FILE BEFORE THE CARTRIDGE IS
  75. * UNLOADED. *TDAM$RP* ALSO BUILDS A MASK IN *STG$MSK* TO CONTROL
  76. * THE NEXT TIME IT IS TO BE CALLED. SEE ADDITIONAL DOCUMENTATION
  77. * FOR THIS IN *TDAM$RP* AND *COMXMSC*.
  78. *
  79. * 5) STAGER ACTUALLY CONTROLS THE STAGING OF THE FILE. IT USES
  80. * THE *ASA* VALUE FROM THE FILE'S *TDAM* ENTRY TO LOCATE THE
  81. * INITIAL PORTION OF THE FILE DATA (VOLUME) ON AN M860 CARTRIDGE.
  82. * IT USES LINKAGE INFORMATION IN THE *SFMCAT* FILE TO IDENTIFY
  83. * OTHER VOLUMES CONTAINING THE REMAINING PORTIONS OF THE FILE DATA.
  84. * IT CALLS *HLLOAD* TO LOAD THE CARTRIDGE AND *HLCPYCD* TO COPY THE
  85. * DATA FROM THE CARTRIDGE TO DISK. WHEN THE LAST VOLUME HAS BEEN
  86. * COPIED, *STAGER* CALLS *PFM* TO UPDATE THE *PFC* ENTRY FOR THE
  87. * FILE TO LINK TO THE DISK IMAGE. FINALLY, *STAGER* CALLS *PFM* TO
  88. * POST A SYSTEM EVENT INDICATING THAT THE FILE HAS BEEN STAGED SO
  89. * ANY JOBS WAITING FOR THIS FILE CAN BE RESTARTED. *STAGER* THEN
  90. * CALLS *STNTDAM* TO GET A *TDAM* ENTRY FOR ANOTHER FILE WHICH CAN
  91. * BE RETRIEVED FROM THE CURRENTLY AVAILABLE CARTRIDGE.
  92. *
  93. * 6) STNTDAM SCANS THE *RTRQ* TO LOCATE A FILE WHICH CAN BE
  94. * STAGED FROM THE CURRENTLY LOADED CARTRDIGE. IF SEVERAL SUCH
  95. * FILES ARE FOUND, IT WILL SELECT THE ONE CLOSEST TO THE BEGINNING
  96. * OF THE CARTRIDGE. IF NONE IS FOUND, THE *HLRQ* ENTRY IS RELEASED
  97. * AND THE NEXT FILE TO BE STAGED WILL BE SELECTED BY *TDAM$RP*.
  98. #
  99.  
  100. CONTROL EJECT;
  101.  
  102. #
  103. * M U L T I M A I N F R A M E R O U T I N E S
  104. *
  105. * 7) SLAVERP/SLVRBP *SLAVERP* IS PERIODICALLY CALLED BY BOTH THE
  106. * MAINLOOP AND THE IDLE ROUTINE (*DOZER*) OF *SSEXEC* TO READ THE
  107. * SLAVE TO MASTER COMMUNICATION FILE(S) AND RECOGNIZE ANY NEW
  108. * STAGING *TDAM* REQUESTS. IF *SLAVERP* IS CALLED BY *DOZER* IT
  109. * CLEARS A FLAG WHICH CAUSES CONTROL TO BE RETURNED TO THE
  110. * MAINLOOP. IF CALLED BY THE MAINLOOP WHEN A NEW REQUEST IS FOUND,
  111. * IT CALLS *SLVRBP* WHICH CALLS *SLVTDAM* WHICH CALLS *ENTDAM* TO
  112. * ADD THE REQUEST TO THE *RTRQ*.
  113. *
  114. * 8) SLVTDAM CALLS *ENTDAM* TO ADD THE REQUEST TO THE *RTRQ*.
  115. * IF THIS REQUEST CAN NOT BE ACCEPTED BECAUSE THE *RTRQ* IS FULL, A
  116. * FLAG IS SET WHICH ENSURES THAT THIS REQUEST WILL BE THE FIRST
  117. * ACCEPTED *TDAM* REQUEST FROM ANY OF THE SLAVE MAINFRAMES.
  118. *
  119. * 9) TELLSLV IS CALLED BY *STAGER* WHEN A FILE IS STAGED IF A
  120. * SLAVE MAINFRAME ISSUED A *TDAM* REQUEST TO STAGE THE FILE. IT
  121. * WRITES A RESPONSE TO THE COMMUNICATION FILE USED TO SEND REPLIES
  122. * FROM THE MASTER TO THE SLAVE MAINFRAME.
  123. #
  124.  
  125. CONTROL EJECT;
  126.  
  127. #
  128. * S T A G I N G P R O C E S S I N G F L O W
  129. *
  130. * ( D E T A I L E D )
  131. *
  132. * THE PROCEDURE *STAGER* USES THE FOLLOWING STEPS AS IT STAGES A
  133. * FILE FROM A CARTRIDGE TO DISK. THIS SEQUENCE OF STEPS WILL BE
  134. * REFERENCED IN THE FOLLOWING DISCUSSION OF STAGING ERROR
  135. * PROCESSING.
  136. *
  137. * 1) IT CALLS *PFM* WITH AN *ASIGNPF* REQUEST TO ENSURE THAT A
  138. * DIRECT ACCESS FILE IS STAGED TO A DISK (RESPECTING THE SECONDARY
  139. * DEVICE MASKS) WHICH HAS ENOUGH SPACE TO HOLD THE ENTIRE FILE.
  140. *
  141. * 2) IT CALLS *ACQ$FCT* TO READ THE *FCT* ENTRY FOR THE FIRST
  142. * CARTRIDGE TO MEMORY AND THEN CALLS *HLLOAD* TO LOAD THE CARTRIDGE
  143. * SO DATA CAN BE READ FROM IT.
  144. *
  145. * 3) IT THEN PREPARES TO COPY DATA FROM THE FIRST (NEXT) VOLUME TO
  146. * DISK.
  147. *
  148. * 4) IT THEN CALLS *HLCPYCD* TO COPY DATA FROM THE FIRST (NEXT)
  149. * VOLUME FROM THE CARTRIDGE TO DISK.
  150. *
  151. * 5) STEPS 2-4 ARE REPEATED AS NECESSARY UNTIL THE ENTIRE FILE IS
  152. * COPIED TO DISK.
  153. *
  154. * 6) *PFM* IS THEN CALLED TO BIND THE DISK IMAGE TO THE FILE'S
  155. * *PFC* ENTRY.
  156. *
  157. * 7) *PFM* IS CALLED TO CLEAR THE *ASA* VALUE IN THE FILE'S *PFC*
  158. * ENTRY IF APPROPRIATE.
  159. *
  160. * 8) PROCEDURE *EESET* IS THEN CALLED IF A JOB ON THE MASTER
  161. * MAINFRAME WANTED THIS FILE TO BE STAGED. PROCEDURE *TELLSLV* IS
  162. * CALLED IF A JOB ON A SLAVE MAINFRAME WANTED THIS FILE TO BE
  163. * STAGED.
  164. #
  165.  
  166. CONTROL EJECT;
  167.  
  168. #
  169. * S T A G I N G E R R O R P R O C E S S I N G
  170. *
  171. *
  172. * TWO TYPES OF ERRORS CAN BE ENCOUNTERED WHILE TRYING TO STAGE A
  173. * FILE TO DISK (RESOLVED AND UNRESOLVED). RESOLVED ERRORS ARE
  174. * DEFINED TO BE THOSE WHICH PRESENT A DEFINITIVE STATUS BACK TO THE
  175. * JOB ATTEMPTING TO ACCESS THE FILE WHICH WAS TO BE STAGED. AN
  176. * EXAMPLE OF A RESOLVED ERROR IS AN UNRECOVERABLE READ ERROR WHICH
  177. * IS REPORTED TO A JOB AS A PERMANENT ERROR. ANOTHER EXAMPLE
  178. * WOULD BE WHEN THE USER PURGED THE FILE AS IT WAS BEING STAGED.
  179. * *STAGER* WOULD NOT BE ABLE TO BIND THE DATA TO THE (NON-EXISTING)
  180. * *PFC* ENTRY AND WOULD REPORT THIS AS AN ERROR. THE USER WOULD
  181. * NOT BE IN DOUBT ABOUT THE STATUS OF THE STAGE SINCE THE FILE
  182. * WOULD NO LONGER EXIST. AN EXAMPLE OF AN UNRESOLVED ERROR IS WHEN
  183. * A CARTRIDGE IS LOST OR THE PATH TO THE HARDWARE IS DOWN SO THAT
  184. * THE STAGE OF THE FILE CAN NOT BE ATTEMPTED. IN THESE EXAMPLES,
  185. * THE STAGING SOFTWARE CAN NOT DECLARE A PERMANENT ERROR BECAUSE
  186. * THE ERROR CONDITION MAY BE RESOLVED. HOWEVER, THE USER WILL BE
  187. * WAITING FOR THE FILE TO BE STAGED WITHOUT RECEIVING A STATUS OF
  188. * THE PROBLEM FROM THE SOFTWARE. ALSO, THE *SSEXEC* WILL
  189. * CONTINUALLY BE REQUESTED TO STAGE THE FILE BECAUSE *PFM* REISSUES
  190. * THE STAGING *TDAM* REQUEST EVERY FEW SECONDS. CONSEQUENTLY, FOR
  191. * UNRESOLVED ERRORS, THE OPERATOR WILL BE REQUESTED TO INTERVENE
  192. * AND PASS A STATUS BACK TO THE REQUESTING JOB TO RESOLVE THIS
  193. * STALEMATE.
  194. #
  195.  
  196. CONTROL EJECT;
  197.  
  198. #
  199. * THE FOLLOWING ERRORS CAN OCCUR IN EACH OF THE STEPS USED TO STAGE
  200. * A FILE. THE NUMBER OF EACH PARAGRAPH CORRESPONDS TO THE NUMBER OF
  201. * THE PARAGRAPH IN THE PRECEEDING SECTION ON STAGING PROCESSING
  202. * FLOW.
  203. *
  204. * 1) THE *ASIGNPF* REQUEST CAN REPORT THAT NO DISK HAS ENOUGH
  205. * SPACE FOR THE SPECIFIED DIRECT ACCESS FILE. THIS IS AN
  206. * UNRESOLVED ERROR. THE OPERATOR WILL BE EXPECTED TO TAKE SOME
  207. * ACTION TO FREE DISK SPACE.
  208. *
  209. * 2) ACQ$*FCT* ERRORS: SEVERAL ERROR STATUS REPLIES ARE POSSIBLE
  210. * WHEN CALLING *ACQ$FCT* TO READ THE *FCT* ENTRY TO MEMORY. IF THE
  211. * SUBFAMILY CATALOG CANNOT BE FOUND, AN UNRESOLVABLE ERROR IS
  212. * DECLARED. THIS COULD OCCUR IF A REMOVABLE FAMILY WAS MOUNTED
  213. * AFTER THE *SSEXEC* WAS INITIALIZED. THE RESOLUTION IS FOR THE
  214. * OPERATOR TO RESTART *SSEXEC*. IF THE STORAGE MODULE OR *FCT*
  215. * ENTRY CANNOT BE LOCATED IN THE SUBFAMILY CATALOG, A PERMANENT
  216. * ERROR IS DECLARED WITH THE APPROPRIATE ERROR BIT SET IN THE
  217. * FILE'S *PFC* ENTRY. THIS COULD OCCUR IF THE FILE'S *PFC* ENTRY
  218. * HAD BEEN RELOADED FROM AN OBSOLETE DUMP TAPE. OPERATOR ACTION IS
  219. * ALSO REQUIRED TO RECOVER FROM AN READ/WRITE ERROR WHICH OCCURS
  220. * WHEN ACCESSING A SUBFAMILY CATALOG.
  221. *
  222. * CARTRIDGE LOAD ERRORS: UNRESOLVED LOAD ERRORS INCLUDE HAVING
  223. * THE HARDWARE DOWN SO THE STORAGE MODULE CAN NOT BE ACCESSED AND
  224. * THE CARTRIDGE BEING LOST ( NOT LOCATED IN ITS ASSIGNED CUBICLE).
  225. * IF A LABEL CHECK ERROR OCCURS WITH THE CARTRIDGE, A PERMANENT
  226. * ERROR IS DECLARED FOR THE FILE WHICH WAS TO BE STAGED.
  227. *
  228. * 3) IF *STAGER* DETERMINES THAT THE ALLOCATION UNITS OF THE NEXT
  229. * VOLUME TO BE STAGED ARE INVALID, IT DECLARES A PERMANENT ERROR.
  230. * IF *STAGER* OR *SSVAL* HAVE DETECTED NON-FATAL ERRORS WITH THE AU
  231. * OF THE VOLUME TO BE STAGED, AN INTERNAL FLAG IS SET WHICH WILL
  232. * CAUSE THE *ASA* VALUE IN THE FILE'S *PFC* ENTRY TO BE CLEARED
  233. * UPON SUCCESSFUL COMPLETION OF THE STAGE. THIS PREVENTS THE DISK
  234. * SPACE FROM BEING RELEASED WITHOUT FIRST MAKING A CLEAN COPY OF
  235. * THE FILE VIA ANOTHER DESTAGE.
  236. #
  237.  
  238. CONTROL EJECT;
  239.  
  240. #
  241. * 4) THE FOLLOWING UNRESOLVED ERRORS CAN OCCUR WHILE COPYING A
  242. * VOLUME OF DATA TO DISK - DISK WRITE ERROR, DISK FULL, HARDWARE
  243. * DOWN. IF AN UNRECOVERABLE READ ERROR IS DETECTED, THE STAGER
  244. * WILL RESTAGE THE FILE, FIRST UNLOADING THE CARTRIDGE SO IT WILL
  245. * HOPEFULLY BE RELOADED ON THE OTHER DATA RECORDING DEVICE. IF TWO
  246. * UNRECOVERABLE READ ERRORS ARE DETECTED, A PERMANENT ERROR STATUS
  247. * IS RECORDED IN THE FILE'S *PFC* ENTRY. ANOTHER TYPE OF PERMANENT
  248. * ERROR WILL BE REPORTED IF THE SYSTEM LINKAGE INFORMATION RECORDED
  249. * ON EACH VOLUME DOES NOT AGREE WITH WHAT IS EXPECTED. THIS
  250. * INFORMATION CONSISTS OF THE FILE'S USER INDEX, THE CREATION DATE
  251. * AND TIME, AND THE IDENTITY OF PREVIOUS VOLUME (CARTRIDGE, VOLUME
  252. * AND VOLUME LENGTH).
  253. *
  254. * 5) SEE STEPS 2-4 FOR ANY ERROR CONDITIONS.
  255. *
  256. * 6) A REQUEST TO RESTORE THE FILE'S DISK IMAGE CAN FAIL, BUT
  257. * THESE ERRORS ARE CONSIDERED TO BE RESOLVED SINCE THEY SHOULD ONLY
  258. * OCCUR IF THE USER DID SOMETHING TO THE FILE (PURGE OR REPLACE THE
  259. * DATA FOR AN INDIRECT ACCESS FILE).
  260. *
  261. * 7) AS IN STEP 6, A USER ACTION COULD CAUSE A RESOLVED ERROR TO
  262. * OCCUR WHILE *STAGER* IS CALLING *PFM* TO CLEAR THE FILE'S *ASA*
  263. * VALUE.
  264. *
  265. * 8) NO ERRORS CAN OCCUR IN THIS STEP.
  266. #
  267.  
  268. END # ST$$DOC #
  269.  
  270. TERM
  271. PROC STAGER((HLRQADR));
  272.  
  273. # TITLE STAGER - STAGE A FILE FROM CARTRIDGE TO DISK. #
  274.  
  275. BEGIN # STAGER #
  276.  
  277. #
  278. ** STAGER - STAGE A FILE.
  279. *
  280. * *STAGER* COPIES A FILE FROM THE M860 TO DISK. UPON COMPLETION OF
  281. * THE STAGE THE DISK ADDRESS OF THE LOCAL FILE IS ENTERED INTO
  282. * THE *PFC* ENTRY TO BIND THE DISK IMAGE TO THE ENTRY.
  283. * PERFORMANCE (TRACE) MESSAGES ARE WRITTEN TO THE ACCOUNT
  284. * DAYFILE IF EXEC IS IN TRACE MODE.
  285. *
  286. * PROC STAGER((HLRQADR))
  287. *
  288. * ENTRY (HLRQADR) - ADDRESS OF THE *HLRQ* ENTRY CONTAINING THE
  289. * STAGE REQUEST.
  290. * THE PROCESS STATE FIELD IN THE *HLRQ* ENTRY IS SET TO
  291. * INDICATE THE NEXT PROCESSING ACTION.
  292. *
  293. * EXIT THE PROCESS STATE FIELD IN THE *HLRQ* ENTRY HAS BEEN
  294. * ADVANCED TO INDICATE WHERE PROCESSING OF THIS REQUEST
  295. * LEFT OFF, AND THUS WHAT TO DO NEXT TO ADVANCE THE
  296. * REQUEST. UPON COMPLETION (SUCCESSFUL OR
  297. * OTHERWISE) OF A FILE STAGE, THE PROCEDURE
  298. * *NEXTSTG* IS CALLED TO OBTAIN THE *TDAM*
  299. * ENTRY FOR THE NEXT FILE TO BE STAGED.
  300. * THE OBJECTIVE IS TO FIND ANOTHER FILE ON THE
  301. * SAME CARTRIDGE TO REDUCE CARTRIDGE ACCESSES
  302. * AND IMPROVE STAGING PERFORMANCE. WHEN NO MORE
  303. * FILES REMAIN TO BE STAGED, *STAGER* IS CALLED
  304. * ONE MORE TIME TO UNLOAD THE LAST USED CARTRIDGE.
  305. * AT THAT TIME, THE PROCESS STATE IS SET TO COMPLETE.
  306. *
  307. * MESSAGES * EXEC ABNORMAL, STAGER.*
  308. *
  309. #
  310.  
  311. ITEM HLRQADR U; # *HLRQ* ENTRY ADDRESS #
  312.  
  313. #
  314. **** PROC STAGER - XREF LIST BEGIN.
  315. #
  316.  
  317. XREF
  318. BEGIN
  319. PROC ABORT; # ABORT #
  320. PROC ACQ$FCT; # ACQUIRE AN *FCT* ENTRY #
  321. PROC ADD$LNK; # ADD ENTRY TO CHAIN #
  322. PROC ASIGNPF; # ASSIGN PERMANENT FILE SPACE #
  323. PROC CFLUSH; # FLUSH MSF CATALOG BUFFER #
  324. PROC CKPFETC; # CHECK *PFM* FET COMPLETION #
  325. PROC CRDAST; # READ MSF CATALOG *AST* #
  326. PROC CWTAST; # WRITE MSF CATALOG *AST* #
  327. PROC DELAY; # TIMED DELAY #
  328. PROC EESET; # SET EVENT TABLE #
  329. PROC HLCPYCD; # CHECK COPY RETURN CODES #
  330. PROC HLLOAD; # CHECK LOAD RETURN CODES #
  331. PROC HLLDSET; # MOVE *HLRQ* INTO *LLRQ* #
  332. PROC UPUSAGE; # UPDATE CART. USAGE DATA #
  333. PROC MESSAGE; # ISSUE MESSAGE #
  334. PROC MSGAFDF; # ISSUE ACCOUNT-DAYFILE MESSAGE #
  335. PROC RECALL; # RELEASE CPU FOR A MOMENT #
  336. PROC REQWEST; # REQUEST EQUIPMENT ASSIGNMENT #
  337. PROC RETERN; # RETURN A FILE #
  338. PROC RLS$FCT; # RELEASE AN *FCT* ENTRY #
  339. PROC SETAF; # SET ALTERNATE STORAGE FLAG #
  340. PROC SETDA; # SET DISK ADDRESS #
  341. PROC STERCAT; # STAGE ERROR PROCESSOR #
  342. PROC STERPFM; # STAGE ERROR PROCESSOR #
  343. PROC STNTDAM; # GET NEXT FILE TO STAGE #
  344. PROC TELLSLV; # NOTIFY SLAVE #
  345. PROC UREPLAC; # UTILITY REPLACE #
  346. PROC ZSETFET; # INITIALIZE A FET #
  347. END
  348.  
  349. #
  350. **** PROC STAGER - XREF LIST END.
  351. #
  352.  
  353. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  354. *CALL,COMBFAS
  355. *CALL,COMBCHN
  356. *CALL,COMBCMD
  357. *CALL,COMBCMS
  358. *CALL,COMBCPR
  359. *CALL COMBLRQ
  360. *CALL,COMBKDD
  361. *CALL,COMBFET
  362. *CALL,COMBMCT
  363. *CALL,COMBPFP
  364. *CALL,COMBPFS
  365. *CALL,COMBTDM
  366. *CALL,COMXCTF
  367. *CALL,COMXEMC
  368. *CALL COMBUDT
  369. *CALL,COMXFCQ
  370. *CALL,COMXHLR
  371. *CALL,COMXIPR
  372. *CALL,COMXJCA
  373. *CALL COMXMFD
  374. *CALL,COMXMSC
  375. *CALL,COMSPFM
  376.  
  377. ITEM FCTQADDR U; # FCTQ ADDRESS #
  378. ITEM FLAG B; # FLAG #
  379. ITEM QADDR U; # *FCTQ* ENTRY ADDRESS #
  380. ITEM ACCL I; # ACCESS LEVEL #
  381. ITEM STAT I; # STATUS #
  382. ITEM DRDCOUNT U; # DRD COUNT #
  383. ITEM STDRDCT I; # DRD-S AVAILABLE FOR STAGING #
  384. ITEM FULL B; # DRD RESERVATION TAKEN #
  385. ITEM I I; # SM INDEX #
  386. ITEM J I; # SUBFAMILY INDEX #
  387. ITEM TFCT U; # ASAFCT #
  388. ITEM CURFCT U; # *FCT* OF A PARALLEL *HLRQ* #
  389. ITEM TTDAMSBF U; # SUBFAMILY NUMBER #
  390. ITEM TEMP I; # TEMPORARY #
  391. ITEM TFAM C(7); # TEMPORARY FAMILY #
  392. ITEM TMSG I; # TRACE MODE INDICATOR #
  393. ITEM PASS B; # TEMPORARY PASS FLAG #
  394. ITEM TEMP1 I; # TEMPORARY #
  395.  
  396. ARRAY SCR$FET [0:0] P(SFETL); ; # SCRATCH FET #
  397.  
  398. STATUS STLBL
  399. ST1A, # RETRY *ASIGNPF* CALL #
  400. ST2A, # RETRY *RLS$FCT* CALL #
  401. ST2B, # RETRY *CFLUSH* CALL #
  402. ST2C, # RE-ENTER AFTER "NORMAL" UNLOAD #
  403. ST2D, # RE-ENTER AFTER "FORCED" LOAD #
  404. ST2E, # RE-ENTER AFTER "FORCED" UNLOAD #
  405. ST3A, # RE-ENTRY IF NO *DRD* #
  406. ST3B, # RETRY *ACQ$FCT* CALL #
  407. ST3C, # RE-ENTRY AFTER CARTRIDGE LOAD #
  408. ST4A, # RE-ENTER AFTER *HLCPYCD* CALL #
  409. ST6A, # RETRY *SETDA* OR *UREPLAC* CALL
  410.   #
  411. ST6B, # *UREPLACE* COMPLETE #
  412. ST7A, # WAIT FOR K-DISPLAY REPLY #
  413. ST7B, # RETRY *SETAF* CALL #
  414. STEND; # END OF LIST #
  415.  
  416.  
  417. SWITCH STGENT:STLBL
  418. ST1A:ST1A,
  419. ST2A:ST2A,
  420. ST2B:ST2B,
  421. ST2C:ST2C,
  422. ST2D:ST2D,
  423. ST2E:ST2E,
  424. ST3A:ST3A,
  425. ST3B:ST3B,
  426. ST3C:ST3C,
  427. ST4A:ST4A,
  428. ST6A:ST6A,
  429. ST6B:ST6B,
  430. ST7A:ST7A,
  431. ST7B:ST7B;
  432.  
  433.  
  434. BASED
  435. ARRAY CLEAR [0:0] S(1);
  436. BEGIN
  437. ITEM CLN U(00,36,24); # CLEAR *DRD* ASSIGNMENTS #
  438. ITEM DRDADR U(00,42,18);
  439. END
  440.  
  441. CONTROL EJECT;
  442. P<HLRQ> = HLRQADR;
  443. P<TDAM> = LOC(HLR$TDAM[0]);
  444. P<FCT> = HLR$FCTQ[0] + FCTQHL;
  445.  
  446. GOTO STGENT[HLR$HPS[0]];
  447. CONTROL EJECT;
  448.  
  449. #
  450. * STEP 1 - SET UP TO STAGE THE NEXT FILE.
  451. * - ASSIGN STAGING DISK TO A DIRECT ACCESS FILE.
  452. * - INITIALIZE *HLRQ* FIELDS.
  453. #
  454.  
  455. ST1A: # TO RETRY *ASIGNPF* CALL #
  456. RETRYFILE: # IF UNRECOVERABLE READ ERRORS #
  457.  
  458. IF TDAMFC[0] NQ TDAMFCODE"NOREQ"
  459. THEN # A FILE IS TO BE STAGED #
  460. BEGIN # STEP 1 #
  461. HLR$RESP[0] = ERRST"NOERR";
  462. IF NOT TDAMIA[0]
  463. THEN # DIRECT ACCESS #
  464. BEGIN # ASSIGN STAGING DISK #
  465. NAMEC[0] = HLR$FLNM[0];
  466. NAMEC[1] = TDAMFAM[0];
  467. ACCL = TDAMAL[0];
  468. ASIGNPF(NAME[0],STAT,6,TDAMFLN[0], ##
  469.  
  470. TDAMUI[0],NAME[1],ACCL,LOC(PFMRET));
  471.  
  472. IF STAT EQ LNP
  473. THEN # LEVEL INVALID ON DEVICE #
  474. BEGIN
  475. HLR$RESP[0] = ERRST"PERM";
  476. HLR$PEF[0] = AFTMP;
  477. HLR$ERRC[0] = STGERRC"NOLVL";
  478. GOTO STGERR;
  479. END
  480.  
  481. IF STAT NQ OK
  482. THEN
  483. BEGIN
  484. STERPFM(HLRQADR,STAT);
  485. IF HLR$RESP[0] NQ ERRST"NOERR"
  486. THEN
  487. BEGIN
  488. HLR$HPS[0] = STLBL"ST1A";
  489. HLR$ERRC[0] = STGERRC"DSKFULL";
  490. GOTO STGERR;
  491. END
  492.  
  493. END
  494.  
  495. END # ASSIGN STAGING DISK #
  496.  
  497. #
  498. * INITIALIZE *HLRQ* FIELDS.
  499. #
  500.  
  501. P<ASA> = LOC(TDAMASA[0]);
  502. HLR$VOLAU[0] = ASAAU[0];
  503. HLR$FCTXN[0] = ASAFCT[0];
  504. HLR$SM[0] = ASASM[0];
  505.  
  506. HLR$PRU[0] = 0;
  507. HLR$VOLAUP[0] = 0;
  508. HLR$VOLLNP[0] = 0;
  509. HLR$CSNDP[0] = "";
  510. HLR$CCODP[0] = "";
  511.  
  512. HLR$FFF[0] = TDAMFFF[0];
  513. HLR$FVOL = TRUE;
  514. HLR$EOI[0] = FALSE;
  515. END # STEP 1 #
  516.  
  517. CONTROL EJECT;
  518.  
  519. #
  520. * STEP 2 - UNLOAD CARTRIDGE.
  521. * - USE *HLUNLD* TO DO THE UNLOAD.
  522. * IT UPDATES USAGE DATA IN THE *FCT* ENTRY.
  523. * - RELEASE THE *FCT* ENTRY.
  524. * - EXIT FROM STAGER IF NO MORE FILES REMAIN.
  525. #
  526.  
  527. UNLOAD: # TO RETRY READ ON OTHER *DRD* OR
  528.   ADVANCE TO NEXT CARTRIDGE #
  529.  
  530. IF HLR$UNLD[0] OR ##
  531. (HLR$FCTX[0] NQ 0 AND ##
  532. (HLR$FCTX[0] NQ HLR$FCTXN[0]))
  533. THEN # UNLOAD A CARTRIDGE #
  534. BEGIN # STEP 2 #
  535. IF HLR$FCTQ[0] NQ 0
  536. THEN
  537. BEGIN
  538. UPUSAGE(HLRQADR,HLR$FCTQ[0]);
  539. END
  540.  
  541. ST2A: # TO RETRY *RLS$FCT* CALL #
  542. IF HLR$FCTQ[0] NQ 0
  543. THEN
  544. BEGIN
  545. RLS$FCT(HLR$FCTQ[0],0,STAT);
  546.  
  547. IF STAT NQ CMASTAT"NOERR"
  548. THEN
  549. BEGIN
  550. HLR$HPS[0] = STLBL"ST2A";
  551. STERCAT(HLRQADR,STAT);
  552. GOTO STGERR;
  553. END
  554.  
  555. ST2B:
  556. CFLUSH(TDAMFAM[0],TDAMSBF[0],HLRQADR,STAT);
  557.  
  558. IF STAT NQ CMASTAT"NOERR"
  559. THEN
  560. BEGIN
  561. HLR$HPS[0] = STLBL"ST2B";
  562. STERCAT(HLRQADR,STAT);
  563. GOTO STGERR;
  564. END
  565.  
  566. END
  567.  
  568. HLR$FCTQ[0] = 0;
  569. HLR$FCTX[0] = 0;
  570.  
  571. IF HLR$HLRQW[0] NQ 0
  572. THEN # SWITCH CONTROL OF *DRD* TO WAITTING *HLRQ* #
  573. BEGIN
  574. TEMP = HLR$DRDRA[0];
  575. TEMP1 = HLR$LRQADR[0];
  576. P<HLRQ> = HLR$HLRQW[0];
  577. HLR$DRDRA[0] = TEMP;
  578. HLR$LRQADR[0] = TEMP1;
  579.  
  580. IF HLR$LRQADR[0] EQ 0
  581. THEN
  582. BEGIN # TELL NEXT HLRQ CARTRIDGE LOADED BAD #
  583. HLR$RESP[0] = ERRST"TEMP";
  584. END
  585.  
  586. P<HLRQ> = HLRQADR;
  587. ADD$LNK(HLR$HLRQW[0],LCHN"HL$READY",0);
  588. P<LLRQ> = HLR$LRQADR[0];
  589. LLR$UCPRA[0] = HLR$HLRQW[0]; #INSURE PPU POINTS TO NEW *HLRQ*#
  590. P<CLEAR> = HLR$DRDRA[0] ;
  591. DRDADR = HLR$HLRQW[0];
  592. HLR$HLRQW[0] = 0;
  593. HLR$DRDRA[0] = 0;
  594. HLR$LRQADR[0] = 0;
  595. END
  596.  
  597. IF HLR$LRQADR[0] NQ 0
  598. THEN
  599. BEGIN # PHYSICAL UNLOAD #
  600. P<LLRQ> = HLR$LRQADR[0];
  601. MSGAFDF("I","UL",0,HLRQADR);
  602. LLR$DR[0] = ERRST"NOERR";
  603. LLR$PRCNME[0] = REQTYP4"UNLD$CART";
  604. LLR$PRCST[0] = PROCST"INITIAL";
  605. HLR$HPS[0] = STLBL"ST2C";
  606. ADD$LNK(HLR$LRQADR[0],LCHN"LL$READY",0);
  607. RETURN;
  608.  
  609. ST2C: # RETURN FROM UNLOAD OF CARTRIDGE #
  610.  
  611. IF HLR$RESP[0] NQ RESPTYP4"OK4"
  612. THEN
  613. BEGIN
  614.  
  615. #
  616. * PROCESS UNLOAD CARTRIDGE ERROR AS FOLLOWS:
  617. * -DRIVER PLACED ORIGINAL CARTRIDGE IN OUTPUT STATION.
  618. * -ASSUME A SECOND CARTRIDGE WAS IN DESTINATION CELL.
  619. * -ATTEMPT TO MOVE THIS 2ND CARTRIDGE TO THE OUTPUT
  620. * STATION BY LOADING IT.
  621. * -IF THE LOAD SUCCEEDS, DO A SECOND UNLOAD BACK TO
  622. * THE ORIGINAL DESTINATION.
  623. #
  624.  
  625. HLLDSET((HLRQADR)); # SET UP SECOND LOAD #
  626. P<HLRQ> = HLRQADR;
  627. HLR$HPS[0] = STLBL"ST2D";
  628. RETURN;
  629.  
  630. ST2D: # RETURN FROM SECOND LOAD #
  631.  
  632. IF HLR$RESP[0] EQ RESPTYP4"OK4"
  633. THEN # UNLOAD 2ND CARTRIDGE #
  634. BEGIN
  635. LLR$PRCNME[0] = REQTYP4"UNLD$CART";
  636. LLR$PRCST[0] = PROCST"INITIAL";
  637. HLR$HPS[0] = STLBL"ST2E";
  638. ADD$LNK(HLR$LRQADR[0],LCHN"LL$READY",0);
  639. RETURN;
  640.  
  641. ST2E:
  642. END # UNLOAD OF 2ND REQUEST #
  643. END # LOAD OF 2ND REQUEST #
  644.  
  645.  
  646. HLR$RESP[0] = ERRST"NOERR";
  647. IF HLR$DRDRA[0] NQ 0
  648. THEN # DROP *DRD* RESERVATION #
  649. BEGIN
  650. P<CLEAR> = HLR$DRDRA[0];
  651. CLN = 0 ;
  652. HLR$DRDRA[0] = 0;
  653. END
  654. END # PHYSICAL UNLOAD #
  655.  
  656.  
  657. IF TDAMFC[0] EQ TDAMFCODE"NOREQ"
  658. THEN # NO MORE FILES TO STAGE #
  659. BEGIN
  660.  
  661. IF DSC$WRESRS NQ 0
  662. THEN # FORCE A DESTAGE RESTART #
  663. BEGIN
  664. DSC$WRESRS = 0;
  665. DSC$INIT = 1;
  666. END
  667.  
  668. SLOWFOR I=1 STEP 1 UNTIL MAXSMUNIT
  669. DO
  670. BEGIN # FIND *SM* #
  671. IF HLR$SM[0] EQ SM$ID[I]
  672. THEN
  673. BEGIN
  674. IF SM$DSRFW[I] NQ 0
  675. THEN
  676. BEGIN # DESTAGE WAITING *DRD* #
  677.  
  678. SLOWFOR J = 0 STEP 1 UNTIL MAXSF
  679. DO
  680. BEGIN # CHECK FOR DESTAGE WAITING #
  681.  
  682. IF B<J>SM$DSRFW0[I] NQ 0
  683. THEN
  684. BEGIN
  685. B<J>SM$DSRFW0[I] = 0;
  686. SCR$WTDRD[J] = FALSE;
  687. DSC$INIT = 1;
  688. GOTO FREE;
  689. END
  690. END # COMPLETED CHECK OF WAITING #
  691. END
  692. END
  693. END
  694.  
  695. FREE:
  696.  
  697. IF HLR$DRDRA[0] NQ 0
  698. THEN # DROP *DRD* RESERVATION #
  699. BEGIN
  700. P<CLEAR> = HLR$DRDRA[0];
  701. CLN = 0;
  702. END
  703.  
  704. HLR$HPS[0] = PROCST"COMPLETE";
  705. RETURN;
  706. END
  707.  
  708. IF HLR$PRU[0] NQ 0
  709. THEN # CONTINED AU FROM AN OTHER CARTRIDGE #
  710. BEGIN
  711. HLR$CSNTPS[0] = HLR$CSNTCU[0];
  712. END
  713.  
  714. END # STEP 2 #
  715.  
  716. CONTROL EJECT;
  717.  
  718. #
  719. * STEP 3 - LOAD NEXT CARTRIDGE, IF NEEDED.
  720. * - ACQUIRE *FCT* ENTRY FOR NEW CARTRIDGE.
  721. * - SET UP *HLRQ* FIELDS TO IDENTIFY CARTRIDGE.
  722. * - USE *HLLOAD* TO DO THE PHYSICAL LOAD.
  723. * - SET THE FREE FILE FLAG IN THE *HLRQ* IF ITS
  724. * SET IN THE *FCT*.
  725. #
  726.  
  727. ST3A: # TO RETRY CALL TO *ACQ$FCT* #
  728. SLOWFOR I=1 STEP 1 UNTIL MAXSMUNIT
  729. DO
  730. BEGIN # FIND *SM* #
  731. IF HLR$SM[0] EQ SM$ID[I]
  732. THEN
  733. BEGIN
  734. GOTO SMFOUND;
  735. END
  736. END
  737.  
  738. SMFOUND:
  739.  
  740. DRDCOUNT = 0;
  741. FULL = FALSE;
  742.  
  743. IF D0$ON[I]
  744. THEN
  745. BEGIN
  746. DRDCOUNT = 1;
  747. END
  748.  
  749. IF D1$ON[I]
  750. THEN
  751. BEGIN
  752. DRDCOUNT = DRDCOUNT + 1;
  753. END
  754.  
  755. IF SM$REQRES1[I] NQ 0
  756. AND SM$REQRES2[I] NQ 0
  757. THEN
  758. BEGIN
  759. FULL = TRUE;
  760. END
  761.  
  762. IF DRDCOUNT EQ 1
  763. THEN
  764. BEGIN
  765. IF (SM$REQRES1[I] NQ 0)
  766. OR (SM$REQRES2[I] NQ 0)
  767. THEN
  768. BEGIN
  769. FULL = TRUE;
  770. END
  771. END
  772.  
  773. HLR$HPS[0] = STLBL"ST3A";
  774.  
  775. IF HLR$DRDRA EQ 0
  776. THEN
  777. BEGIN
  778. TTDAMSBF = HLR$SBF[0];
  779. TFCT = HLR$FCTXN[0];
  780. TFAM = HLR$FAM[0];
  781.  
  782. IF NOT SM$LLRQ1[I]
  783. THEN
  784. BEGIN
  785.  
  786. IF SM$REQRES1[I] NQ 0
  787. AND SM$REQRES1[I] NQ HLRQADR
  788. THEN
  789. BEGIN
  790. P<HLRQ> = SM$REQRES1[I];
  791.  
  792. IF HLR$FCTX[0] NQ 0
  793. THEN
  794. BEGIN
  795. CURFCT = HLR$FCTX[0];
  796. END
  797. ELSE
  798. BEGIN
  799. CURFCT = HLR$ASAFCT[0];
  800. END
  801.  
  802.  
  803. IF (TFCT EQ CURFCT)
  804. AND (TTDAMSBF EQ HLR$SBF[0])
  805. AND (TFAM EQ HLR$FAM[0])
  806. THEN # REQUESTING CARTRIDGE MOUNTED #
  807. BEGIN
  808. NEXTHLRQ:
  809. IF HLR$HLRQW[0] EQ 0
  810. THEN
  811. BEGIN # END OF *HLRQ* WRITING CARTRIDGE #
  812. HLR$HLRQW[0] = HLRQADR;
  813. P<HLRQ> = HLRQADR;
  814. STG$MSK = 0;
  815. RETURN;
  816. END
  817. ELSE
  818. BEGIN # FIND END OF *HLRQ* WRITING #
  819. P<HLRQ> = HLR$HLRQW[0];
  820. GOTO NEXTHLRQ;
  821. END
  822. END
  823. END
  824. END # SM$LLRQ1 CHECK #
  825.  
  826. IF NOT SM$LLRQ2[I]
  827. THEN
  828. BEGIN
  829.  
  830. IF SM$REQRES2[I] NQ 0
  831. AND SM$REQRES2[I] NQ HLRQADR
  832. THEN
  833. BEGIN
  834. P<HLRQ> = SM$REQRES2[I];
  835.  
  836. IF HLR$FCTX[0] NQ 0
  837. THEN
  838. BEGIN
  839. CURFCT = HLR$FCTX[0];
  840. END
  841. ELSE
  842. BEGIN
  843. CURFCT = HLR$ASAFCT[0];
  844. END
  845.  
  846.  
  847. IF (TFCT EQ CURFCT)
  848. AND (TTDAMSBF EQ HLR$SBF[0])
  849. AND (TFAM EQ HLR$FAM[0])
  850. THEN # REQUESTING CARTRIDGE MOUNTED #
  851. BEGIN
  852. NEXTHLRQ1:
  853. IF HLR$HLRQW[0] EQ 0
  854. THEN
  855. BEGIN # END OF *HLRQ* WRITING CARTRIDGE #
  856. HLR$HLRQW[0] = HLRQADR;
  857. P<HLRQ> = HLRQADR;
  858. STG$MSK = 0;
  859. RETURN;
  860. END
  861. ELSE
  862. BEGIN # FIND END OF *HLRQ* WRITING #
  863. P<HLRQ> = HLR$HLRQW[0];
  864. GOTO NEXTHLRQ1;
  865. END
  866. END
  867. END
  868. END # SM$LLRQ2 CHECK #
  869.  
  870. P<HLRQ> = HLRQADR;
  871.  
  872. FCTQADDR = CHN$BOC[LCHN"FCT$FRSPC"];
  873. IF FULL
  874. OR (FCTQADDR EQ 0)
  875. THEN
  876. BEGIN
  877. ADD$LNK(HLRQADR,LCHN"HL$DRDRESW",0);
  878. RETURN;
  879. END
  880.  
  881. ELSE
  882. BEGIN
  883. IF SM$REQRES1[I] EQ 0
  884. THEN
  885. BEGIN
  886. SM$REQRES1[I] = HLRQADR;
  887. HLR$DRDRA[0] = LOC(SM$REQRES1[I]);
  888. END
  889.  
  890. ELSE
  891. BEGIN
  892. SM$REQRES2[I] = HLRQADR;
  893. HLR$DRDRA[0] = LOC(SM$REQRES2[I]);
  894. END
  895. END # RESERVE OF *DRD* #
  896. END # DRD RESERVE #
  897.  
  898. ST3B: # TO RETRY CALL TO *ACQ$FCT* #
  899. IF HLR$FCTQ[0] EQ 0
  900. THEN
  901. BEGIN # STEP 3 #
  902. HLR$FCTX[0] = HLR$FCTXN[0];
  903. ACQ$FCT(TDAMFAM[0],TDAMSBF[0],HLR$SM[0],HLR$FCTX[0], ##
  904. QADDR,HLRQADR,STAT);
  905.  
  906. IF STAT NQ CMASTAT"NOERR"
  907. THEN
  908. BEGIN
  909. STERCAT(HLRQADR,STAT);
  910. HLR$HPS[0] = STLBL"ST3B"; # IF WAIT FOR INTERLOCK #
  911. IF HLR$RESP[0] EQ ERRST"WAIT"
  912. THEN
  913. BEGIN
  914. RETURN;
  915. END
  916. ELSE
  917. BEGIN
  918. GOTO STGERR;
  919. END
  920. END
  921.  
  922. #
  923.   REM - CHANGE STERCAT TO REPLY "TEMPERR" NOT ABANDON.
  924. #
  925.  
  926. #
  927. * UPDATE *HLRQ* TO REFLECT THIS CARTRIDGE.
  928. #
  929.  
  930. HLR$FCTQ[0] = QADDR;
  931. P<FCT> = QADDR + FCTQHL;
  932.  
  933. #
  934. * CHECK FOR ZERO *FCT* ENTRY.
  935. #
  936.  
  937. IF FCT$CSND[0] EQ ""
  938. OR FCT$1ST[0] EQ 0
  939. THEN
  940. BEGIN
  941. STAT = CMASTAT"NOSUBCAT";
  942. STERCAT(HLRQADR,STAT);
  943. GOTO STGERR;
  944. END
  945.  
  946. HLR$Y[0] = FCT$Y[0];
  947. HLR$Z[0] = FCT$Z[0];
  948. HLR$CSND[0] = FCT$CSND[0];
  949. HLR$CCOD[0] = FCT$CCOD[0];
  950.  
  951. #
  952. * LOAD CARTRIDGE USING *HLLOAD*.
  953. #
  954.  
  955. HLR$HPS[0] = STLBL"ST3C";
  956.  
  957. IF HLR$LRQADR[0] EQ 0
  958. THEN
  959. BEGIN
  960. HLLDSET((HLRQADR)); # MOVE *HLRQ* DATA TO *LLRQ* #
  961. MSGAFDF("I","LD",0,HLRQADR);
  962. RETURN; # WAIT LOAD OF CARTRIDGE #
  963.  
  964. ST3C: # RETURN FROM DRIVER LOAD #
  965.  
  966. HLLOAD((HLRQADR)); # CHECK RETURN CODES #
  967. P<HLRQ> = HLRQADR;
  968. P<FCT> = HLR$FCTQ[0] + FCTQHL;
  969. END
  970.  
  971. IF HLR$RESP[0] NQ ERRST"NOERR"
  972. THEN
  973. BEGIN
  974. HLR$FCTX[0] = 0;
  975. IF HLR$RESP[0] EQ ERRST"RETRY"
  976. THEN
  977. BEGIN
  978.  
  979. IF HLR$FCTQ[0] NQ 0
  980. THEN
  981. BEGIN # RELEASE *FCT* TABLE #
  982. RLS$FCT(HLR$FCTQ[0],0,STAT);
  983. HLR$FCTQ[0] = 0;
  984. END
  985.  
  986. GOTO RETRYFILE;
  987. END
  988.  
  989. ELSE
  990. BEGIN
  991. GOTO STGERR;
  992. END
  993.  
  994. END
  995.  
  996. END # STEP 3 #
  997.  
  998. CONTROL EJECT;
  999.  
  1000. #
  1001. * STEP 4 - COPY THE NEXT VOLUME OF DATA TO DISK.
  1002. * - ISSUE ACCOUNT-DAYFILE MESSAGE, IF FIRST VOLUME.
  1003. * - VERIFY CHAIN CONTROL VALUES ARE CONSISTENT WITH
  1004. * WITH FIRST VOLUME STATUS.
  1005. * - SET FREE FILE FLAG IF AU CONFLICT FLAG IS SET.
  1006. * - USE *HLCPYCD* TO DO THE I/O.
  1007. * - IF A READ ERROR OCCURS, TRY AGAIN ON OTHER *DRD*.
  1008. #
  1009.  
  1010. HLR$FFF[0] = HLR$FFF[0] OR FCT$FCF[0];
  1011.  
  1012. IF HLR$FVOL[0]
  1013. THEN
  1014. BEGIN
  1015. MSGAFDF("B","BS",0,HLRQADR); # INDICATE START OF STAGE #
  1016. END
  1017.  
  1018.  
  1019. NEXTVOL: # USED TO COPY NEXT VOLUME FROM
  1020.   SAME CARTRIDGE #
  1021.  
  1022. #
  1023. * VERIFY THE AU TO BE READ ARE VALID.
  1024. #
  1025.  
  1026. TEMP = HLR$VOLAU[0];
  1027. SETFCTX(TEMP);
  1028. HLR$VOLLN[0] = FCT$LEN(FWD,FPS) + 1;
  1029. TEMP1 = FCT$FLGS1(FWD,FPS);
  1030.  
  1031. IF (TEMP LS 1) ##
  1032. OR (TEMP1 EQ 0) # NOT ALLOCATED #
  1033. OR (TEMP+HLR$VOLLN[0]-1 GR FCT$AVOT[0])
  1034. THEN # AU ARE OUT OF RANGE #
  1035. BEGIN
  1036. HLR$RESP[0] = ERRST"PERM";
  1037. HLR$PEF[0] = AFPSE;
  1038. HLR$ERRC[0] = STGERRC"AURNG";
  1039. GOTO STGERR;
  1040. END
  1041.  
  1042.  
  1043. TEMP = FCT$CC(FWD,FPS);
  1044. FLAG = (TEMP EQ CHAINCON"FIRST") ##
  1045. OR (TEMP EQ CHAINCON"ONLY");
  1046.  
  1047. IF ( (NOT FLAG) AND HLR$FVOL[0] ) ##
  1048. OR ( (NOT HLR$FVOL[0]) AND FLAG) ##
  1049. OR (FCT$CAUF(FWD,FPS) EQ 1)
  1050. THEN # THEY ARE NOT CONSISTENT #
  1051. BEGIN
  1052. FCT$AUCF(FWD,FPS) = 1;
  1053. END
  1054.  
  1055. #
  1056. * SET FREE FILE FLAG IF AU CONFLICT OR FROZEN CHAIN FLAGS ARE SET.
  1057. #
  1058.  
  1059. IF ( FCT$AUCF(FWD,FPS) + FCT$FRCF(FWD,FPS) ) NQ 0
  1060. THEN
  1061. BEGIN
  1062. HLR$FFF[0] = TRUE;
  1063. END
  1064.  
  1065. HLR$HPS[0] = STLBL"ST4A";
  1066. P<LLRQ> = HLR$LRQADR[0];
  1067. LLR$PRCNME[0] = REQTYP4"CPY$AD";
  1068. LLR$PRCST[0] = PROCST"INITIAL";
  1069. LLR$DR[0] = 0;
  1070. ADD$LNK(HLR$LRQADR[0],LCHN"LL$READY",0);
  1071. RETURN; # START COPY #
  1072.  
  1073. ST4A: # RE-ENTER AFTER COPY COMPLETE #
  1074.  
  1075. HLCPYCD((HLRQADR)); # CHECK RETURN CODES #
  1076. P<HLRQ> = HLRQADR;
  1077. P<FCT> = HLR$FCTQ + FCTQHL;
  1078. IF HLR$RESP EQ ERRST"RETRY"
  1079. THEN
  1080. BEGIN
  1081. HLR$RESP[0] = ERRST"NOERR";
  1082. HLR$UNLD[0] = TRUE;
  1083. GOTO RETRYFILE;
  1084. END
  1085.  
  1086. IF HLR$RESP[0] NQ ERRST"NOERR"
  1087. THEN
  1088. BEGIN
  1089. GOTO STGERR;
  1090. END
  1091.  
  1092. HLR$FVOL[0] = FALSE;
  1093.  
  1094. #
  1095. * STEP 4 - END.
  1096. #
  1097.  
  1098. CONTROL EJECT;
  1099.  
  1100. #
  1101. * STEP 5 - FINISH COPYING FILE TO DISK.
  1102. * - ALL DONE IF CHAIN CONTROL = ONLY OR LAST.
  1103. * - PREPARE TO DO NEXT VOLUME.
  1104. * - REPEAT STEP 4, COPY VOLUME, IF NO OVERFLOW.
  1105. * - REPEAT STEPS 2-4, IF OVERFLOW.
  1106. #
  1107.  
  1108. IF HLR$RESP[0] EQ ERRST"NOERR" ##
  1109. AND NOT HLR$EOI[0]
  1110. THEN # COPY NEXT VOLUME #
  1111. BEGIN # STEP 5 #
  1112. SETFCTX(HLR$VOLAU[0]);
  1113.  
  1114. HLR$VOLAUP[0] = HLR$VOLAU[0];
  1115. HLR$VOLLNP[0] = HLR$VOLLN[0];
  1116.  
  1117. HLR$VOLAU[0] = FCT$LINK(FWD,FPS);
  1118. TEMP = FCT$CLKOCL(FWD,FPS);
  1119.  
  1120. IF TEMP EQ 0
  1121. THEN # NO OVERFLOW #
  1122. BEGIN
  1123. GOTO NEXTVOL;
  1124. END
  1125.  
  1126. TEMP = FCT$OCLNK(TEMP);
  1127. HLR$FCTXN[0] = (HLR$FCTX[0]/MAXGRT)*MAXGRT + TEMP;
  1128. GOTO UNLOAD;
  1129.  
  1130. END # STEP 5 #
  1131.  
  1132. CONTROL EJECT;
  1133.  
  1134. #
  1135. * STEP 6 - RESTORE DISK IMAGE.
  1136. * - VERIFY FILE LENGTH IS OK.
  1137. * - IF NO ERRRORS, USE *SETDA* OR *UREPLAC* TO
  1138. * UPDATE THE *PFC* ENTRY FOR THIS FILE
  1139. * TO INDICATE THE STAGE WAS SUCCESSFUL.
  1140. * - IF THE FREE FILE FLAG IS SET, USE *SETAF* (*AFOBS* )
  1141. * TO CLEAR THE *ASA* VALUE FOR THE FILE.
  1142. #
  1143.  
  1144. TEMP = TDAMFLN[0] - HLR$PRU[0];
  1145. IF NOT TDAMIA[0]
  1146. THEN
  1147. BEGIN
  1148. TEMP = TEMP - 1;
  1149. END
  1150.  
  1151. IF TDAMFLN[0] EQ 1 ##
  1152. AND TDAMAFVER[0]
  1153. THEN
  1154. BEGIN # FILE RETURNED BY PFDUMP #
  1155. TEMP = 0;
  1156. END
  1157.  
  1158. IF TEMP NQ 0
  1159. THEN # FILE LENGTH ERROR #
  1160. BEGIN
  1161. HLR$RESP[0] = ERRST"PERM";
  1162. HLR$PEF[0] = AFPSE;
  1163. HLR$ERRC[0] = STGERRC"LENERR";
  1164. END
  1165.  
  1166.  
  1167. ST6A: # TO RETRY CALL TO *SETDA* OR
  1168.   *UREPLAC* #
  1169. IF HLR$RESP[0] EQ ERRST"NOERR"
  1170. THEN # FILE AT EOI #
  1171. BEGIN # STEP 6 #
  1172. NAMEC[0] = HLR$FLNM[0];
  1173. NAMEC[1] = TDAMFAM[0];
  1174. NAMEC[2] = TDAMPFN[0];
  1175.  
  1176. IF NOT TDAMIA[0]
  1177. THEN # DIRECT ACCESS FILE #
  1178. BEGIN
  1179. SETDA(NAME[0],PFMSTAT,6,TDAMUI[0],NAME[1], ##
  1180. TDAMPFID[0],TDAMASI[0],TDAMCDT[0],LOC(PFMRET));
  1181. END
  1182.  
  1183. ELSE # INDIRECT ACCESS FILE #
  1184. BEGIN
  1185. ZSETFET(LOC(SCR$FET[0]),NAMEC[0],0,0,SFETL);
  1186. FET$DT[0] = "MS";
  1187. FET$SP[0] = TRUE;
  1188. FET$AL[0] = TDAMAL[0];
  1189. FET$EP[0] = TRUE;
  1190. FET$UP[0] = TRUE;
  1191. FET$LFN[0] = NAMEC[0];
  1192. REQWEST(FETSET[0],TMSG); # REQUEST EQUIPMENT #
  1193. IF FET$AT[0] EQ LNV # LEVEL NOT VALID #
  1194. OR FET$AT[0] EQ WEQ # EQUIPMENT UNAVAILABLE #
  1195. THEN
  1196. BEGIN
  1197. HLR$RESP[0] = ERRST"PERM";
  1198. HLR$PEF[0] = AFTMP;
  1199. HLR$ERRC[0] = STGERRC"NOLVL";
  1200. GOTO STGERR;
  1201. END
  1202.  
  1203. UREPLAC(NAME[0],PFMSTAT,6,NAME[2],TDAMUI[0], ##
  1204. NAME[1],TDAMPFID[0],TDAMASI[0],TDAMCDT[0],LOC(PFMRET));
  1205.  
  1206. PFMSTAT = -1;
  1207. HLR$HPS[0] = STLBL"ST6B"; # RETURN *UREPLACE* COMPLETE #
  1208. GLPFMFL = TRUE;
  1209. ADD$LNK(HLRQADR,LCHN"HL$PFMWAIT",0);
  1210. RETURN;
  1211.  
  1212.  
  1213. END
  1214.  
  1215. ST6B:
  1216. IF PFMSTAT NQ 0
  1217. THEN
  1218. BEGIN
  1219. HLR$HPS[0] = STLBL"ST6A"; # IF WAIT FOR INTERLOCK #
  1220. HLR$ERRC[0] = STGERRC"RESTORE";
  1221. STERPFM(HLRQADR,PFMSTAT);
  1222. END
  1223.  
  1224. IF HLR$RESP[0] EQ ERRST"NOERR" ##
  1225. AND HLR$FFF[0]
  1226. THEN
  1227. BEGIN
  1228.  
  1229. #
  1230. * USE THE PERMANENT ERROR STATUS TO CLEAR THE *ASA* FIELD
  1231. * BY "SETTING" THE *AFOBS* FLAG.
  1232. #
  1233.  
  1234. HLR$RESP[0] = ERRST"PERM";
  1235. HLR$PEF[0] = AFOBS;
  1236. HLR$ERRC[0] = STGERRC"CLRASA";
  1237. PASS = TRUE; # CLEAR LOCATION *HLR$ERRC* AFTER MESSAGE #
  1238. END
  1239.  
  1240. END # STEP 6 #
  1241.  
  1242. CONTROL EJECT;
  1243.  
  1244. #
  1245. * STEP 7 - PROCESS ERRORS.
  1246. * - IF K-DISPLAY MESSAGE OUTSTANDING, WAIT FOR IT.
  1247. * - IF NEED TO WAIT FOR INTERLOCK, RETURN.
  1248. * - IF PERMANENT ERROR, DO XX.
  1249. #
  1250.  
  1251. STGERR: # ENTRY VIA *GOTO STGERR*
  1252.   STATEMENTS #
  1253.  
  1254. IF HLR$RESP[0] EQ ERRST"WAIT"
  1255. THEN
  1256. BEGIN
  1257. HLR$RESP[0] = ERRST"NOERR";
  1258. DELAY(PFM$INTV,HLRQADR,HLRQIND);
  1259. RETURN;
  1260. END
  1261.  
  1262. IF HLR$RESP[0] EQ ERRST"NOERR"
  1263. THEN
  1264. BEGIN
  1265. HLR$ERRC[0] = STGERRC"NOERR";
  1266. END
  1267.  
  1268. STGCNT = STGCNT + 1;
  1269. MSGAFDF("E","ES",HLR$ERRC[0],HLRQADR);
  1270.  
  1271. IF PASS
  1272. THEN # FREE FLAG SET - CLEAR *HLR$ERRC*#
  1273. BEGIN
  1274. HLR$ERRC[0] = 0;
  1275. END
  1276.  
  1277. ST7A: # ENTRY IF WAITING FOR K-DISPLAY
  1278.   TO BE COMPLETE #
  1279. IF HLR$RESP[0] NQ ERRST"NOERR"
  1280. THEN
  1281. BEGIN # STEP 7 #
  1282. P<KWORD> = LOC(HLR$KREQ[0]);
  1283. IF (KW$WORD[0] NQ 0) AND NOT KW$COMP[0]
  1284. THEN
  1285. BEGIN
  1286. DELAY(KDIS$INTV,HLRQADR,HLRQIND);
  1287. HLR$HPS[0] = STLBL"ST7A";
  1288. RETURN;
  1289. END
  1290.  
  1291. IF HLR$RESP[0] EQ ERRST"PERM"
  1292. THEN # SET FLAG FROM *HLR$PEF* IN *PFC*
  1293.   ENTRY #
  1294. BEGIN
  1295. ST7B: # TO RETRY *SETAF* CALL #
  1296. NAMEC[0] = HLR$FLNM[0];
  1297. NAMEC[1] = TDAMFAM[0];
  1298. SETAF(NAME[0],STAT,6,TDAMUI[0],NAME[1], ##
  1299. TDAMPFID[0],TDAMASI[0],TDAMCDT[0],HLR$PEF[0],LOC(PFMRET));
  1300.  
  1301. IF STAT NQ 0
  1302. THEN
  1303. BEGIN
  1304. STERPFM(HLRQADR,STAT);
  1305. IF HLR$RESP[0] EQ ERRST"WAIT"
  1306. THEN
  1307. BEGIN
  1308. HLR$HPS[0] = STLBL"ST7B";
  1309. DELAY(PFM$INTV,HLRQADR,HLRQIND);
  1310. RETURN;
  1311. END
  1312.  
  1313. ELSE
  1314. BEGIN
  1315. HLR$ERRC[0] = STGERRC"SETAF";
  1316. MSGAFDF("E","ES",HLR$ERRC[0],HLRQADR);
  1317. END
  1318.  
  1319. END
  1320.  
  1321. HLR$RESP[0] = ERRST"PERM";
  1322. END
  1323.  
  1324. END # STEP 7 #
  1325.  
  1326. CONTROL EJECT;
  1327.  
  1328. #
  1329. * STEP 8 - COMPLETE STAGING PROCESS.
  1330. * - RETURN STAGING FILE.
  1331. * - NOTIFY REQUESTOR.
  1332. * - GET NEXT STAGING REQUEST, IF ANY, AND RETURN
  1333. * TO *HLRQMTR*.
  1334. #
  1335.  
  1336. ZSETFET(LOC(SCR$FET[0]),HLR$FLNM[0],0,0,SFETL);
  1337. RETERN(SCR$FET[0],RCL);
  1338.  
  1339. IF HLR$RESP[0] EQ ERRST"NOERR" ##
  1340. OR HLR$RESP[0] EQ ERRST"PERM"
  1341. THEN # *PFC* WAS UPDATED TO SHOW STATUS
  1342.   #
  1343. BEGIN
  1344. TEMP = 0;
  1345. END
  1346.  
  1347. ELSE # *PFC* NOT UPDATED, *PFM* WILL
  1348.   KEEP ISSUING *TDAM*S #
  1349. BEGIN
  1350. TEMP = 1;
  1351. END
  1352.  
  1353. IF TDAMOSLV[0]
  1354. THEN
  1355. BEGIN
  1356. TELLSLV(TDAMSSN[0],TEMP);
  1357. END
  1358.  
  1359. IF TDAMOMAST[0] ##
  1360. AND TDAMEVENT[0] NQ 0 ##
  1361. AND TEMP EQ 0
  1362. THEN
  1363. BEGIN
  1364. EESET(TDAMEVENT[0]);
  1365. END
  1366.  
  1367. STNTDAM(HLRQADR);
  1368. RETURN;
  1369.  
  1370. #
  1371. * END OF STEP 8.
  1372. #
  1373.  
  1374. END # STAGER #
  1375.  
  1376. TERM
  1377. PROC STERCAT((HLRQADR),(ERRSTAT));
  1378.  
  1379. # TITLE STERCAT - PROCESS STAGE CATALOG ACCESS ERRORS. #
  1380.  
  1381. BEGIN # STERCAT #
  1382.  
  1383. #
  1384. ** STERCAT - PROCESS STAGE CATALOG ACCESS ERRORS.
  1385. *
  1386. * *STERCAT* PROCESSES ERROR RESPONSES RETURNED TO *STAGER* FROM A
  1387. * CATALOG ACCESS REQUEST AND RETURNS A STATUS IN THE *HLRQ*
  1388. * ENTRY OF THE STAGE REQUEST.
  1389. *
  1390. * PROC STERCAT((HLRQADR),(ERRSTAT))
  1391. *
  1392. * ENTRY (HLRQADR) - ADDRESS OF *HLRQ* FOR THE STAGE REQUEST.
  1393. * (ERRSTAT) - CATALOG ACCESS ERROR CODE.
  1394. *
  1395. * EXIT (HLR$RESP[0]) - ERROR STATE.
  1396. * (VALUES DEFINED IN *COMEMSC*).
  1397. * = ERRST"WAIT".
  1398. * = ERRST"ABANDON".
  1399. #
  1400.  
  1401. ITEM HLRQADR U; # *HLRQ* ENTRY ADDRESS #
  1402. ITEM ERRSTAT I; # CATALOG ACCESS ERROR CODE #
  1403.  
  1404. #
  1405. **** PROC STERCAT - XREF LIST BEGIN.
  1406. #
  1407.  
  1408. XREF
  1409. BEGIN
  1410. PROC ABORT; # ABORT #
  1411. PROC MESSAGE; # ISSUE MESSAGE #
  1412. END
  1413.  
  1414. #
  1415. **** PROC STERCAT - XREF LIST END.
  1416. #
  1417.  
  1418. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  1419. *CALL,COMBFAS
  1420. *CALL,COMBCMS
  1421. *CALL COMSPFM
  1422. *CALL,COMXEMC
  1423. *CALL,COMXHLR
  1424. *CALL,COMXMSC
  1425.  
  1426. CONTROL EJECT;
  1427.  
  1428. P<HLRQ> = HLRQADR;
  1429.  
  1430. IF ERRSTAT EQ CMASTAT"INTLK"
  1431. THEN # MSF CATALOG INTERLOCKED #
  1432. BEGIN
  1433. HLR$RESP[0] = ERRST"WAIT";
  1434. RETURN;
  1435. END
  1436.  
  1437. IF ERRSTAT EQ CMASTAT"NOTOPEN" ##
  1438. THEN # MSF CATALOG NOT ONLINE #
  1439. BEGIN
  1440. HLR$RESP[0] = ERRST"ABANDON";
  1441. HLR$ERRC[0] = STGERRC"CATOFFLN";
  1442. RETURN;
  1443. END
  1444.  
  1445. IF ERRSTAT EQ CMASTAT"CIOERR" ##
  1446. THEN # MSF CATALOG NOT ONLINE #
  1447. BEGIN
  1448. HLR$RESP[0] = ERRST"ABANDON";
  1449. HLR$ERRC[0] = STGERRC"CATIOER";
  1450. RETURN;
  1451. END
  1452.  
  1453. IF ERRSTAT EQ CMASTAT"NOSUBCAT" ##
  1454. OR ERRSTAT EQ CMASTAT"ORDERR"
  1455. THEN # OBSOLETE MSF CATALOG ONLINE #
  1456. BEGIN
  1457. HLR$RESP[0] = ERRST"PERM";
  1458. HLR$ERRC[0] = STGERRC"PFCOBS";
  1459. HLR$PEF[0] = AFPSE;
  1460. RETURN;
  1461. END
  1462.  
  1463. FE$RTN[0] = "STERCAT.";
  1464. MESSAGE(FEMSG,UDFL1);
  1465. ABORT;
  1466. END # STERCAT #
  1467.  
  1468. TERM
  1469. PROC STERPFM((HLRQADR),(ERRSTAT));
  1470.  
  1471. # TITLE STERPFM - PROCESS STAGE *PFM* ERRORS. #
  1472.  
  1473. BEGIN # STERPFM #
  1474.  
  1475. #
  1476. ** STERPFM - PROCESS STAGE *PFM* ERRORS.
  1477. *
  1478. * *STERPFM* PROCESSES ERROR RESPONSES RETURNED TO CALLERS FROM A
  1479. * *PFM* REQUEST AND RETURNS A STATUS IN THE *HLRQ* ENTRY OF THE
  1480. * STAGE REQUEST.
  1481. *
  1482. * PROC STERPFM((HLRQADR),(ERRSTAT))
  1483. *
  1484. * ENTRY (HLRQADR) - ADDRESS OF *HLRQ* FOR THE STAGE REQUEST.
  1485. * (ERRSTAT) - *PFM* ERROR CODE.
  1486. *
  1487. * EXIT (HLR$RESP[0]) - ERROR STATE.
  1488. * (VALUES DEFINED IN *COMEMSC*).
  1489. * = ERRST"NOERR".
  1490. * = ERRST"WAIT".
  1491. * = ERRST"ABANDON".
  1492. * IF THE ERROR STATE INDICATES A DELAY CONDITION
  1493. * (*ERRST"WAIT"*) THEN THE STAGE REQUEST HAS BEEN ADDED
  1494. * TO THE *HLRQ* DELAY CHAIN AND WILL BE PUT BACK ON THE
  1495. * *HLRQ* READY CHAIN AFTER A DELAY TIME HAS EXPIRED.
  1496. * PROCESSING WILL CONTINUE IN THE ROUTINE INDICATED
  1497. * BY *HLR$PN[0]* AND AT THE PROCESS STATE *HLR$PS[0]*.
  1498. #
  1499.  
  1500. ITEM HLRQADR U; # *HLRQ* ENTRY ADDRESS #
  1501. ITEM ERRSTAT I; # *PFM* ERROR CODE #
  1502.  
  1503. #
  1504. **** PROC STERPFM - XREF LIST BEGIN.
  1505. #
  1506.  
  1507. XREF
  1508. BEGIN
  1509. PROC ABORT; # ABORT #
  1510. PROC MESSAGE; # ISSUE MESSAGE #
  1511. PROC PFMEC; # CONVERT *PFM* ERROR RESPONSE #
  1512. END
  1513.  
  1514. #
  1515. **** PROC STERPFM - XREF - XREF LIST END.
  1516. #
  1517.  
  1518. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  1519. *CALL,COMBFAS
  1520. *CALL COMXEMC
  1521. *CALL,COMXHLR
  1522. *CALL,COMXIPR
  1523. *CALL,COMXMSC
  1524. *CALL,COMSPFM
  1525.  
  1526. ITEM ACTION I; # ERROR PROCESSING ACTION #
  1527.  
  1528. SWITCH SPFMER:ERRST # *PFM* ERROR STATES #
  1529. SPNOERR:NOERR, # NO ERROR #
  1530. SPDELAY:WAIT, # DELAY CONDITION #
  1531. SPFATAL:FATAL, # FATAL ERROR #
  1532. SPFATAL:RESTART, # RESPONSE INVALID FROM *PFMEC* #
  1533. SPFATAL:PERM, # RESPONSE INVALID FROM *PFMEC* #
  1534. SPABAN:ABANDON, # ABANDON CONDITION #
  1535. SPSPEC:SPECIAL; # SPECIAL CONDITION #
  1536. CONTROL EJECT;
  1537.  
  1538. P<HLRQ> = HLRQADR;
  1539.  
  1540. PFMEC(ERRSTAT,ACTION);
  1541. GOTO SPFMER[ACTION];
  1542.  
  1543. SPNOERR: # NO ERROR #
  1544. HLR$RESP[0] = ACTION;
  1545. RETURN;
  1546.  
  1547. SPABAN: # ABANDON STAGE REQUEST #
  1548. IF ERRSTAT EQ FBS OR ERRSTAT EQ FDA OR ERRSTAT EQ FIA
  1549. THEN # RESPONSES INVALID FOR STAGE #
  1550. BEGIN
  1551. GOTO SPFATAL;
  1552. END
  1553.  
  1554. HLR$RESP[0] = ACTION;
  1555. RETURN;
  1556.  
  1557. SPDELAY: # DELAY STAGE REQUEST #
  1558. HLR$RESP[0] = ACTION;
  1559. RETURN;
  1560.  
  1561. SPSPEC: # SPECIAL PROCESSING #
  1562. HLR$RESP[0] = ERRST"ABANDON";
  1563. HLR$ERRC[0] = STGERRC"DSKFULL";
  1564. RETURN;
  1565.  
  1566. SPFATAL: # FATAL STAGE ERROR #
  1567. FE$RTN[0] = "STERPFM.";
  1568. MESSAGE(FEMSG,UDFL1);
  1569. ABORT;
  1570.  
  1571. END # STERPFM #
  1572.  
  1573. TERM
  1574. PROC STNTDAM((HLRQADR));
  1575.  
  1576. # TITLE STNTDAM - GET NEXT STAGING REQUEST #
  1577.  
  1578. BEGIN # STNTDAM #
  1579.  
  1580. #
  1581. ** STNTDAM - GET NEXT STAGING REQUEST.
  1582. *
  1583. * THIS PROCEDURE SCANS THE *RTRQ* TO LOCATE A FILE STAGE
  1584. * REQUEST WHICH CAN BE INITIATED USING THE CARTRIDGE
  1585. * CURRENTLY MOUNTED FOR THE *HLRQ* ENTRY. IF SEVERAL
  1586. * SUCH FILES ARE FOUND, THE ONE SELECTED IS THE ONE
  1587. * WHICH BEGINS CLOSEST TO THE START OF THE CARTRIDGE.
  1588. *
  1589. * PROC STNTDAM((HLRQADR))
  1590. *
  1591. * ENTRY (HLRQADR) - ADDRESS OF THE *HLRQ* ENTRY.
  1592. *
  1593. * THE FOLLOWING FIELDS IN THE *HLRQ* ENTRY AND
  1594. * THE *TDAM* PORTION IDENTIFY THE CARTRIDGE
  1595. * CURRENTLY MOUNTED.
  1596. * - *TDAMFAM*, *TDAMSBF* = SUBFAMILY,
  1597. * *HLR$SM*, *HLR$FCTX* = CARTRIDGE IN SUBFAMILY.
  1598. *
  1599. * EXIT THE *TDAM* PORTION OF THE *HLRQ* ENTRY IS UPDATED
  1600. * TO IDENTIFY THE NEXT ACTION.
  1601. * IF *TDAMFC* = "NOREQ", NO FILE WAS FOUND.
  1602. * OTHERWISE, THE *TDAM* ENTRY FOR THE NEW FILE
  1603. * WAS MOVED TO THE *HLRQ*.
  1604. #
  1605.  
  1606. ITEM HLRQADR U; # *HLRQ* ADDRESS #
  1607.  
  1608. #
  1609. **** PROC STNTDAM - XREF LIST BEGIN.
  1610. #
  1611.  
  1612. XREF
  1613. BEGIN
  1614. PROC ADD$LNK; # ADD ENTRY TO CHAIN #
  1615. PROC DEL$LNK; # DELETE ENTRY FROM CHAIN #
  1616. PROC ZFILL; # ZERO FILL ARRAY #
  1617. END
  1618.  
  1619. #
  1620. **** PROC STNTDAM - XREF LIST END.
  1621. #
  1622.  
  1623. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  1624. *CALL,COMBFAS
  1625. *CALL,COMBCHN
  1626. *CALL,COMBTDM
  1627. *CALL COMXCTF
  1628. *CALL COMBUDT
  1629. *CALL,COMXHLR
  1630. *CALL COMXMFD
  1631. *CALL,COMXMSC
  1632.  
  1633. ITEM BESTAU U; # STARTING AU OF BEST FILE #
  1634. ITEM BESTQ U; # ADDRESS OF BEST ENTRY #
  1635. ITEM CANDIDATE U; # TEMPORARY #
  1636. ITEM FAM C(7); # FAMILY #
  1637. ITEM I I; # LOOP INDEX #
  1638. ITEM SF U; # SUBFAMILY INDEX #
  1639. ITEM QADDR U; # ADDRESS OF NEXT *RTRQ* ENTRY #
  1640. CONTROL EJECT;
  1641. P<HLRQ> = HLRQADR;
  1642. P<TDAM> = LOC(HLR$TDAM[0]);
  1643.  
  1644. FAM = TDAMFAM[0];
  1645. SF = TDAMSBF[0];
  1646. BESTQ = 0;
  1647. BESTAU = 99999999;
  1648.  
  1649. QADDR = CHN$BOC[LCHN"RTD$ACT"];
  1650.  
  1651. FOR DUMMY = 0 WHILE QADDR NQ 0
  1652. DO
  1653. BEGIN # SEARCH LOOP #
  1654.  
  1655. CANDIDATE = QADDR;
  1656. P<LINKWRD> = QADDR;
  1657. P<TDAM> = QADDR+1;
  1658.  
  1659. QADDR = LINK$ADR[0]; # SET UP FOR NEXT LOOP #
  1660.  
  1661. #
  1662. * EXAMINE THE CURRENT *RTRQ* ENTRY AND LOOP IF ITS NOT
  1663. * - FOR THE SAME SUBFAMILY,
  1664. * - FOR THE SAME CARTRIDGE,
  1665. * - THE FIRST ONE ON THE CARTRIDGE.
  1666. #
  1667.  
  1668. IF TDAMFC[0] NQ TDAMFCODE"STAGE" ##
  1669. OR TDAMFAM[0] NQ FAM ##
  1670. OR TDAMSBF[0] NQ SF
  1671. THEN # NOT STAGE, OR IN THE SAME
  1672.   SUBFAMILY #
  1673. BEGIN
  1674. TEST DUMMY;
  1675. END
  1676.  
  1677. P<ASA> = LOC(TDAMASA[0]);
  1678.  
  1679. IF ASASM[0] NQ HLR$SM[0] ##
  1680. OR ASAFCT[0] NQ HLR$FCTX[0]
  1681. THEN # NOT ON THE SAME CARTRIDGE #
  1682. BEGIN
  1683. TEST DUMMY;
  1684. END
  1685.  
  1686. IF ASAAU[0] LS BESTAU
  1687. THEN # SELECT THIS ONE #
  1688. BEGIN
  1689. BESTQ = CANDIDATE;
  1690. BESTAU = ASAAU[0];
  1691. TEST DUMMY;
  1692. END
  1693.  
  1694. END # SEARCH LOOP #
  1695.  
  1696. IF (BESTQ EQ 0) ##
  1697. OR (HLR$ERRC[0] NQ 0) ##
  1698. OR (HLR$RESP[0] EQ ERRST"RSFULL")
  1699. THEN # NO MORE FILES TO STAGE FROM
  1700.   CARTRIDGE #
  1701. BEGIN
  1702. P<TDAM> = LOC(HLR$TDAM[0]);
  1703. TDAMFC[0] = TDAMFCODE"NOREQ";
  1704. HLR$UNLD[0] = TRUE;
  1705.  
  1706. END
  1707.  
  1708. ELSE # MOVE NEW *TDAM* INTO *HLRQ* #
  1709. BEGIN
  1710. P<TDAM> = BESTQ + 1;
  1711. HLR$TDAM[0] = TDAMREQST[0];
  1712. RTRQ$CT = RTRQ$CT - 1;
  1713.  
  1714. DEL$LNK(BESTQ,LCHN"RTD$ACT",0);
  1715. ZFILL(TDAM[0],TDAMLEN);
  1716. ADD$LNK(BESTQ,LCHN"RTD$FRSPC",0);
  1717. END
  1718.  
  1719. ADD$LNK(HLRQADR,LCHN"HL$READY",0);
  1720. HLR$RETRY[0] = FALSE;
  1721. HLR$HPN[0] = HLRPN"STAGE";
  1722. HLR$HPS[0] = PROCST"INITIAL";
  1723.  
  1724. RETURN;
  1725. END # STNTDAM #
  1726.  
  1727. TERM
  1728. PROC TDAM$RP;
  1729.  
  1730. # TITLE TDAM$RP - *TDAM* REQUEST PROCESSOR. #
  1731.  
  1732. BEGIN # TDAM$RP #
  1733.  
  1734. #
  1735. ** TDAM$RP - *TDAM* REQUEST PROCESSOR.
  1736. *
  1737. * *TDAM$RP* DOES THE PROCESSING OF REQUESTS RESIDING IN THE *RTRQ*.
  1738. * IN THE *RTRQ*.
  1739. *
  1740. * PROC TDAM$RP.
  1741. *
  1742. * EXIT *HLR$DOSTG* IS SET TO INTERRUPT DESTAGING IF A
  1743. * STAGE REQUEST IS WAITING TO BE PROCESSED.
  1744. * THE MASK *STG$MSK* IS SET UP.
  1745. *
  1746. * MESSAGES * INVALID TDAM REQUEST.*.
  1747. *
  1748. * NOTES *TDAM$RP* PROCESSES *TDAM* REQUESTS AS FOLLOWS -
  1749. *
  1750. * STEP 1 - THE STATUS OF EACH *SM* IS DETERMINED.
  1751. * THE COUNT OF AVAILABLE *DRD-S* IS DECREMENTED IF
  1752. * THE *SM* OR ONE OF THE *DRD-S* IS NOT AVAILABLE.
  1753. *
  1754. * STEP 2 - IF EITHER *DRD* ON A *SM* IS DESTAGING
  1755. * THEN THE *ID* OF THAT CARTRIDGE IS SAVED. IF
  1756. * DESTAGING IS NOT OCCURRING ON EITHER *DRD* THEN
  1757. * THE *ID* OF A CARTRIDGE ON EITHER *DRD* IS SAVED.
  1758. *
  1759. * STEP 3 - THE *RTRQ* IS SEARCHED FOR *TDAM* STAGE
  1760. * REQUESTS. ANY VALID NON-STAGE REQUESTS ARE
  1761. * PROCESSED AS THEY COME IN.
  1762. * STAGE REQUESTS ARE PROCESSED UNLESS
  1763. * 1) NO *DRD-S* ARE FREE.
  1764. * 2) ONE *DRD* IS FREE AND THE CARTRIDGE NEEDED
  1765. * IS IN USE.
  1766. * IN EITHER OF THESE TWO CASES, IF THE *SM* IS
  1767. * DESTAGING THE *HLR$DOSTG* FLAG IS SET TO INTERRUPT
  1768. * THE DESTAGE.
  1769. *
  1770. * STEP 4 - THE MASK *STG$MSK* IS SET UP WITH ONE BIT
  1771. * PER *SM* SET IF A STAGE REQUEST FROM A *SM* CANNOT
  1772. * BE PROCESSED BECAUSE THE FOLLOWING CONDITIONS ARE
  1773. * PRESENT -
  1774. * 1) NO SPACE IS AVAILABLE FOR NEW *HLRQ* REQUESTS.
  1775. * 2) THERE ARE NO *DRD-S* AVAILABLE.
  1776. * 3) THE *SM* IS NOT DESTAGING AND THEREFORE CANNOT
  1777. * BE INTERRUPTED BY SETTING THE *HLR$DOSTG* FLAG.
  1778. #
  1779.  
  1780.  
  1781. #
  1782. **** PROC TDAM$RP - XREF LIST BEGIN.
  1783. #
  1784.  
  1785. XREF
  1786. BEGIN
  1787. PROC ADD$LNK; # ADD ENTRY TO LINK #
  1788. PROC CRELSLK; # RELEASE CATALOG INTERLOCK #
  1789. PROC CRELSMM; # RELEASE CATALOG IN MODIFY MODE #
  1790. PROC DEL$LNK; # DELETE ENTRY FROM LINK #
  1791. PROC HLRQENQ; # *HLRQ* ENQUEUER #
  1792. PROC SSOVL; # LOAD *MSAS* OVERLAYS #
  1793. PROC MSG; # ISSUE MESSAGE #
  1794. PROC MSGAFDF; # MESSAGE HANDLER #
  1795. PROC ZFILL; # ZERO FILL BUFFER #
  1796. END
  1797.  
  1798. #
  1799. **** PROC TDAM$RP - XREF LIST END.
  1800. #
  1801.  
  1802. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  1803. *CALL,COMBFAS
  1804. *CALL,COMBCHN
  1805. *CALL,COMBOVL
  1806. *CALL,COMBTDM
  1807. *CALL,COMBUDT
  1808. *CALL,COMXCTF
  1809. *CALL COMXEMC
  1810. *CALL,COMXHLR
  1811. *CALL,COMXMFD
  1812. *CALL,COMXMSC
  1813.  
  1814. ITEM DRDCOUNT I; # DRD COUNT #
  1815. ITEM FCT U; # CURRENT *FCT* ORDINAL #
  1816. ITEM FULL B; # *DRD* FULL #
  1817. ITEM HLRADR U; # *HLRQ* ENTRY ADDRESS #
  1818. ITEM HLRDEST U; # ADDRESS OF DESTAGE *HLRQ* ENTRY
  1819.   #
  1820. ITEM I I; # LOOP INDEX #
  1821. ITEM LINK I; # ADDRESS OF NEW CHAIN ENTRY #
  1822. ITEM OFFSET I; # INCREMENT FROM LINK ADDRESS TO
  1823.   GET *TDAM* ENTRY #
  1824. ITEM RTDADR U; # *RTRQ* ENTRY ADDRESS #
  1825. ITEM REMOVE B; # REMOVE ENTRY FROM *RTRQ* #
  1826. ITEM SM I; # SM-ID #
  1827. ITEM STAT I; # STATUS #
  1828. ITEM STDRDCT I; # STAGE DRD COUNT #
  1829. ITEM TYPE C(1); # MESSAGE TYPE S #
  1830. #
  1831. * STEP 1 - SEARCH THE *RTRQ* FOR *TDAM* STAGE REQUESTS
  1832.  
  1833. * IF NON-STAGE REQUESTS ARE FOUND PROCESS THEM ACCORDINGLY.
  1834. #
  1835.  
  1836. RTRQ$CT = 0; # CLEAR *RTRQ* COUNTER #
  1837. LINK = CHN$BOC[LCHN"RTD$ACT"];
  1838.  
  1839. REPEAT WHILE LINK NQ 0
  1840. DO
  1841. BEGIN # SCAN *RTRQ* #
  1842.  
  1843. RTDADR = LINK;
  1844. P<TDAM> = LINK + 1;
  1845. P<LINKWRD> = LINK;
  1846. LINK = LINK$ADR[0];
  1847. REMOVE = FALSE;
  1848.  
  1849. #
  1850. * CHECK FOR INVALID *TDAM* REQUEST.
  1851. #
  1852.  
  1853. IF TDAMFC[0] LQ TDAMFCODE"NOREQ" ##
  1854. OR TDAMFC[0] GQ TDAMFCODE"FCEND" ##
  1855. OR TDAMFC[0] EQ TDAMFCODE"DESTAGE" ##
  1856. OR TDAMFC[0] EQ TDAMFCODE"DESTRLS"
  1857. THEN
  1858. BEGIN
  1859. MSG(INVRQC,UDFL1); # INVALID *TDAM* REQUEST #
  1860. REMOVE = TRUE;
  1861. END
  1862.  
  1863. #
  1864. * PROCESS *TDAM* REQUEST.
  1865. #
  1866.  
  1867. IF TDAMFC[0] EQ TDAMFCODE"RCLMCINT" ##
  1868. OR TDAMFC[0] EQ TDAMFCODE"RCLMUMI"
  1869. THEN # RECLAIM INTERLOCKS #
  1870. BEGIN
  1871. RCLMCAT = TRUE;
  1872. SSOVL(LRCLMLK,0);
  1873. REMOVE = TRUE;
  1874. END
  1875.  
  1876. IF TDAMFC[0] EQ TDAMFCODE"RLSCINT"
  1877. THEN # RELEASE CATALOG INTERLOCKS #
  1878. BEGIN
  1879. REMOVE = TRUE;
  1880. IF DSC$FAM NQ TDAMPFUFAM[0]
  1881. THEN # DESTAGE REQUESTS NOT ACTIVE ON
  1882.   FAMILY #
  1883. BEGIN
  1884. CRELSLK(TDAMPFUFAM[0],TDAMMASK[0],0,STAT);
  1885. END
  1886.  
  1887. ELSE # RELEASE INTERLOCKS LATER #
  1888. BEGIN
  1889. DSC$LKTYP = 0;
  1890. DSC$LKMSK = DSC$LKMSK LOR TDAMMASK[0];
  1891. END
  1892.  
  1893. END
  1894.  
  1895. IF TDAMFC[0] EQ TDAMFCODE"RLSUMI"
  1896. THEN # RELEASE UPDATE MODE INTERLOCK #
  1897. BEGIN
  1898. REMOVE = TRUE;
  1899. IF DSC$FAM NQ TDAMPFUFAM[0]
  1900. THEN # DESTAGE REQUESTS NOT ACTIVE ON
  1901.   FAMILY #
  1902. BEGIN
  1903. CRELSMM(TDAMPFUFAM[0],TDAMMASK[0],0,STAT);
  1904. END
  1905.  
  1906. ELSE # RELEASE INTERLOCK LATER #
  1907. BEGIN
  1908. DSC$LKTYP = 1;
  1909. DSC$LKMSK = DSC$LKMSK LOR TDAMMASK[0];
  1910. END
  1911.  
  1912. END
  1913.  
  1914. #
  1915. * PROCESS STAGE REQUEST.
  1916. #
  1917.  
  1918. IF TDAMFC[0] EQ TDAMFCODE"STAGE"
  1919. THEN
  1920. BEGIN # PROCESS STAGE REQUEST #
  1921.  
  1922. #
  1923. * SET *SM* INDEX.
  1924. #
  1925.  
  1926. P<ASA> = LOC(TDAMASA[0]);
  1927. SM = ASASM[0];
  1928. RTRQ$CT = RTRQ$CT + 1;
  1929.  
  1930. #
  1931. * IF NO *DRD-S* ARE FREE - DO NOT PROCESS THE REQUEST.
  1932. * IF DESTAGING IS BEING DONE, SET BIT IN *HLRQ* FOR
  1933. * DESTAGER TO PROCESS STAGE REQUESTS WHEN DONE DESTAGING.
  1934. *
  1935. * IF ONE *DRD* IS FREE - PROCESS THE REQUEST UNLESS THE
  1936. * CARTRIDGE IS IN USE.
  1937. * IF DESTAGER IS USING THIS CARTRIDGE, SET THE *DOSTG*
  1938. * FLAG IN THE *HLRQ*.
  1939. #
  1940.  
  1941.  
  1942. SLOWFOR I=1 STEP 1 UNTIL MAXSMUNIT
  1943. DO
  1944. BEGIN # UNTIL SM FOUND #
  1945. IF SM EQ SM$ID[I]
  1946. THEN
  1947. BEGIN # CHECK *FCT* IN USE #
  1948. DRDCOUNT = 0;
  1949. FULL = FALSE;
  1950.  
  1951. IF D0$ON[I]
  1952. THEN
  1953. BEGIN
  1954. DRDCOUNT = 1;
  1955. END
  1956.  
  1957. IF D1$ON[I]
  1958. THEN
  1959. BEGIN
  1960. DRDCOUNT = DRDCOUNT + 1;
  1961. END
  1962.  
  1963. IF SM$STNUM[I] EQ 0
  1964. THEN
  1965. BEGIN
  1966. GOTO TDAM$CONT;
  1967. END
  1968.  
  1969. STDRDCT = SM$STNUM[I];
  1970.  
  1971. IF SM$REQRES1[I] NQ 0
  1972. AND SM$REQRES2[I] NQ 0
  1973. THEN
  1974. BEGIN
  1975. FULL = TRUE;
  1976. END
  1977.  
  1978. IF DRDCOUNT EQ 1
  1979. THEN
  1980. BEGIN
  1981. IF (SM$REQRES1[I] NQ 0)
  1982. OR (SM$REQRES2[I] NQ 0)
  1983. THEN
  1984. BEGIN
  1985. FULL = TRUE;
  1986. END
  1987. END
  1988. IF SM$REQRES1[I] NQ 0
  1989. THEN
  1990. BEGIN # CHECK FIRST RESERVE AREA #
  1991. IF NOT SM$LLRQ1[I]
  1992. THEN
  1993. BEGIN # RESERVED BY *HLRQ* #
  1994. P<HLRQ> = SM$REQRES1[I];
  1995.  
  1996. IF HLR$HPN[0] EQ HLRPN"STAGE"
  1997. THEN
  1998. BEGIN
  1999. STDRDCT = STDRDCT - 1;
  2000. END
  2001.  
  2002. IF STDRDCT EQ 0
  2003. THEN
  2004. BEGIN
  2005. FULL = TRUE;
  2006. END
  2007.  
  2008. IF HLR$FCTX[0] NQ 0
  2009. THEN
  2010. BEGIN
  2011. FCT = HLR$FCTX[0];
  2012. END
  2013.  
  2014. ELSE
  2015. BEGIN
  2016. FCT = HLR$ASAFCT[0];
  2017. END
  2018.  
  2019. IF ASAFCT[0] EQ FCT ##
  2020. AND TDAMFAM[0] EQ HLR$FAM[0] ##
  2021. AND TDAMSBF[0] EQ HLR$SBF[0]
  2022. THEN
  2023. BEGIN # DUPLICATE REQUEST #
  2024. IF SM$DSFLAG1[I]
  2025. THEN
  2026. BEGIN # DESTAGING *HLRQ* #
  2027. HLR$DOSTG[0] = TRUE;
  2028. TEST DUMMY;
  2029. END
  2030.  
  2031. ELSE
  2032. BEGIN # STAGE *HLRQ* #
  2033. TEST DUMMY;
  2034. END
  2035. END # END DUPLICATE REQUEST #
  2036.  
  2037. IF FULL AND SM$DSFLAG1[I]
  2038. THEN # CLEAR *DRD* ON END OF SUB FAMILY #
  2039. BEGIN
  2040. HLR$DOSTG[0] = TRUE;
  2041. END
  2042.  
  2043. END # RESERVED *HLRQ* #
  2044. END # END CHECK FOR FIRST RESERVATION #
  2045. IF SM$REQRES2[I] NQ 0
  2046. THEN
  2047. BEGIN # CHECK SECOND RESERVE AREA #
  2048. IF NOT SM$LLRQ2[I]
  2049. THEN
  2050. BEGIN # RESERVED BY *HLRQ* #
  2051. P<HLRQ> = SM$REQRES2[I];
  2052. IF HLR$HPN[0] EQ HLRPN"STAGE"
  2053. THEN
  2054. BEGIN
  2055. IF STDRDCT NQ 0
  2056. THEN
  2057. BEGIN
  2058. STDRDCT = STDRDCT - 1;
  2059. END
  2060. END
  2061.  
  2062. IF STDRDCT EQ 0
  2063. THEN
  2064. BEGIN
  2065. FULL = TRUE;
  2066. END
  2067.  
  2068. IF HLR$FCTX[0] NQ 0
  2069. THEN
  2070. BEGIN
  2071. FCT = HLR$FCTX[0];
  2072. END
  2073.  
  2074. ELSE
  2075. BEGIN
  2076. FCT = HLR$ASAFCT[0];
  2077. END
  2078.  
  2079. IF ASAFCT EQ FCT ##
  2080. AND TDAMFAM[0] EQ HLR$FAM[0] ##
  2081. AND TDAMSBF[0] EQ HLR$SBF[0]
  2082. THEN
  2083. BEGIN # DUPLICATE REQUEST #
  2084. IF SM$DSFLAG2[I]
  2085. THEN
  2086. BEGIN # DESTAGING *HLRQ* #
  2087. HLR$DOSTG[0] = TRUE;
  2088. TEST DUMMY;
  2089. END
  2090.  
  2091. ELSE
  2092. BEGIN # STAGE *HLRQ* #
  2093. TEST DUMMY;
  2094. END
  2095. END # END DUPLICATE REQUEST #
  2096.  
  2097. IF FULL AND SM$DSFLAG2[I]
  2098. THEN # CLEAR *DRD* ON END OF SUB FAMILY #
  2099. BEGIN
  2100. HLR$DOSTG[0] = TRUE;
  2101. END
  2102.  
  2103. END # RESERVED *HLRQ* #
  2104. END # END CHECK FOR SECOND RESERVATION #
  2105. GOTO TDAM$CONT; # *SM* FOUND #
  2106. END # END *FCT* IN USE #
  2107. END # END *SM* SEARCH #
  2108.  
  2109.  
  2110. TDAM$CONT:
  2111.  
  2112. IF(SM$HWOFF[I] OR NOT SM$ON[I]) ##
  2113. OR (NOT D0$ON[I] AND NOT D1$ON[I]) ##
  2114. OR (SM$STNUM[I] EQ 0)
  2115. THEN # *SM* /*DRD* NOT USABLE #
  2116. BEGIN
  2117. STAT = STGERRC"SMOFF";
  2118. TYPE = "S"; # SET MESSAGE TYPE #
  2119. MSGAFDF(TYPE,"ES",STAT,RTDADR + 1);
  2120. REMOVE = TRUE;
  2121. GOTO TDAM$CONT1;
  2122. END
  2123.  
  2124.  
  2125. IF FULL
  2126. THEN # NO *DRD* AVAILABLE #
  2127. BEGIN
  2128. TEST DUMMY;
  2129. END
  2130.  
  2131.  
  2132. #
  2133. * IF SPACE IS AVAILABLE, PUT ENTRY INTO *HLRQ* AND UPDATE THE
  2134. * *SM* STATUS LIST.
  2135. #
  2136.  
  2137. HLRADR = CHN$BOC[LCHN"HL$FRSPC"];
  2138.  
  2139. IF HLRADR NQ 0
  2140. THEN
  2141. BEGIN # BUILD *HLRQ* ENTRY #
  2142. RTRQ$CT = RTRQ$CT - 1;
  2143. HLRQENQ(HLRADR);
  2144. P<HLRQ> = HLRADR;
  2145. IF SM$REQRES1[I] EQ 0
  2146. THEN
  2147. BEGIN
  2148. SM$REQRES1[I] = HLRADR;
  2149. HLR$DRDRA[0] = LOC(SM$REQRES1[I]);
  2150. END
  2151.  
  2152. ELSE
  2153. BEGIN
  2154. SM$REQRES2[I] = HLRADR;
  2155. HLR$DRDRA[0] = LOC(SM$REQRES2[I]);
  2156. END
  2157.  
  2158. HLR$HPN[0] = HLRPN"STAGE";
  2159. HLR$TDAM[0] = TDAMREQST[0];
  2160. HLR$SM[0] = SM;
  2161. REMOVE = TRUE;
  2162.  
  2163.  
  2164. END # BUILD *HLRQ* ENTRY #
  2165.  
  2166. END
  2167.  
  2168.  
  2169. TDAM$CONT1:
  2170. IF REMOVE
  2171. THEN # REMOVE ENTRY FROM *RTRQ* #
  2172. BEGIN
  2173. DEL$LNK(RTDADR,LCHN"RTD$ACT",0);
  2174. ZFILL(TDAM,TDAMLEN);
  2175. ADD$LNK(RTDADR,LCHN"RTD$FRSPC",0);
  2176. END
  2177.  
  2178. #
  2179. * GET NEXT *TDAM* ENTRY.
  2180. #
  2181.  
  2182.  
  2183. END # SCAN *RTRQ* #
  2184.  
  2185. STG$MSK = 1; # STOP NEWWORK REQUESTS #
  2186.  
  2187. END # TDAM$RP #
  2188.  
  2189. TERM
1) , 4)
HLRQADR
2) , 3)
HLRQADR),(ERRSTAT
cdc/nos2.source/opl871/sxstge.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator