Table of Contents

SXINIT

Table Of Contents

  • [00001] PROC CALCTS
  • [00002] CALCTS - CALCULATE TABLE SPACE.
  • [00006] CALCTS - CALCULATE TABLE SPACE.
  • [00129] PROC CRAST1)
  • [00131] CRAST - CREATE *AST* ENTRY.
  • [00135] CRAST - CREATE *AST* ENTRY.
  • [00453] PROC GETRTP
  • [00454] GETRTP - GETS AND PROCESSES RUN TIME PARAMETERS.
  • [00459] GETRTP - GETS AND PROCESSES RUN TIME PARAMETERS.
  • [00483] PROC EXTAB
  • [00484] PROC MESSAGE
  • [00485] PROC XARG
  • [00486] PROC XDXB
  • [00573] PROC GETUDT
  • [00574] GETUDT - DETERMINES THE PROPERTIES OF THE CONFIGURATION.
  • [00579] GETUDT - DETERMINES THE PROPERTIES OF THE CONFIGURATION.
  • [00632] PROC ATTACH
  • [00633] PROC BZFILL
  • [00634] PROC PFD
  • [00635] PROC SETPFP
  • [00636] PROC MESSAGE
  • [00637] PROC RDEST
  • [00638] PROC READ
  • [00639] PROC READW
  • [00640] PROC RETERN
  • [00641] PROC RTIME
  • [00642] FUNC XCOD C(10)
  • [00643] PROC ZSETFET
  • [01101] PROC INITDAM
  • [01102] INITDAM - INITIALIZE *TDAM* INTERFACE.
  • [01126] PROC EESET
  • [01127] PROC SYSTEM
  • [01128] PROC ZFILL
  • [01190] PROC INITFAM
  • [01191] INITFAM - INITIALIZES SUBFAMILY PARAMETERS.
  • [01196] INITFAM - INITIALIZES SUBFAMILY PARAMETERS.
  • [01207] PROC ABORT
  • [01208] PROC BZFILL
  • [01209] PROC GETFAM
  • [01210] PROC MESSAGE
  • [01211] PROC PFD
  • [01212] PROC RETERN
  • [01213] PROC RMVBLNK
  • [01214] PROC SETPFP
  • [01215] FUNC XCOD I
  • [01216] PROC XWOD
  • [01217] PROC ZSETFET
  • [01432] PROC INITFLG
  • [01433] INITFLG - INITIALIZES ASSORTED FLAGS AND COUNTERS.
  • [01438] INITFLG - INITIALIZES ASSORTED FLAGS AND COUNTERS.
  • [01503] PROC INITLZR
  • [01504] INITLZR - SEQUENCES *SSEXEC-S* INITIALIZATION STEPS.
  • [01541] PROC CALLSS
  • [01542] PROC GETMI
  • [01543] PROC GETRTP
  • [01544] PROC GETSPS
  • [01545] PROC GETUDT
  • [01546] PROC INITDAM
  • [01547] PROC INITFAM
  • [01549] PROC INITFLG
  • [01550] PROC OPENCAT
  • [01551] PROC INITSRP
  • [01552] PROC INITTAB
  • [01553] PROC KINIT
  • [01554] PROC RTIME
  • [01733] PROC INITSRP2)
  • [01734] INITSRP - INITIALIZE SLAVE REQUEST PROCESSOR.
  • [01739] INITSRP - INITIALIZE THE SLAVE REQUEST PROCESSOR.
  • [01832] PROC MESSAGE
  • [01833] PROC PDATE
  • [01834] PROC PFD
  • [01835] PROC READ
  • [01836] PROC READW
  • [01837] PROC REWIND
  • [01838] PROC RETERN
  • [01839] PROC RTIME
  • [01840] PROC SETPFP
  • [01841] PROC WRITER
  • [01842] FUNC XCOD C(10)
  • [01843] PROC ZFILL
  • [01844] PROC ZSETFET
  • [02189] PROC INITTAB
  • [02190] INITTAB - INITIALIZES ASSORTED TABLES.
  • [02194] INITTAB - INITIALIZES ASSORTED TABLES.
  • [02214] PROC ABORT
  • [02215] PROC CALCTS
  • [02216] PROC INITTS
  • [02217] PROC MEMORY
  • [02218] PROC MESSAGE
  • [02219] PROC MNGMEM
  • [02220] PROC MSG
  • [02221] PROC RECALL
  • [02222] FUNC XCDD C(10)
  • [02223] PROC ZFILL
  • [02362] PROC INITTS
  • [02363] INITTS - PRESET ASSORTED TABLES.
  • [02368] INITTS - PRESET ASSORTED TABLES.
  • [02382] PROC BZFILL
  • [02383] PROC MESSAGE
  • [02384] FUNC XCOD C(10)
  • [02385] PROC ZFILL
  • [02646] PROC OPENCAT
  • [02648] OPENCAT - OPENS THE MAP AND CATALOG FILES.
  • [02653] OPENCAT - OPENS MAP AND CATALOG FILES.
  • [02696] PROC ABORT
  • [02697] PROC ACQ$FCT
  • [02698] PROC BZFILL
  • [02699] PROC COPEN
  • [02700] PROC CRAST
  • [02701] PROC CRDAST
  • [02702] PROC MESSAGE
  • [02703] PROC MOPEN
  • [02704] PROC RMVBLNK
  • [02705] PROC RLS$FCT
  • [02706] PROC SETPFP
  • [02707] PROC UASTPRM
  • [02708] FUNC XCDD C(3)
  • [02709] FUNC XCOD
  • [02710] PROC XWOD
  • [03104] PROC SET0100
  • [03105] SET0100 - PRESETS COMMON AREA(S) USED BY (1,0).
  • [03110] SET0100 - PRESETS COMMON AREA USED BY (1,0).
  • [03127] PROC TERMCAT
  • [03128] TERMCAT - CLOSES THE CATALOGS AND SMMAPS.
  • [03132] *TERMCAT* - CLOSES THE CATALOGS AND SMAMAPS.
  • [03148] PROC CCLOSE
  • [03149] PROC MCLOSE
  • [03202] PROC TERMSCP
  • [03204] TERMSCP - RELINQUISHES SCP STATUS.
  • [03208] TERMSCP - RELINQUISHES SCP STATUS.
  • [03223] PROC SFCALL
  • [03247] PROC WRAPUP
  • [03249] WRAPUP - WRAP-UP PROCESSING PRIOR TO NORMAL TERMINATION.
  • [03254] WRAPUP - WRAPUP PROCESSING PRIOR TO NORMAL TERMINATION.
  • [03273] PROC MESSAGE
  • [03274] PROC RTIME
  • [03275] PROC TERMCAT
  • [03277] PROC TERMSCP
  • [03278] PROC TIME
  • [03279] FUNC XCDD C(6)

Source Code

SXINIT.txt
  1. PROC CALCTS;
  2. # TITLE CALCTS - CALCULATE TABLE SPACE. #
  3. BEGIN # CALCTS #
  4.  
  5. #
  6. ** CALCTS - CALCULATE TABLE SPACE.
  7. *
  8. * THIS PROCEDURE WILL CALCULATE THE NUMBER OF ENTRIES AND THE SPACE
  9. * REQUIRED FOR EACH OF THE VARIABLE TABLES, AND STORE THE RESULTS
  10. * IN THE ARRAY *MAT*.
  11. *
  12. * EXIT TABLE CALCULATIONS COMPLETED.
  13. #
  14.  
  15. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  16. *CALL COMBFAS
  17. *CALL COMBCMD
  18. *CALL COMBLBL
  19. *CALL COMBLRQ
  20. *CALL COMBMAT
  21. *CALL COMBMCT
  22. *CALL COMBTDM
  23. *CALL COMBUDT
  24. *CALL COMXBST
  25. *CALL COMXCTF
  26. *CALL COMXEXP
  27. *CALL COMXFCQ
  28. *CALL COMXHLR
  29. *CALL,COMXIPR
  30. *CALL COMXINT
  31. *CALL COMXLTC
  32. *CALL COMXMFD
  33. *CALL COMXMSC
  34.  
  35. ITEM TEMPCOUNT U; # TEMPORARY COUNT FIELD #
  36. CONTROL EJECT;
  37.  
  38. #
  39. * CALCULATES THE SPACE REQUIRED AND THE NUMBER OF ENTRIES FOR EACH
  40. * OF THE VARIABLE TABLES, AND STORES THE RESULTS IN THE ARRAY
  41. * *MAT*.
  42. #
  43.  
  44. TEMPCOUNT = Q+2;
  45.  
  46. MAT$COUNT[MAT$ENTRY"HLRQ"] = TEMPCOUNT;
  47. MAT$SPACE[MAT$ENTRY"HLRQ"] = HLRQLEN * TEMPCOUNT;
  48.  
  49.  
  50. MAT$COUNT[MAT$ENTRY"LLRQ"] = TEMPCOUNT;
  51. MAT$SPACE[MAT$ENTRY"LLRQ"] = LLRQENTL * TEMPCOUNT;
  52.  
  53. MAT$COUNT[MAT$ENTRY"RTRQ"] = Q * RTRQ$SPACE;
  54. MAT$SPACE[MAT$ENTRY"RTRQ"] = (TDAMLEN + 1) * (Q * RTRQ$SPACE);
  55.  
  56. MAT$COUNT[MAT$ENTRY"FCTQ"] = Q; # SET FCTQ FIELD #
  57. MAT$SPACE[MAT$ENTRY"FCTQ"] = (FCTQHL+FCTENTL) * Q;
  58.  
  59. BSTL = MAXCTN * 2;
  60. MAT$COUNT[MAT$ENTRY"BST"] = BSTL;
  61. MAT$SPACE[MAT$ENTRY"BST"] = BSTENTL * BSTL;
  62.  
  63. LTCTCNT = FAMCNT + 3;
  64. MAT$COUNT[MAT$ENTRY"LTCT"] = FAMCNT + 3;
  65. MAT$SPACE[MAT$ENTRY"LTCT"] = LTCL * (FAMCNT + 3);
  66.  
  67. MAT$COUNT[MAT$ENTRY"MRFT"] = FAMCNT;
  68. MAT$SPACE[MAT$ENTRY"MRFT"] = MRFTLEN * FAMCNT;
  69.  
  70. MAT$COUNT[MAT$ENTRY"OMT"] = MAXSM;
  71. MAT$SPACE[MAT$ENTRY"OMT"] = OMTENTL * MAXSM;
  72.  
  73. MAT$COUNT[MAT$ENTRY"OCT"] = 8 * FAMCNT;
  74. MAT$SPACE[MAT$ENTRY"OCT"] = OCTENTL * 8 * FAMCNT;
  75.  
  76. MAT$COUNT[MAT$ENTRY"PREAMBLE"] = 8 * FAMCNT;
  77. MAT$SPACE[MAT$ENTRY"PREAMBLE"] = PRMTLEN * 8 * FAMCNT * 3;
  78.  
  79. MAT$COUNT[MAT$ENTRY"SCR$BUF"] = BSTL;
  80. MAT$SPACE[MAT$ENTRY"SCR$BUF"] = SCCBL * BSTL;
  81.  
  82. MAT$COUNT[MAT$ENTRY"UDT$CONT"] = MAXCTN;
  83. MAT$SPACE[MAT$ENTRY"UDT$CONT"] = UDTCUL + 1; # HEADER INCLUDED #
  84.  
  85. MAT$COUNT[MAT$ENTRY"UDT$SM"] = MAXSMUNIT;
  86. MAT$SPACE[MAT$ENTRY"UDT$SM"] = UDTSML;
  87.  
  88. MAT$COUNT[MAT$ENTRY"CAT$FET"] = 1;
  89. MAT$SPACE[MAT$ENTRY"CAT$FET"] = RFETL;
  90.  
  91. MAT$COUNT[MAT$ENTRY"CAT$BUF"] = 1;
  92. MAT$SPACE[MAT$ENTRY"CAT$BUF"] = FCTBL;
  93.  
  94. MAT$COUNT[MAT$ENTRY"MAP$FET"] = 1;
  95. MAT$SPACE[MAT$ENTRY"MAP$FET"] = RFETL;
  96.  
  97. MAT$COUNT[MAT$ENTRY"MAP$BUF"] = 1;
  98. MAT$SPACE[MAT$ENTRY"MAP$BUF"] = MAPBUFL;
  99.  
  100. MAT$COUNT[MAT$ENTRY"TEMP$FET"] = 1;
  101. MAT$SPACE[MAT$ENTRY"TEMP$FET"] = RFETL * 2;
  102.  
  103. MAT$COUNT[MAT$ENTRY"TEMP$BUF"] = 1;
  104. MAT$SPACE[MAT$ENTRY"TEMP$BUF"] = TBUFL;
  105.  
  106. MAT$COUNT[MAT$ENTRY"TEMP$WB"] = 1;
  107. MAT$SPACE[MAT$ENTRY"TEMP$WB"] = WBUFL;
  108.  
  109. MAT$COUNT[MAT$ENTRY"AST$BUF"] = 1;
  110. MAT$SPACE[MAT$ENTRY"AST$BUF"] = ABUFLEN;
  111.  
  112. MAT$COUNT[MAT$ENTRY"LABBUF"] = 1;
  113. MAT$SPACE[MAT$ENTRY"LABBUF"] = LABLEN;
  114.  
  115. MAT$COUNT[MAT$ENTRY"MW$BUFS"] = MAXCTUNIT * CHANPC;
  116. MAT$SPACE[MAT$ENTRY"MW$BUFS"] = MAXCTUNIT * CHANPC *
  117. (MWBUFL + SFMWL + 1);
  118. # READ BUFFER ADDRESS INCLUDED #
  119.  
  120. MAT$COUNT[MAT$ENTRY"MR$BUFS"] = MAXCTUNIT * CHANPC;
  121. MAT$SPACE[MAT$ENTRY"MR$BUFS"] = MAXCTUNIT*CHANPC*(MRBUFL+SFMRL);
  122.  
  123. MAT$COUNT[MAT$ENTRY"SBT"] = MAXCTUNIT + (2 * MAXSMUNIT) + 1;
  124. MAT$SPACE[MAT$ENTRY"SBT"] = (MAXCTUNIT+(2*MAXSMUNIT)+1) * MSGLT;
  125.  
  126. END # CALCTS #
  127.  
  128. TERM
  129. PROC CRAST((FCTX),(QADDR),(ASTADDR));
  130.  
  131. # TITLE CRAST - CREATE *AST* ENTRY. #
  132. BEGIN # CRAST #
  133.  
  134. #
  135. ** CRAST - CREATE *AST* ENTRY.
  136. *
  137. * THIS PROCEDURE WILL SCAN THE *FCT* ENTRY AT ORDINAL *FCTX* TO
  138. * CREATE THE CORRESPONDING TRIAL *AST* ENTRY TO BE
  139. * CHECKED WITH THE EXISTING AST IN THE PROCEDURE OPENCAT.
  140. *
  141. * PROC CRAST((FCTX),(QADDR),(ASTADDR))
  142. *
  143. * ENTRY (FCTX) = ORDINAL OF *FCT* ENTRY.
  144. * (QADDR) = ADDRESS OF *FCTQ* ENTRY.
  145. * (ASTADDR) = ADDRESS OF *AST* BUFFER.
  146. *
  147. * EXIT *AST* ENTRY HAS BEEN CONSTRUCTED.
  148. #
  149.  
  150. ITEM FCTX U; # ORDINAL OF *FCT* ENTRY #
  151. ITEM QADDR U; # ADDRESS OF *FCTQ* ENTRY #
  152. ITEM ASTADDR U; # ADDRESS OF *AST* BUFFER #
  153.  
  154. DEF SPACES #" "#; # SPACES #
  155.  
  156. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  157.  
  158. *CALL COMBFAS
  159. *CALL COMBMCT
  160. *CALL COMXCTF
  161. *CALL COMXFCQ
  162. *CALL COMXINT
  163. *CALL COMXMSC
  164.  
  165. ITEM ATBNDRY B; # TRUE IF AT *CDP* OR DONE #
  166. ITEM DONE B; # TRUE IF AFTER LAST AU #
  167. ITEM I U; # INDEX #
  168. ITEM LASTBUSY U; # LAST PROTECTED AU #
  169. ITEM NXTFREE U; # NEXT (EXPECTED) FREE VOLUME #
  170. ITEM PREVVOL U; # AU OF PREVIOUS VOLUME #
  171. ITEM TEMP U; # TEMPORARY #
  172. ITEM THISAU U; # LOOP INDEX #
  173. ITEM TOTAU U; # TOTAL AU AVAILABLE FOR
  174.   ALLOCATION #
  175. ITEM VOLLN U; # NUMBER OF (EXPECTED)
  176.   CONTINUATION AU #
  177.  
  178.  
  179. CONTROL EJECT;
  180.  
  181. P<FCT> = QADDR + FCTQHL;
  182. P<AST> = ASTADDR;
  183. IF AST$STAT[FCTX] NQ ASTENSTAT"ASS$CART"
  184. THEN
  185. BEGIN
  186. RETURN;
  187. END
  188.  
  189. #
  190. * DET OFF CARTRIDGE LINK AND ALLOCATION ALLOWED FLAGS IS AST.
  191. #
  192.  
  193. AST$NOCLF[FCTX] = FCT$OCLF[FCTX] EQ 7;
  194. AST$AAF[FCTX] = NOT ( FCT$IAF[0] OR FCT$LCF[0] OR ##
  195. FCT$EEF[0] OR FCT$SEF[0] OR ##
  196. FCT$FCF[0]) OR (FCT$ORD[0] NQ FCTX);
  197.  
  198. #
  199. * THE OBJECTIVES OF THE FOLLOWING ANALYSIS OF THE *FCT* ENTRY
  200. * ARE THREEFOLD:
  201. *
  202. * 1) COUNT THE AU AVAILABLE FOR ALLOCATION.
  203. *
  204. * 2) IDENTIFY THE FREE AU WHICH CAN SAFELY BE ALLOCATED
  205. * FOR STORAGE OF FILE DATA, LEAVING ALONE THOSE AU
  206. * WHICH ARE UNALLOCATED, BUT ARE FLAGGED, FLAWED OR
  207. * INCLUDED WITHIN THE COUNT OF CONTINUATION AU OF
  208. * AN AU OR VOLUME WHICH IS ALLOCATED.
  209. *
  210. * 3) RE-ORGANIZE THESE USABLE AU INTO VOLUMES AND REBUILD
  211. * THE CHAIN OF AVAILABLE VOLUMES FOR USE BY THE ALLOCATOR.
  212. *
  213. * A LOOP EXAMINES EACH AU IN THE *FCT* ENTRY. EACH AU IS
  214. * REJECTED AS BEING AVAILABLE IF IT IS BUSY, FLAWED, OR HAS
  215. * OTHER FLAGS SET. AN AU WHICH IS EXPECTED TO BE A
  216. * CONTINUATION AU FOR A VOLUME AVAILABLE FOR ALLOCATION IS
  217. * ACCEPTED IN THE VOLUME IF IT IS NOT BUSY OR FLAGGED.
  218. * ANY AU WHICH IS NOT BUSY, FLAGGED, OR PART OF A VOLUME IS
  219. * TREATED AS THE START OF A NEW VOLUME, AND PROPERLY LINKED
  220. * INTO THE CHAIN OF FREE VOLUMES.
  221. *
  222. * THE FOLLOWING SEQUENCE OF STEPS IS TAKEN TO ACHIEVE THE ABOVE:
  223. *
  224. * 1) DETERMINE IF THIS AU IS JUST AFTER A BOUNDARY POINT,
  225. * I.E., IT IS JUST AFTER THE LAST AU FOR SHORT OR LONG FILES.
  226. *
  227. * 2) IF A VOLUME OF FREE AU IS BEING ACCUMULATED, REDUCE THE
  228. * VOLUME LENGTH IF IT WOULD OTHERWISE INCLUDE AN AU WHICH
  229. * SHOULD NOT BE PART OF THE VOLUME.
  230. *
  231. * 3) IF THIS AU IS JUST AFTER A BOUNDARY POINT (SEE STEP 1),
  232. * - VERIFY THAT THE FREE VOLUME CHAIN IS TERMINATED WITH A
  233. * LINK=0.
  234. * - SAVE THE COUNT OF FREE AU IN THE *FCT* HEADER.
  235. * - IF AT START OF AU FOR LONG FILES, RESET COUNTERS.
  236. *
  237. * 4) IF THIS AU IS BUSY,
  238. * - SET A VARIABLE SO THAT ANY AU WHICH ARE CLAIMED TO
  239. * BE CONTINUATION AU ARE NOT TREATED AS AVAILABLE FOR
  240. * ALLOCATION REGARDLESS OF THEIR *FCT* ENTRY.
  241. * - LOOP TO EXAMINE THE NEXT AU.
  242. *
  243. * 5) IF THE AU IS PROTECTED (SEE STEP 4) OR FLAGGED, LOOP TO
  244. * EXAMINE THE NEXT AU.
  245. *
  246. * 6) PROCESS THE AU WHICH IS REALLY AVAILABLE FOR ALLOCATION.
  247. * - CLEAR CONTINUATION FLAG..FORCE A HEAD OF VOLUME STATUS.
  248. * - ADJUST IF NECESSARY THE FREE VOLUME LINKAGE TO POINT
  249. * TO THIS AU (VOLUME).
  250. * - SAVE LENGTH FIELD AS THE COUNT OF NUMBER OF EXPECTED
  251. * CONTINUATION AU.
  252. * - SAVE LINK FIELD AS THE NEXT EXPECTED FREE VOLUME.
  253. * - SAVE THE ID OF THIS VOLUME IN CASE ITS LENGTH HAS
  254. * TO BE REDUCED (SEE STEP 2), OR ITS LINK HAS TO BE
  255. * ADJUSTED (SEE ABOVE SUBSTEP).
  256. #
  257.  
  258. FCT$FLAWS[0] = 0;
  259. PREVVOL = 0;
  260. NXTFREE = FCT$FAUSF[0];
  261. TOTAU = 0;
  262. VOLLN = 0;
  263. LASTBUSY = 0;
  264. DONE = FALSE;
  265.  
  266. FOR THISAU = 1 STEP 1 WHILE NOT DONE
  267. DO
  268. BEGIN # THISAU LOOP #
  269.  
  270. #
  271. * STEP 1 - DETERMINE IF AT A BOUNDARY POINT.
  272. #
  273.  
  274. SETFCTX(THISAU);
  275. DONE = THISAU GR FCT$AVOT[0];
  276. ATBNDRY = (THISAU EQ FCT$CDP[0]) OR DONE;
  277.  
  278. #
  279. * STEP 2 - IF IN A SEQUENCE OF CONTINUATION AU, VERIFY THAT
  280. * THIS AU CAN BE INCLUDED. IF NOT, CORRECT VOLUME LENGTH.
  281. #
  282.  
  283. IF VOLLN NQ 0
  284. THEN
  285. BEGIN # STEP 2 #
  286. FCT$CLFG(0,0) = FCT$CLFG(FWD,FPS);
  287. FCT$CAUF(0,0) = 1-FCT$CAUF(0,0);
  288.  
  289. IF (FCT$FLGS1(0,0) EQ 0) ##
  290. AND NOT ATBNDRY
  291. THEN # AU IS OK AS A CONTINUATION AU #
  292. BEGIN
  293. TOTAU = TOTAU + 1;
  294. FCT$CLFG(FWD,FPS) = 0;
  295. FCT$CAUF(FWD,FPS) = 1;
  296. FCT$LEN(FWD,FPS) = VOLLN - 1;
  297. FCT$LINK(FWD,FPS) = PREVVOL;
  298. VOLLN = VOLLN - 1;
  299. TEST THISAU;
  300. END
  301.  
  302. ELSE # TERMINATE THIS VOLUME AND ADJUST
  303.   ITS LENGTH #
  304. BEGIN
  305. SETFCTX(PREVVOL);
  306. FCT$LEN(FWD,FPS) = FCT$LEN(FWD,FPS) - VOLLN;
  307. VOLLN = 0;
  308. END
  309.  
  310. END # STEP 2 #
  311.  
  312. #
  313. * STEP 3 - PROCESS BOUNDARY CONDITION.
  314. #
  315.  
  316. IF ATBNDRY
  317. THEN
  318. BEGIN # STEP 3 #
  319. SETFCTX(PREVVOL);
  320. IF NXTFREE NQ 0
  321. THEN # SET LINK TO ZERO #
  322. BEGIN
  323. FCT$LINK(FWD,FPS) = 0;
  324. END
  325.  
  326. IF DONE
  327. THEN # FINISHED AU FOR LONG FILES #
  328. BEGIN
  329. AST$AULF[FCTX] = TOTAU;
  330. IF FCT$FAULF[0] EQ 0
  331. THEN
  332. BEGIN
  333. AST$AULF[FCTX] = 0;
  334. END
  335.  
  336. TEST THISAU;
  337. END
  338.  
  339. ELSE # FINISHED AU FOR SHORT FILES #
  340. BEGIN
  341. AST$AUSF[FCTX] = TOTAU;
  342. TOTAU = 0;
  343. PREVVOL = 0;
  344. NXTFREE = FCT$FAULF[0];
  345. END
  346.  
  347. END # STEP 3 #
  348.  
  349. #
  350. * STEP 4 - PROCESS AU BUSY.
  351. #
  352.  
  353. SETFCTX(THISAU);
  354. IF FCT$FBF(FWD,FPS) EQ 1
  355. THEN # AU IS BUSY, PROTECT ALL AU
  356.   COVERED BY LENGTH FIELD #
  357. BEGIN
  358. TEMP = THISAU + FCT$LEN(FWD,FPS);
  359. IF TEMP GR LASTBUSY
  360. THEN
  361. BEGIN
  362. LASTBUSY = TEMP;
  363. END
  364.  
  365. TEST THISAU;
  366. END
  367.  
  368. #
  369. * STEP 5 - SKIP ANY AU THAT ARE PROTECTED OR FLAGGED.
  370. #
  371.  
  372. FCT$CAUF(FWD,FPS) = 0; # CLEAR CONTINUATION AU FLAG #
  373.  
  374. IF FCT$FAUF(FWD,FPS) NQ 0
  375. THEN # COUNT FLAWED AU #
  376. BEGIN
  377. FCT$FLAWS[0] = FCT$FLAWS[0] + 1;
  378. END
  379.  
  380. IF THISAU LQ LASTBUSY ##
  381. OR (FCT$FLGS1(FWD,FPS) NQ 0)
  382. THEN
  383. BEGIN
  384. TEST THISAU;
  385. END
  386.  
  387. #
  388. * STEP 6 - ENSURE THE VOLUME HEADED BY THIS AU IS IN THE
  389. * FREE SPACE CHAIN.
  390. * - IF THE NEXT EXPECTED FREE VOLUME (*NXTFREE*)
  391. * IS BEYOND THIS AU, INSERT THIS AU IN THE MIDDLE
  392. * OF THE CHAIN.
  393. * - IF THE NEXT EXPECTED FREE VOLUME IS PRIOR TO THIS
  394. * AU, CORRECT THE LINK FIELD OF THE PREVIOUS VOLUME
  395. * BY LINKING TO THIS AU.
  396. * - USE THE VOLUME LENGTH AND LINK FIELDS AS SPECIFIED
  397. * BY THIS AU-S *FCT* ENTRY. IF THEY ARE NOT CORRECT,
  398. * STEP 2 WILL REDUCE THE LENGTH, AND STEP 3 OR THIS
  399. * STEP WILL CORRECT THE LINK FIELD.
  400. #
  401.  
  402. IF THISAU NQ NXTFREE
  403. THEN # NEED TO CORRECT LINKAGE #
  404. BEGIN # CORRECT LINKAGE #
  405. IF THISAU LS NXTFREE
  406. THEN # ADD THIS AU (VOLUME) TO CURRENT
  407.   CHAIN #
  408. BEGIN
  409. FCT$LINK(FWD,FPS) = NXTFREE;
  410. END
  411.  
  412. #
  413. * ADJUST LINK FIELD OF PREVIOUS ENTRY TO POINT TO THIS VOLUME.
  414. #
  415.  
  416. IF PREVVOL EQ 0
  417. THEN # UPDATE FREE SPACE POINTERS #
  418. BEGIN
  419. IF THISAU LS FCT$CDP[0]
  420. THEN # UPDATE SHORT FILE POINTER #
  421. BEGIN
  422. FCT$FAUSF[0] = THISAU;
  423. END
  424.  
  425. ELSE # UPDATE LONG FILE POINTER #
  426. BEGIN
  427. FCT$FAULF[0] = THISAU;
  428. END
  429.  
  430. END
  431.  
  432. ELSE # UPDATE PREVIOUS LINK #
  433. BEGIN
  434. SETFCTX(PREVVOL);
  435. FCT$LINK(FWD,FPS) = THISAU;
  436. END
  437.  
  438. END # CORRECT LINKAGE #
  439.  
  440. SETFCTX(THISAU);
  441. TOTAU = TOTAU + 1;
  442. PREVVOL = THISAU;
  443. NXTFREE = FCT$LINK(FWD,FPS);
  444. VOLLN = FCT$LEN(FWD,FPS);
  445. TEST THISAU;
  446. END # THISAU LOOP #
  447.  
  448. FCT$CLFG(0,0) = 0;
  449. RETURN;
  450. END # CRAST #
  451.  
  452. TERM
  453. PROC GETRTP;
  454. # TITLE GETRTP - GETS AND PROCESSES RUN TIME PARAMETERS. #
  455.  
  456. BEGIN # GETRTP #
  457.  
  458. #
  459. ** GETRTP - GETS AND PROCESSES RUN TIME PARAMETERS.
  460. *
  461. * THIS ROUTINE WILL GET AND PROCESS THE TUNING PARAMETER
  462. * AND THE TRACE MODE PARAMETER.
  463. *
  464. * PROC GETRTP
  465. *
  466. * EXIT THE RUN TIME PARAMETERS HAVE BEEN PROCESSED.
  467. *
  468. * MESSAGE 1) EXEC ABORT - SYNTAX ERROR.
  469. *
  470. * 2) *Q* PARAMETER TOO LARGE -
  471. * MAXIMUM ALLOWABLE VALUE SUBSTITUTED.
  472. *
  473. * 3) *Q* PARAMETER TOO SMALL -
  474. * MINIMUM ALLOWABLE VALUE SUBSTITUTED.
  475. #
  476.  
  477. #
  478. **** PROC GETRTP - XREF LIST BEGIN.
  479. #
  480.  
  481. XREF
  482. BEGIN
  483. PROC EXTAB; # SETS UP PARAMETER LIST #
  484. PROC MESSAGE; # ISSUES MESSAGE TO DAYFILE #
  485. PROC XARG; # CRACK PARAMETER LIST #
  486. PROC XDXB; # CONVERT DECIMAL TO BINARY #
  487. END
  488.  
  489. #
  490. **** PROC GETRTP - XREF LIST END.
  491. #
  492.  
  493.  
  494.  
  495. DEF DEC$TYPE #1#; # DECIMAL TYPE CONVERSION #
  496. DEF QAVERAGE #10#; # AVERAGE TUNING PARAMETER VALUE #
  497. DEF QMAXIMUM #50#; # MAXIMUM TUNING PARAMETER VALUE #
  498. DEF QMINIMUM #6#; # MINIMUM TUNING PARAMETER VALUE #
  499. DEF SYNTAXOK #0#; # NO SYNTAX ERRORS #
  500.  
  501. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  502. *CALL COMBFAS
  503. *CALL COMXCTF
  504. *CALL COMXEXP
  505. *CALL COMXINT
  506. *CALL,COMXJCA
  507.  
  508. ITEM ARGLIST U; # ADDRESS OF ARGUMENT LIST #
  509. ITEM ARG$Q I; # INTEGER TUNING PARAMETER #
  510. ITEM DFLT B; # DEFAULT *Q* FLAG #
  511. ITEM FLAG U; # STATUS FLAG FOR ASARG #
  512. ITEM OPTION U; # OPTION TO SKIP PROGRAM NAME #
  513.  
  514. #
  515. * MESSAGE BUFFER.
  516. #
  517.  
  518. ARRAY MSGBUF[0:0] P(5);
  519. BEGIN # ARRAY MSGBUF #
  520. ITEM MSG$LINE C(00,00,40); # MESSAGE LINE #
  521. ITEM MSG$RZRO C(04,00,12); # ZERO BYE TERMINATOR #
  522. END # ARRAY MSGBUF #
  523.  
  524. CONTROL EJECT;
  525.  
  526. #
  527. * GET THE RUN TIME PARAMETERS.
  528. #
  529.  
  530. EXTAB(ARGLIST); # SET UP ARGUMENT LIST #
  531. OPTION = 0; # SKIP OVER PROGRAM NAME #
  532. XARG(ARGLIST,OPTION,FLAG); # GET PARAMETERS #
  533.  
  534. IF FLAG NQ SYNTAXOK
  535. THEN
  536. BEGIN # IF SYNTAX ERRORS DETECTED BY ASARG #
  537. MSG$LINE[0] = " EXEC ABORT - SYNTAX ERRORS. ";
  538. MESSAGE(MSGBUF[0],UDFL1); # ERROR MESSAGE TO DAYFILE #
  539. FATALERR = TRUE;
  540. RETURN;
  541. END # IF SYNTAX ERRORS DETECTED BY ASARG #
  542.  
  543. #
  544. * CHANGE DISPLAY CODE *S* PARAMETER TO DECIMAL INTEGER. IF
  545. * *S* PARAMETER IS NOT FOUND ON CONTROL COMMAND, *ARG$S*
  546. * WILL BE SET TO -1.
  547. #
  548.  
  549. XDXB(ARG$SC[0],DEC$TYPE,ARG$S);
  550.  
  551. #
  552. * SET THE SMALLEST *HLRQ* COUNT.
  553. #
  554.  
  555. Q = MAXSMUNIT * 2; # SET MAXIMUN AND DEFAULT *HLRQ* COUNT #
  556. IF MIMHLRQ LS Q
  557. THEN
  558. BEGIN # FORCE THE SMALLEST *HLRQ* COUNT #
  559. Q = MIMHLRQ;
  560. END
  561.  
  562.  
  563. #
  564. * SET *RA$TRACE* TO *TRUE* IF *TM* PARAMETER SPECIFIED.
  565. #
  566.  
  567. RA$TRACE = (ARG$T NQ -1);
  568.  
  569. RETURN;
  570. END # GETRTP #
  571.  
  572. TERM
  573. PROC GETUDT;
  574. # TITLE GETUDT - DETERMINES THE PROPERTIES OF THE CONFIGURATION. #
  575.  
  576. BEGIN # GETUDT #
  577.  
  578. #
  579. ** GETUDT - DETERMINES THE PROPERTIES OF THE CONFIGURATION.
  580. *
  581. * THIS ROUTINE WILL INITIALIZE VARIABLES DEFINING THE
  582. * CONFIGURATION OF THE CONTROLLERS AND STORAGE MODULES.
  583. *
  584. * PROC GETUDT.
  585. *
  586. * ENTRY M860 HARDWARE CONFIGURATION EXISTS.
  587. *
  588. * EXIT CONFIGURATION INFORMATION HAS BEEN PROCESSED.
  589. *
  590. * MESSAGES 1) ATTACH ERROR - BUDT FILE BUSY.
  591. *
  592. * 2) ATTACH ERROR - BUDT FILE NOT FOUND.
  593. *
  594. * 3) BUDT CONTROLLER ENTRY COUNT EXCEEDED.
  595. *
  596. * 4) BUDT CONTROLLER TABLE READ ERROR.
  597. *
  598. * 5) BUDT READ ERROR.
  599. *
  600. * 6) BUDT SM ENTRY COUNT EXCEEDED.
  601. *
  602. * 7) BUDT SM TABLE READ ERROR.
  603. *
  604. * 8) EST ORDINAL XX - NO UDT ENTRY.
  605. *
  606. * 9) EST READ ERROR.
  607. *
  608. * 10) EST/UDT CHANNEL MISMATCH.
  609. *
  610. * 11) MORE CHANNELS THAN MSG FETS.
  611. *
  612. * 12) VERIFY ERROR ON EST ENTRY XX.
  613. *
  614. * NOTES *INITTAB* MUST BE CALLED BEFORE *GETUDT* SO THAT AN
  615. * I/O BUFFER IS AVAILABLE TO READ THE BUDT INTO
  616. * *SSEXEC*.
  617. *
  618. * *KINIT* MUST BE CALLED BEFORE *GETUDT* SO THAT A
  619. * K-DISPLAY MESSAGE CAN BE ISSUED ALLOWING THE OPERATOR
  620. * TO RUN *SSALTER* TO MODIFY THE UDT.
  621. *
  622. * THE *UCP* INTERFACE MUST BE INITIALIZED BEFORE
  623. * *GETUDT* IS CALLED SO THAT *SSALTER* MAY BE RUN.
  624. #
  625.  
  626. #
  627. **** PROC GETUDT - XREF LIST BEGIN.
  628. #
  629.  
  630. XREF
  631. BEGIN
  632. PROC ATTACH; # ATTACH FILE #
  633. PROC BZFILL; # BLANK OR ZERO FILLS #
  634. PROC PFD; # PFM ENTRY #
  635. PROC SETPFP; # SETS USER INDEX AND FAMILY #
  636. PROC MESSAGE; # CALLS *MESSAGE* MACRO #
  637. PROC RDEST; # READ EST ENTRIES #
  638. PROC READ; # READS FILE TO I/O BUFFER #
  639. PROC READW; # READS FILE TO WORKING BUFFER #
  640. PROC RETERN; # RETURNS FILE #
  641. PROC RTIME; # GET REAL TIME #
  642. FUNC XCOD C(10); # CONVERT OCTAL TO DISPLAY #
  643. PROC ZSETFET; # SETS UP *FET* #
  644. END
  645.  
  646. #
  647. **** PROC GETUDT - XREF LIST END.
  648. #
  649.  
  650. DEF CNTYPE #"SS"#; # CONTROLLER TYPE #
  651. DEF DOWNSTATUS #3#; # CONTROLLER EST *DOWN* STATUS #
  652. DEF ESTCHAN(CUO,UCHO) #B<13+(UCHO*6),5>EST$WORD[0]#;
  653. # EST CHANNEL #
  654. DEF ESTON(UCHO) # B<12+(UCHO*6),1>EST$WORD[0]#;
  655. # EST CHANNEL STATUS #
  656. DEF FILLSIZE #7#; # FILL SIZE FOR *BZFILL* #
  657. DEF FIRSTCHAN #1#; # PRIMARY EST CHANNEL INDEX #
  658. DEF IDLESTATUS #1#; # CONTROLLER EST *IDLE* STATUS #
  659. DEF OFFSTATUS #2#; # CONTROLLER EST *OFF* STATUS #
  660. DEF ONSTATUS #0#; # CONTROLLER EST *ON* STATUS #
  661. DEF READMODE #1#; # READ MODE FOR ATTACH #
  662. DEF UDTEX(CUO,CIFO) #B<CIFO,1>UD$CHEX[CUO]#;
  663. # SET IF CHANNEL EXISTS #
  664.  
  665. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  666. *CALL COMBFAS
  667. *CALL COMBBZF
  668. *CALL COMBCMD
  669. *CALL COMBCPR
  670. *CALL,COMBFET
  671. *CALL COMBKDD
  672. *CALL COMBMAT
  673. *CALL,COMBPFP
  674. *CALL COMBPFS
  675. *CALL COMBUCR
  676. *CALL COMBUDT
  677. *CALL COMSPFM
  678. *CALL COMXBST
  679. *CALL COMXCTF
  680. *CALL COMXINT
  681. *CALL COMXJCA
  682.  
  683.  
  684. ITEM BITMAPPOS U; # BIT POSITION IN EST ORD BIT MAP #
  685. ITEM BITMAPWORD U; # EST ORDINAL BIT MAP WORD #
  686. ITEM BUFL U; # I/O BUFFER LENGTH #
  687. ITEM DESIREDORD I; # EST ORD TO CHECK IN BIT MAP #
  688. ITEM ESTNUM U; # COUNT OF EST ENTRIES READ #
  689. ITEM ESTORD C(10); # DISPLAY CODE EST ORDINAL #
  690. ITEM NUM I; # NUMBER OF EST ENTRIES #
  691. ITEM FETL U; # TEMP BUFFER FET LENGTH #
  692. ITEM FOUND B; # SET IF EST/UDT MATCH FOUND #
  693. ITEM I U; # INDEX #
  694. ITEM J U; # INDEX #
  695. ITEM K I; # INDEX #
  696. ITEM LFN C(7); # BUDT LOCAL FILENAME #
  697. ITEM PASSWORD C(7); # BUDT FILE PASSWORD #
  698. ITEM STAT U; # FUNCTION RETURN STATUS #
  699. ITEM TMPCCNT U; # TEMP CHANNEL COUNT #
  700.  
  701. #
  702. * ARRAY TO MARK SS-TYPE EQUIPMENT.
  703. #
  704.  
  705. ARRAY EQBITS [0:8] S(9);
  706. BEGIN
  707. ITEM EQUSED U(00,00,60); # BIT MAP WORD #
  708. END
  709.  
  710.  
  711. #
  712. * EST BUFFER.
  713. #
  714.  
  715. ARRAY ESTB [0:0] S(2);
  716. BEGIN # EST #
  717. ITEM EST$WORD U(00,00,60); # EST WORD #
  718. ITEM EST$STAT U(00,10,02); # CONTROLLER STATUS #
  719. ITEM EST$CHBDWN B(00,12,01); # CHANNEL *B* DOWN #
  720. ITEM EST$CHB U(00,13,05); # CHANNEL *B* #
  721. ITEM EST$CHADWN B(00,18,01); # CHANNEL *A* DOWN #
  722. ITEM EST$CHA U(00,19,05); # CHANNEL *A* #
  723. ITEM EST$CHDDWN B(00,24,01); # CHANNEL *D* DOWN #
  724. ITEM EST$CHD U(00,25,05); # CHANNEL *D* #
  725. ITEM EST$CHCDWN B(00,30,01); # CHANNEL *C* DOWN #
  726. ITEM EST$CHC U(00,31,05); # CHANNEL *C* #
  727. ITEM EST$CONT U(00,37,11); # CONTROLLER TYPE #
  728. ITEM EST$CNCT U(00,48,03); # CONNECT CODE #
  729. END # EST #
  730.  
  731.  
  732. #
  733. * UDT CHANNEL ARRAY.
  734. #
  735.  
  736. ARRAY UDTCH [0:MAX$CH] S(1);
  737. BEGIN
  738. ITEM UDTCWORD U(00,00,06); # CHANNEL WORD #
  739. ITEM UDTBSTAT B(00,00,01); # CHANNEL STATUS (BOOLEAN) #
  740. ITEM UDTSTAT U(00,00,01); # CHANNEL STATUS #
  741. ITEM UDTCHAN U(00,01,05); # CHANNEL NUMBER #
  742. END
  743.  
  744.  
  745. #
  746. * *MISSING UDT ENTRY* ERROR MESSAGE BUFFER.
  747. #
  748.  
  749. ARRAY MISMB [0:0] S(4);
  750. BEGIN # MESSAGE BUFFER #
  751. ITEM MIS$1 C(00,00,13) = [" EST ORDINAL "];
  752. ITEM MIS$NUM U(01,18,24); # EST ORDINAL #
  753. ITEM MIS$2 C(01,42,16) = [" - NO UDT ENTRY."];
  754. ITEM MIS$ZRO U(03,18,42) = [0]; # ZERO-BYTE TERMINATOR #
  755. END # MESSAGE BUFFER #
  756.  
  757.  
  758. #
  759. * GENERAL ERROR MESSAGE BUFFER.
  760. #
  761.  
  762. ARRAY MSGMB [0:0] S(5);
  763. BEGIN # MESSAGE BUFFER #
  764. ITEM MSG$LINE C(00,00,40); # MESSAGE LINE #
  765. ITEM MSG$ZRO U(04,00,12) = [0]; # ZERO-BYTE TERMINATOR #
  766. END # MESSAGE BUFFER #
  767.  
  768.  
  769. #
  770. * *VERIFY* ERROR MESSAGE BUFFER.
  771. #
  772.  
  773. ARRAY VERMB [0:0] S(4);
  774. BEGIN # MESSAGE BUFFER #
  775. ITEM VER$1 C(00,00,27) = [" VERIFY ERROR ON EST ENTRY "];
  776. ITEM VER$NUM C(02,42,24); # EST ORDINAL #
  777. ITEM VER$2 C(03,06,06) = ["."];
  778. ITEM VER$ZRO U(03,12,48) = [0]; # ZERO-BYTE TERMINATOR #
  779. END # MESSAGE BUFFER #
  780.  
  781.  
  782. CONTROL EJECT;
  783.  
  784. #
  785. * READ BUDT INTO TEMPORARY BUFFER.
  786. #
  787.  
  788. LFN = BUDT;
  789. PASSWORD = BUDTPW;
  790. BZFILL(LFN,TYPFILL"ZFILL",FILLSIZE); # CLEAR FILENAME #
  791. BZFILL(PASSWORD,TYPFILL"ZFILL",FILLSIZE); # CLEAR PASSWORD #
  792. PFP$UI = DEF$UI; # SET *SETPFP* PARAMETERS #
  793. PFP$FAM = FAM$NAME[DEFAULTORD];
  794. PFP$FG1 = TRUE;
  795. PFP$FG4 = TRUE;
  796. SETPFP(PFP[0]); # SET USER INDEX AND FAMILY #
  797.  
  798. #
  799. * TRY ATTACHING BUDT FILE 10 TIMES BEFORE TERMINATING.
  800. #
  801. SLOWFOR I = 0 STEP 1 UNTIL 10
  802. DO
  803. BEGIN
  804. PFD("ATTACH",LFN,0,"PW",PASSWORD,"RC",PFSTAT,"NA",0,"UP",0,0);
  805.  
  806. IF PFSTAT EQ OK
  807. THEN
  808. BEGIN # BUDT ATTACHED #
  809. GOTO ENDCON;
  810. END
  811. END # ATTACH BUDT LOOP #
  812.  
  813. ENDCON:
  814.  
  815. IF PFSTAT NQ OK
  816. THEN # PROCESS ATTACH ERROR #
  817. BEGIN # ABORT #
  818. MSG$LINE[0] = " ATTACH ERROR - BUDT FILE BUSY.";
  819. IF PFP$STAT[0] NQ FBS
  820. THEN # BUDT FILE NOT FOUND #
  821. BEGIN # NOT FOUND #
  822. MSG$LINE[0] = " ATTACH ERROR - BUDT FILE NOT FOUND.";
  823. END # NOT FOUND #
  824.  
  825. GOTO GETUDT1;
  826. END # ABORT #
  827.  
  828. BUFL = MAT$SPACE[MAT$ENTRY"TEMP$BUF"];
  829. FETL = MAT$SPACE[MAT$ENTRY"TEMP$FET"];
  830. ZSETFET(TFETADR,LFN,TBUFADR,BUFL,FETL);
  831. READ(TFET,RCL); # READ BUDT WITH AUTO-RECALL #
  832.  
  833. #
  834. * READ BUDT FROM TEMPORARY BUFFER INTO UDT SPACE.
  835. #
  836.  
  837. P<UDT$WORD> = UDTCADR;
  838. READW(TFET,UDT$WORD,1,STAT);
  839. IF STAT NQ OK
  840. THEN # READ COMPLETED WITH ERRORS #
  841. BEGIN # ABORT #
  842. MSG$LINE[0] = " BUDT READ ERROR.";
  843. GOTO GETUDT1;
  844. END # ABORT #
  845.  
  846. IF UDT$LINE$CUN[0] GR MAXCTN
  847. THEN # CONTROLLER TABLE TOO LARGE #
  848. BEGIN # ABORT #
  849. MSG$LINE[0] = " BUDT CONTROLLER ENTRY COUNT EXCEEDED.";
  850. GOTO GETUDT1;
  851. END # ABORT #
  852.  
  853. IF UDT$LINE$SMN[0] GR MAXSM
  854. THEN # SM TABLE TOO LARGE #
  855. BEGIN # ABORT #
  856. MSG$LINE[0] = " BUDT SM ENTRY COUNT EXCEEDED.";
  857. GOTO GETUDT1;
  858. END # ABORT #
  859.  
  860. UDT$WORDCNT[0] = MAT$SPACE[MAT$ENTRY"UDT$CONT"]
  861. + MAT$SPACE[MAT$ENTRY"UDT$SM"];
  862.  
  863. READW(TFET,UDT$CN,UDTCUL,STAT); # STORE CU TABLE #
  864. IF STAT NQ OK
  865. THEN # READ COMPLETED WITH ERRORS #
  866. BEGIN # ABORT #
  867. MSG$LINE[0] = " BUDT CONTROLLER TABLE READ ERROR.";
  868. GOTO GETUDT1;
  869. END # ABORT #
  870.  
  871. READW(TFET,UDT$SMA,UDTSML,STAT); # STORE *SM* TABLE #
  872. IF STAT NQ OK
  873. THEN # READ COMPLETED WITH ERRORS #
  874. BEGIN # ABORT #
  875. MSG$LINE[0] = " BUDT SM TABLE READ ERROR.";
  876. GOTO GETUDT1;
  877. END # ABORT #
  878.  
  879. RETERN(TFET,RCL); # RETURN BUDT WITH AUTO-RECALL #
  880. RETERN(TFET,RCL);
  881.  
  882. #
  883. * INITIALIZE UDT CONTROLLER AND SM ENTRIES.
  884. #
  885.  
  886. SLOWFOR I = 1 STEP 1 UNTIL 9
  887. DO # PRESET EST ORDINAL BIT MAP #
  888. BEGIN # PRESET #
  889. EQUSED[I] = 0;
  890. END # PRESET #
  891.  
  892. MAX$ACHN = 0; # PRESET ACTIVE CHANNEL COUNT #
  893. SLOWFOR I = 1 STEP 1 WHILE UD$EXIST[I] AND I LQ MAXCTN
  894. DO # PRESET CONTROLLER ENTRIES #
  895. BEGIN # PRESET #
  896. NUM = 1;
  897. ESTNUM = UD$ESTO[I];
  898. RDEST(ESTB,NUM,ESTNUM); # READ EST ENTRY #
  899. IF NUM NQ 1
  900. THEN # ABORT ON READ ERROR #
  901. BEGIN
  902. MSG$LINE[0] = "EST READ ERROR.";
  903. GOTO GETUDT1;
  904. END
  905.  
  906. IF EST$CONT[0] NQ CNTYPE # CONTROLLER TYPE MISMATCH #
  907. OR EST$CNCT[0] NQ UD$CUDA[I] # CONNECT MISMATCH #
  908. THEN # CONTROLLER ENTRY IS INCORRECT #
  909. BEGIN # ABORT #
  910. ESTORD = XCOD(UD$ESTO[I]); # SET EST ORDINAL IN MESSAGE #
  911. VER$NUM[0] = C<6,4>ESTORD;
  912. MESSAGE(VERMB,SYSUDF1);
  913. FATALERR = TRUE;
  914. RETURN;
  915. END # ABORT #
  916.  
  917. UD$CUON[I] = EST$STAT[0] EQ ONSTATUS # MOVE CU STATUS #
  918. OR EST$STAT[0] EQ IDLESTATUS;
  919. UDTCWORD[0] = UD$CHANA[I]; # COPY UDT CHANNEL INFO #
  920. UDTCWORD[1] = UD$CHANB[I];
  921. UDTCWORD[2] = UD$CHANC[I];
  922. UDTCWORD[3] = UD$CHAND[I];
  923. TMPCCNT = 0; # PRESET TEMP CHANNEL COUNT #
  924. SLOWFOR J = 0 STEP 1 UNTIL MAX$CH
  925. DO # SCAN EST ENTRY FOR CHANNELS #
  926. BEGIN # SCAN EST #
  927. IF J EQ FIRSTCHAN # IN CASE CHANNEL 0 #
  928. OR ESTCHAN(I,J) NQ 0
  929. THEN # EST CHANNEL FOUND #
  930. BEGIN # FOUND #
  931. FOUND = FALSE;
  932. SLOWFOR K = 0 STEP 1 UNTIL MAX$CH
  933. DO # SCAN ARRAY FOR CHANNEL MATCH #
  934. BEGIN # SCAN UDT #
  935. IF UDTEX(I,K) NQ 0 # UDT CHANNEL FOUND #
  936. AND ESTCHAN(I,J) EQ UDTCHAN[K] # CHANNELS MATCH #
  937. THEN # MOVE CHANNEL STATUS TO UDT #
  938. BEGIN # STATUS #
  939. FOUND = TRUE;
  940. MAX$ACHN = MAX$ACHN + UDTSTAT[K]; # COUNT CHANNELS #
  941. TMPCCNT = TMPCCNT + 1;
  942. IF ESTON(J) EQ 1
  943. THEN # CHANNEL OFF IN EST #
  944. BEGIN # OFF #
  945. UDTBSTAT[K] = FALSE; # TURN OFF CHANNEL IN UDT #
  946. END # OFF #
  947.  
  948. END # STATUS #
  949.  
  950. END # SCAN UDT #
  951.  
  952. IF NOT FOUND
  953. THEN # CHANNEL MISMATCH #
  954. BEGIN # ABORT #
  955. GOTO GETUDT2;
  956. END # ABORT #
  957.  
  958. END # FOUND #
  959.  
  960. END # SCAN EST #
  961.  
  962. IF TMPCCNT NQ (UDTEX(I,0) + UDTEX(I,1) +
  963. UDTEX(I,2) + UDTEX(I,3))
  964. THEN # CHANNEL MISMATCH #
  965. BEGIN # ABORT #
  966. GOTO GETUDT2;
  967. END # ABORT #
  968.  
  969. UD$CHANA$O[I] = UDTBSTAT[0]; # COPY CHANNEL STATUSES TO UDT #
  970. UD$CHANB$O[I] = UDTBSTAT[1];
  971. UD$CHANC$O[I] = UDTBSTAT[2];
  972. UD$CHAND$O[I] = UDTBSTAT[3];
  973. P<UDT$MSG> = LOC(UD$MSG[I]);
  974. MS$MSQN$CN[0] = I; # STORE CONTROLLER ORDINAL #
  975. BITMAPWORD = UD$ESTO[I]/60;
  976. BITMAPPOS = UD$ESTO[I] - (BITMAPWORD * 60);
  977. B<BITMAPPOS,1>EQUSED[BITMAPWORD] = 1; # NOTE ORD PROCESSED #
  978. END # PRESET #
  979.  
  980. SLOWFOR I= 1 STEP 1 UNTIL MAX$ACHN
  981. DO
  982. BEGIN
  983. BST$AUTH[I] = TRUE;
  984. END
  985.  
  986.  
  987. SLOWFOR BITMAPWORD = 0 STEP 1 WHILE NUM EQ 1
  988. DO # FIND UNUSED M860 EST ENTRIES #
  989. BEGIN # FIND #
  990. SLOWFOR BITMAPPOS = 0 STEP 1 UNTIL 59
  991. DO # SCAN EST ORDINAL BIT MAP WORD #
  992. BEGIN # WORD #
  993. DESIREDORD = BITMAPPOS + (BITMAPWORD * 60);
  994. IF DESIREDORD EQ 0
  995. THEN # AVOID READING ENTIRE EST #
  996. BEGIN # SKIP #
  997. TEST BITMAPPOS; # ONLY READ INDIVIDUAL ENTRIES #
  998. END # SKIP #
  999.  
  1000. NUM = 1;
  1001. RDEST(ESTB,NUM,DESIREDORD);
  1002. IF NUM NQ 1
  1003. THEN # EST ORDINAL NON-EXISTENT #
  1004. BEGIN # END #
  1005. TEST BITMAPWORD; # REACHED END OF EST #
  1006. END # END #
  1007.  
  1008. IF EST$CONT[0] EQ CNTYPE
  1009. AND B<BITMAPPOS,1>EQUSED[BITMAPWORD] EQ 0
  1010. THEN # UNPROCESSED ENTRY FOUND #
  1011. BEGIN # MESSAGE #
  1012. ESTORD = XCOD(DESIREDORD); # SET EST ORDINAL IN MESSAGE #
  1013. MIS$NUM[0] = C<6,4>ESTORD;
  1014. MESSAGE(MISMB,SYSUDF1);
  1015. END # MESSAGE #
  1016.  
  1017. END # WORD #
  1018.  
  1019. END # FIND #
  1020.  
  1021. SLOWFOR I = 1 STEP 1 WHILE SM$EXIST[I] AND I LQ MAXSMUNIT
  1022. DO # PRESET SM ENTRIES #
  1023. BEGIN # PRESET #
  1024. P<UDT$MSG> = LOC(D0$MSG[I]);
  1025. MS$MSQN$CN[0] = I; # STORE SM ORDINAL #
  1026. MS$MSQN$D0[0] = TRUE; # SET DRD 0 FLAG #
  1027. P<UDT$MSG> = LOC(D1$MSG[I]);
  1028. MS$MSQN$CN[0] = I; # STORE SM ORDINAL #
  1029. MS$MSQN$D1[0] = TRUE; # SET DRD 1 FLAG #
  1030. END # PRESET #
  1031.  
  1032. #
  1033. * INITIALIZE MESSAGE READ AND WRITE BUFFER FETS.
  1034. #
  1035.  
  1036. P<FETMWB> = MWRBADR + 1; # ALLOW FOR READ BUFFER PTR #
  1037. P<FETMRB> = MRDBADR;
  1038. SLOWFOR I = 1 STEP 1 WHILE UD$EXIST[I] AND (I LQ MAXCTN)
  1039. DO # CHECK UDT CHANNELS #
  1040. BEGIN # CHECK #
  1041. CHT$WORD[0] = UD$CHANA[I]; # PRESET TEMPORARY CHANNEL ARRAY #
  1042. CHT$WORD[1] = UD$CHANB[I];
  1043. CHT$WORD[2] = UD$CHANC[I];
  1044. CHT$WORD[3] = UD$CHAND[I];
  1045. SLOWFOR J = 0 STEP 1 WHILE J LQ MAX$CIF
  1046. DO # FIND ON CHANNELS #
  1047. BEGIN # FIND #
  1048. IF CHT$ON[J]
  1049. AND (CHT$CHAN[J] NQ 0 OR J EQ 0)
  1050. THEN # INITIALIZE ASSOCIATED MSG FETS #
  1051. BEGIN # INITIALIZE #
  1052. IF P<FETMWB> GQ (MWRBADR + MAT$SPACE[MAT$ENTRY"MW$BUFS"])
  1053. THEN # MORE CHANNELS THAN MSG FETS #
  1054. BEGIN # ABORT #
  1055. MSG$LINE[0] = " MORE CHANNELS THAN MSG FETS.";
  1056. GOTO GETUDT1;
  1057. END # ABORT #
  1058.  
  1059. P<FETMRA> = P<FETMWB> - 1;
  1060. FRA$MRBADR[0] = P<FETMRB>; # MESSAGE READ BUFFER ADDRESS #
  1061.  
  1062. FMW$FIRST[0] = P<FETMWB> + SFMWL; # PRESET WRITE BUFFER #
  1063. FMW$IN[0] = FMW$FIRST[0];
  1064. FMW$OUT[0] = FMW$FIRST[0];
  1065. FMW$CHAN[0] = CHT$CHAN[J];
  1066. FMW$CHON[0] = TRUE;
  1067. FMW$LIMIT[0] = FMW$FIRST[0] + MWBUFL;
  1068.  
  1069. FMR$CU[0] = I; # PRESET READ BUFFER #
  1070. FMR$FIRST[0] = P<FETMRB> + SFMRL;
  1071. FMR$IN[0] = FMR$FIRST[0];
  1072. FMR$OUT[0] = FMR$FIRST[0];
  1073. FMR$CHAN[0] = CHT$CHAN[J];
  1074. FMR$CIF[0] = J;
  1075. FMR$LIMIT[0] = FMR$FIRST[0] + MRBUFL;
  1076. P<KWORD> = LOC(FMR$KWORDS[0]); # PRESET K-DISPLAY WORDS #
  1077. KW$COMP[0] = TRUE;
  1078.  
  1079. P<MWBTMP> = LOC(UD$CAMF[I]);
  1080. MWB$ADDR[J] = P<FETMWB>; # SET FET ADDRESS IN CU ORDINAL #
  1081. P<FETMWB> = P<FETMWB> + SFMWL + MWBUFL + 1; # NEXT FETS #
  1082. P<FETMRB> = P<FETMRB> + SFMRL + MRBUFL;
  1083. END # INITIALIZE #
  1084.  
  1085. END # FIND #
  1086.  
  1087. END # CHECK #
  1088.  
  1089. RETURN;
  1090.  
  1091. GETUDT2:
  1092. MSG$LINE[0] = " EST/UDT CHANNEL MISMATCH.";
  1093.  
  1094. GETUDT1:
  1095. MESSAGE(MSGMB,SYSUDF1); # ABORT PROCESSING #
  1096. FATALERR = TRUE;
  1097. RETURN;
  1098. END # GETUDT #
  1099.  
  1100. TERM
  1101. PROC INITDAM;
  1102. # TITLE INITDAM - INITIALIZE *TDAM* INTERFACE. #
  1103. BEGIN # INITDAM #
  1104.  
  1105. #
  1106. *** INITDAM - INITAILIZE *TDAM* INTERFACE.
  1107. *
  1108. * THIS ROUTINE WILL INITIALIZE THE *TDAM* INTERFACE
  1109. * AND ISSUE AN EVENT TO SWAP IN THE JOBS WAITING FOR *MSAS*.
  1110.  
  1111. * PROC INITDAM.
  1112. *
  1113. * ENTRY *SSEXEC* HAS BEEN INITIALIZED AND READY TO BE
  1114. * CALLED BY WAITING JOBS.
  1115. *
  1116. * EXIT *TDAM* INTERFACE HAS BEEN INITIALIZED AND
  1117. * EVENT TO SWAP IN WAITING JOBS HAS BEEN ISSUED.
  1118. #
  1119.  
  1120. #
  1121. **** PROC INITDAM - XREF LIST BEGIN.
  1122. #
  1123.  
  1124. XREF
  1125. BEGIN
  1126. PROC EESET; # ENTERS EVENT IN EVENT TABLE #
  1127. PROC SYSTEM; # CALLS *SYSTEM* MACRO #
  1128. PROC ZFILL; # ZERO FILLS BUFFER #
  1129. END
  1130.  
  1131. #
  1132. **** PROC INITDAM - XREF LIST END.
  1133. #
  1134.  
  1135. DEF NO$EQUIP #0#; # NO EQUIPMENT VALUE #
  1136.  
  1137. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  1138. *CALL COMBFAS
  1139. *CALL,COMBCDD
  1140. *CALL COMBTDM
  1141. *CALL COMBUDT
  1142. *CALL COMXCTF
  1143. *CALL COMXINT
  1144. *CALL,COMXJCA
  1145.  
  1146. ITEM I U; # INDEX #
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152. #
  1153. * INITIALIZE *TDAM* INTERFACE AND ISSUE EVENT TO SWAP IN JOBS
  1154. * WAITING FOR *MSAS*.
  1155. #
  1156.  
  1157. P<TDAM> = LOC(RA$TDAM);
  1158. ZFILL(TDAM,TDAMLEN);
  1159.  
  1160. EESET$EQ[0] = NO$EQUIP; # USE NO EQUIPMENT VALUE #
  1161. EESET(EVENT); # SET EVENT INTO EVENT TABLE #
  1162.  
  1163.  
  1164. #
  1165. * PRESET ALL PP CALL BLOCK ENTRIES.
  1166. #
  1167.  
  1168. SLOWFOR I = 1 STEP 1 UNTIL PPCBTSIZE
  1169. DO # SET PARAMETER WORD ADDRESS #
  1170. BEGIN # SET ADDRESS #
  1171. PPU$1SS[I] = "1SS";
  1172. PPU$PADDR[I] = LOC(PPU$WORD1[I]);
  1173. PPU$DRCL[I] = LOC(DRVRRECALL);
  1174. END # SET ADDRESS #
  1175.  
  1176. PPU$FC[1] = IRTDAM;
  1177. PPCBENCNT = PPCBENCNT+1; # INCREMENT PPCALL COUNT #
  1178. SPC$SPC[0] = "SPC";
  1179. SPC$ADDR[0] = LOC(PPTMP);
  1180. PPT$WORD0[0] = PPU$WORD0[1];
  1181. SLOWFOR I = 0 WHILE PPT$WORD0[0] NQ 0
  1182. DO
  1183. BEGIN
  1184. SYSTEM(SPC,RCL);
  1185. END
  1186.  
  1187. END # INITDAM #
  1188.  
  1189. TERM
  1190. PROC INITFAM;
  1191. # TITLE INITFAM - INITIALIZES SUBFAMILY PARAMETERS. #
  1192.  
  1193. BEGIN # INITFAM #
  1194.  
  1195. #
  1196. ** INITFAM - INITIALIZES SUBFAMILY PARAMETERS.
  1197. *
  1198. * PROC INITFAM.
  1199. #
  1200.  
  1201. #
  1202. **** PROC INITFAM - XREF LIST BEGIN.
  1203. #
  1204.  
  1205. XREF
  1206. BEGIN
  1207. PROC ABORT; # CALLS *ABORT* MACRO #
  1208. PROC BZFILL; # BLANK OR ZERO FILLS #
  1209. PROC GETFAM; # GETS TABLE OF FAMILIES #
  1210. PROC MESSAGE; # CALLS *MESSAGE* MACRO #
  1211. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
  1212. PROC RETERN; # RETURNS FILE #
  1213. PROC RMVBLNK; # REMOVE MULTIPLE BLANKS #
  1214. PROC SETPFP; # SETS USER INDEX AND FAMILY #
  1215. FUNC XCOD I; # CHANGES INTEGER TO DISPLAY #
  1216. PROC XWOD; # CHANGES INTEGER TO OCTAL #
  1217. PROC ZSETFET; # SETS UP *FET* #
  1218. END
  1219.  
  1220. #
  1221. **** PROC INITFAM - XREF LIST END.
  1222. #
  1223.  
  1224. DEF FILLSIZE #7#; # FILL SIZE FOR *BZFILL* #
  1225. DEF NUM$MST #4#; # NUMBER OF *MSA-S* #
  1226. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  1227. *CALL COMBFAS
  1228. *CALL COMBBZF
  1229. *CALL COMBPFP
  1230. *CALL COMBPFS
  1231. *CALL COMBUDT
  1232. *CALL COMXCTF
  1233. *CALL COMXINT
  1234. *CALL COMXMSC
  1235. *CALL COMSPFM
  1236.  
  1237.  
  1238. ITEM ATLEASTONE B; # AT LEAST ONE FOUND FLAG #
  1239. ITEM BADNUM U; # BAD FILE INDEX #
  1240. ITEM BLKFILL S:TYPFILL = S"BFILL"; # BLANK FILL #
  1241. ITEM BLKFOUND B; # BLANK FOUND FLAG #
  1242. ITEM FOUND B; # ITEM FOUND FLAG #
  1243. ITEM I U; # INDEX #
  1244. ITEM J U; # INDEX #
  1245. ITEM K U; # INDEX #
  1246. ITEM MSGTEMP C(8); # ITEM FOR *BZFILL* #
  1247. ITEM NUM$FAM U; # NUMBER OF *GETFAM* ENTRIES #
  1248. ITEM UI U; # USER INDEX #
  1249.  
  1250.  
  1251. #
  1252. * ARRAY TO DISPLAY BAD FILE INFORMATION.
  1253. #
  1254.  
  1255. ARRAY BADFILE[0:MAXSF] P(3);
  1256. BEGIN
  1257. ITEM BAD$PFN C(00,00,07); # FILE NAME #
  1258. ITEM BAD$FAM C(00,42,08); # FAMILY NAME #
  1259. ITEM BAD$INDEX C(01,30,06); # USER INDEX #
  1260. END
  1261.  
  1262. #
  1263. * ARRAY TO USER INDEX DISPLAY CODE.
  1264. #
  1265.  
  1266. ARRAY DIS[0:0] P(2);
  1267. BEGIN
  1268. ITEM DIS$UI C(01,24,06); # USER INDEX IN DISPLAY CODE #
  1269. END
  1270.  
  1271. #
  1272. * ARRAY TO HOLD *SFMCAT* FILE NAME.
  1273. #
  1274.  
  1275. ARRAY CAT[0:0];
  1276. BEGIN # CAT #
  1277. ITEM CAT$PFN C(00,00,07) = ["SFMCAT "]; # FILE NAME #
  1278. ITEM CAT$UNID C(00,36,01); # UNIQUE IDENTIFIER #
  1279. END # CAT #
  1280.  
  1281.  
  1282. #
  1283. * MESSAGE BUFFER.
  1284. #
  1285.  
  1286. ARRAY MSGBUF[0:0] P(5);
  1287. BEGIN # ARRAY MSGBUF #
  1288. ITEM MSG$LINE C(00,00,40); # MESSAGE LINE #
  1289. ITEM MSG$RZRO C(04,00,12); # ZERO BYE TERMINATOR #
  1290. END # ARRAY MSGBUF #
  1291.  
  1292. ARRAY SC$FET [0:0] P(SFETL);
  1293. ;
  1294. CONTROL EJECT;
  1295.  
  1296. #
  1297. * FUNCTION 2 - ANALYZE FAMILIES.
  1298. *
  1299. * FIND NUMBER AND NAMES OF FAMILIES WITH ALL SUBFAMILY CATALOGS.
  1300. #
  1301.  
  1302. NFAM = 1;
  1303.  
  1304. SSID = ATAS;
  1305. GETFAM(FAMT,NUM$FAM,LINK[0],DEFAULTORD,SSID);
  1306. DEF$FAM = FAM$NAME[DEFAULTORD];
  1307.  
  1308.  
  1309. #
  1310. * ATTEMPT TO ATTACH EACH *SFMCAT* FILE FOR EACH FAMILY.
  1311. * THE FOLLOWING ACTIONS WILL BE TAKEN DEPENDING ON THE NUMBER
  1312. * OF FILES ATTACHED
  1313. *
  1314. * 1) IF NONE, DO NOTHING,
  1315. * 2) IF EIGHT, SAVE THE FAMILY NAME,
  1316. * 3) IF SOME BUT NOT EIGHT, ISSUE ERROR MESSAGE.
  1317. #
  1318.  
  1319. SLOWFOR I = 1 STEP 1 UNTIL NUM$FAM
  1320. DO
  1321. BEGIN # CHECK ALL FAMILIES FOR EIGHT CATALOGS #
  1322.  
  1323. ATLEASTONE = FALSE; # AT LEAST ONE FOUND FLAG #
  1324. FOUND = TRUE; # CATALOG FOUND FLAG #
  1325. BADNUM = 0; # BAD FILE INDEX #
  1326.  
  1327. SLOWFOR J = 0 STEP 1 UNTIL MAXSF
  1328. DO
  1329. BEGIN # CHECK CATALOG FOR EACH SUBFAMILY #
  1330.  
  1331. PFP$UI = DEF$UI + J; # SET USER INDEX FOR *SETPFP* #
  1332. PFP$FAM = FAM$NAME[I]; # SET FAMILY NAME FOR *SETPFP* #
  1333. PFP$FG1 = TRUE; # SET FAMILY BIT FOR *SETPFP* #
  1334. PFP$FG4 = TRUE; # SET INDEX BIT FOR *SETPFP* #
  1335. SETPFP(PFP); # SET USER INDEX AND FAMILY #
  1336.  
  1337. #
  1338. * IF UNABLE TO DO A *SETPFP* ON A FAMILY, IGNORE CATALOG VALIDATION
  1339. * AND CONTINUE WITH THE NEXT FAMILY.
  1340. #
  1341.  
  1342. IF PFP$STAT NQ 0
  1343. THEN
  1344. BEGIN
  1345. TEST I; # NEXT FAMILY #
  1346. END
  1347.  
  1348. CAT$UNID[0] = XCOD(J); # CHANGE INDEX TO DISPLAY CODE #
  1349. PFD("ATTACH",CAT$PFN,0,"RC", ##
  1350. PFSTAT,"NA",0,"UP",0,0);
  1351. IF PFSTAT EQ 0 OR PFSTAT EQ FBS
  1352. THEN
  1353. BEGIN # IF ATTACH SUCCESSFUL #
  1354. ATLEASTONE = TRUE;
  1355. END # IF ATTACH SUCCESSFUL #
  1356.  
  1357. ELSE
  1358. BEGIN # ERROR OTHER THAN FILE BUSY OR UTILITY ACTIVE #
  1359. UI = DEF$UI + J;
  1360. XWOD(UI,DIS);
  1361.  
  1362. BAD$PFN[BADNUM] = CAT$PFN[0]; # SAVE FILE NAME #
  1363. MSGTEMP = FAM$NAME[I];
  1364. BZFILL(MSGTEMP,BLKFILL,FILLSIZE);
  1365. BAD$FAM[BADNUM] = MSGTEMP; # SAVE FAMILY NAME #
  1366. BAD$INDEX[BADNUM] = DIS$UI; # SAVE USER INDEX #
  1367.  
  1368. BADNUM = BADNUM + 1; # INCREMENT COUNT #
  1369. FOUND = FALSE; # CATALOG NOT ATTACHED #
  1370. END # ERROR OTHER THAN FILE BUSY OR UTILITY ACTIVE #
  1371.  
  1372. ZSETFET(LOC(SC$FET[0]),CAT$PFN,0,0,SFETL);
  1373. RETERN(SC$FET[0],RCL);
  1374.  
  1375. END # CHECK CATALOG FOR EACH SUBFAMILY #
  1376.  
  1377. IF FOUND
  1378. THEN
  1379. BEGIN # IF EIGHT CATALOGS EXIST #
  1380. NAMEFAM[NFAM] = FAM$NAME[I]; # SAVE FAMILY NAME #
  1381. NFAM = NFAM + 1; # INCREMENT FAMILY COUNT #
  1382. END # IF EIGHT CATALOGS EXIST #
  1383.  
  1384. ELSE
  1385. BEGIN # CHECK FOR AT LEAST ONE SUCCESSFUL ATTACH #
  1386. IF ATLEASTONE
  1387. THEN
  1388. BEGIN # OUTPUT MESSAGE FOR EACH BAD FILE #
  1389. SLOWFOR J = 0 STEP 1 WHILE J LS BADNUM
  1390. DO
  1391. BEGIN # FOR EACH BAD FILE #
  1392. MSG$LINE[0] = " ATTACH ERROR ON SFM SUBFAMILY CATALOG.";
  1393. MESSAGE(MSGBUF,UDFL1);
  1394.  
  1395. MSGPFN[0] = BAD$PFN[J];
  1396. MSGFAM[0] = BAD$FAM[J];
  1397. MSGUI[0] = BAD$INDEX[J];
  1398.  
  1399. MSG$LINE[0] = MSG$TEXT[0];
  1400. RMVBLNK(MSGBUF[0],40);
  1401. MESSAGE(MSGBUF,UDFL1);
  1402. END # FOR EACH BAD FILE #
  1403.  
  1404. END # OUTPUT MESSAGE FOR EACH BAD FILE #
  1405.  
  1406. END # CHECK FOR AT LEAST ONE SUCCESSFUL ATTACH #
  1407.  
  1408. END # CHECK ALL FAMILIES FOR EIGHT CATALOGS #
  1409.  
  1410. NFAM = NFAM - 1; # SET FAMILY COUNT #
  1411.  
  1412. #
  1413. * SET THE FATAL ERROR FLAG IF THERE ARE NO FAMILIES WITH
  1414. * EIGHT *SFM* CATALOGS.
  1415. #
  1416.  
  1417. IF NFAM EQ 0
  1418. THEN
  1419. BEGIN # NO FAMILY WITH 8 CATALOGS FOUND #
  1420. FATALERR = TRUE;
  1421.  
  1422. MSG$LINE[0] = " INITIALIZATION PROBLEMS -";
  1423. MESSAGE(MSGBUF[0],UDFL1);
  1424.  
  1425. MSG$LINE[0] = " NO FAMILY WITH 8 CATALOGS FOUND.";
  1426. MESSAGE(MSGBUF[0],UDFL1);
  1427. END # NO FAMILY WITH 8 CATALOGS FOUND #
  1428.  
  1429. END # INITFAM #
  1430.  
  1431. TERM
  1432. PROC INITFLG;
  1433. # TITLE INITFLG - INITIALIZES ASSORTED FLAGS AND COUNTERS. #
  1434.  
  1435. BEGIN # INITFLG #
  1436.  
  1437. #
  1438. ** INITFLG - INITIALIZES ASSORTED FLAGS AND COUNTERS.
  1439. *
  1440. * THIS PROCEDURE WILL INITIALIZE ASSORTED FLAGS AND COUNTERS.
  1441. *
  1442. * PROC INITFLG.
  1443. *
  1444. * EXIT FLAGS HAVE BEEN INITIALIZED.
  1445. #
  1446.  
  1447. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  1448. *CALL COMBFAS
  1449. *CALL COMBCMD
  1450. *CALL COMBLBL
  1451. *CALL COMBMAT
  1452. *CALL COMBUCR
  1453. *CALL COMBUDT
  1454. *CALL COMXBST
  1455. *CALL COMXCTF
  1456. *CALL COMXINT
  1457. CONTROL EJECT;
  1458.  
  1459. #
  1460. * INITIALIZE FLAGS.
  1461. #
  1462.  
  1463. CURESERVED = FALSE; # CONTROLLER RESERVED FLAG #
  1464. DRVRRECALL = FALSE; # DRIVER RECALL FLAG #
  1465. DRYUP = FALSE; # DRY-UP FLAG #
  1466. EXEC = TRUE; # MSAS EXECUTIVE FLAG #
  1467. GLBINTLK = FALSE; # GLOBAL CATALOG INTERLOCK FLAG #
  1468. GLBSTFL = TRUE; # GLOBAL STAGE FLAG #
  1469. GLBDSFL = TRUE; # GLOBAL DESTAGE FLAG #
  1470. GLBUCPSW = FALSE; # GLOBAL *UCP* SWAPPED FLAG #
  1471. LABELBUSY = FALSE; # LABEL BUFFER BUSY FLAG #
  1472. TERMINATE = FALSE; # TERMINATE FLAG #
  1473.  
  1474. #
  1475. * INITIALIZE COUNTS.
  1476. #
  1477.  
  1478. SMCNT = NSM; # NUMBER OF *SM-S* #
  1479. FAMCNT = NFAM; # NUMBER OF FAMILIES #
  1480. PPCBENCNT = 0; # CALL BLOCK ACTIVE ENTRY COUNT #
  1481.  
  1482. #
  1483. * INITIALIZE THRESHOLDS.
  1484. #
  1485.  
  1486.  
  1487. #
  1488. * INITIALIZE DELAY EXPIRATION TIMES.
  1489. #
  1490.  
  1491. ITLK$EXPIR = 0; # RECLAIM CATALOG INTERLOCKS #
  1492. MINQ$EXPIR = 0; # MINIMUM QUEUE DELAY EXPIRATION #
  1493. KDIS$EXPIR = 0; # K-DISPLAY REFRESH #
  1494.  
  1495. #
  1496. * INITIALIZE ASSORTED POINTERS.
  1497. #
  1498.  
  1499. SFBLKPTR = LOC(SFPARMBLK);
  1500. END # INITFLG #
  1501.  
  1502. TERM
  1503. PROC INITLZR;
  1504. # TITLE INITLZR - SEQUENCES *SSEXEC-S* INITIALIZATION STEPS. #
  1505. BEGIN # INITLZR #
  1506.  
  1507. #
  1508. *** INITLZR - SEQUENCES *SSEXEC-S* INITIALIZATION STEPS.
  1509. *
  1510. * THIS ROUTINE WILL MAKE CALLS TO SUBROUTINES AND MACROES TO
  1511. * PERFORM ALL NON-HARDWARE INITIALIZATION STEPS FOR *SSEXEC*.
  1512. *
  1513. * PROC INITLZR.
  1514. *
  1515. * ENTRY CALLED FROM *SSEXEC*.
  1516. *
  1517. * EXIT PARAMETERS HAVE BEEN PROCESSED AND ALL NON-HARDWARE
  1518. * INITIALIZATION STEPS HAVE BEEN EXECUTED OR THE FATAL
  1519. * ERROR FLAG HAS BEEN SET.
  1520. *
  1521. * NOTES THIS INITIALIZATION ROUTINE MAKES PROCEDURE CALLS TO
  1522. * DO THE FOLLOWING:
  1523. *
  1524. * 1) GET THE RUN TIME PARAMETERS,
  1525. * 2) INITIALIZE SUBFAMILY PARAMETERS,
  1526. * 3) INITIALIZE ASSORTED FLAGS,
  1527. * 4) INITIALIZE ASSORTED TABLES,
  1528. * 5) INITIALIZE FOR MULTI-MAINFRAMES,
  1529. * 6) ADVISE SYSTEM OF KEYBOARD BUFFER,
  1530. * 7) REQUEST ACTIVE SUBSYSTEM STATUS,
  1531. * 8) INITIALIZE UDT INTERFACE,
  1532. * 9) INITIALIZE *TDAM* INTERFACE.
  1533. #
  1534.  
  1535. #
  1536. **** PROC INITLZR - XREF LIST BEGIN.
  1537. #
  1538.  
  1539. XREF
  1540. BEGIN
  1541. PROC CALLSS; # ISSUES REQUEST TO SUBSYSTEM #
  1542. PROC GETMI; # GETS MACHINE INFORMATION #
  1543. PROC GETRTP; # GETS RUN TIME PARAMETERS #
  1544. PROC GETSPS; # GET SYSTEM ORIGIN PRIVILEDGES #
  1545. PROC GETUDT; # GETS UNIT DEVICE TABLE #
  1546. PROC INITDAM; # INITIALIZES *TDAM* INTERFACE #
  1547. PROC INITFAM; # INITIALIZE SUBFAMILY PARAMETERS
  1548.   #
  1549. PROC INITFLG; # INITIALIZES FLAGS #
  1550. PROC OPENCAT; # OPEN CATALOGS AND MAPS #
  1551. PROC INITSRP; # INITIALIZES FOR *MMF* MODE #
  1552. PROC INITTAB; # INITIALIZES ASSORTED TABLES #
  1553. PROC KINIT; # INITIALIZES *K* DISPLAY #
  1554. PROC RTIME; # INTERFACE TO *RTIME* MACRO #
  1555. END
  1556.  
  1557. #
  1558. **** PROC INITLZR - XREF LIST END.
  1559. #
  1560.  
  1561. DEF NOPARAM #-1#; # NO PARAMETER SPECIFIED #
  1562. DEF SECOND #1#; # SWITCH FOR SECOND BUFFER #
  1563. DEF SS$SYS #0#; # REQUEST SUBSYSTEM STATUS CODE #
  1564. DEF RSLEN #1#; # RETURN USER STATUS #
  1565.  
  1566. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  1567. *CALL COMBFAS
  1568. *CALL COMBCPR
  1569. *CALL COMBUCR
  1570. *CALL COMXCTF
  1571. *CALL COMXEXP
  1572. *CALL COMXINT
  1573. *CALL,COMXJCA
  1574. ITEM FAMSRP C(7); # FAMILY FOR *INITSRP* #
  1575. ITEM MFINDEX U; # MACHINE INDEX FOR *INITSRP* #
  1576. ITEM PBLOCK U = 0; # PARAMETER BLOCK #
  1577. ITEM SS U; # SUBSYSTEM QUEUE PRIORITY #
  1578.  
  1579.  
  1580. ARRAY SPSSTAT [0:0] S(RSLEN);
  1581. BEGIN
  1582. ITEM SPS$STATUS U(00,48,12); # RETURN STATUS #
  1583. END
  1584.  
  1585. CONTROL EJECT;
  1586.  
  1587. #
  1588. * READ AND SAVE RTIME.
  1589. #
  1590.  
  1591. RTIME(RTIMESTAT);
  1592. FIRSTRTIME = RTIMSECS[0];
  1593.  
  1594. #
  1595. * CHECK SYSTEM ORIGIN PRIVILEDGES.
  1596. #
  1597.  
  1598.  
  1599. GETSPS(SPSSTAT);
  1600. IF SPS$STATUS NQ 0
  1601. THEN
  1602. BEGIN
  1603. FATALERR = TRUE;
  1604. END
  1605.  
  1606. #
  1607. * SET UP *RA* POINTER.
  1608. #
  1609.  
  1610. P<RA$AREA> = 0;
  1611.  
  1612. #
  1613. * CALL *GETRTP* TO PROCESS RUN TIME PARAMETERS.
  1614. #
  1615.  
  1616. GETRTP;
  1617.  
  1618. IF FATALERR
  1619. THEN
  1620. BEGIN # IF FATAL ERROR #
  1621. RETURN;
  1622. END # IF FATAL ERROR #
  1623.  
  1624. #
  1625. * CALL *INITFAM* TO INITIALIZE SUBFAMILY PARAMETERS.
  1626. #
  1627.  
  1628. INITFAM;
  1629.  
  1630. IF FATALERR
  1631. THEN
  1632. BEGIN # IF FATAL ERROR #
  1633. RETURN;
  1634. END # IF FATAL ERROR #
  1635.  
  1636. #
  1637. * CALL *INITFLG* TO INITIALIZE ASSORTED FLAGS.
  1638. #
  1639.  
  1640. INITFLG;
  1641.  
  1642. #
  1643. * CALL *INITTAB* TO INITIALIZE ASSORTED TABLES.
  1644. #
  1645.  
  1646. INITTAB;
  1647.  
  1648. IF FATALERR
  1649. THEN
  1650. BEGIN
  1651. RETURN;
  1652. END
  1653.  
  1654. #
  1655. * CALL *INITSRP* TO INITIALIZE FOR MULTI-MAINFRAMES.
  1656. #
  1657.  
  1658. GETMI(CMRINFO,EVENT);
  1659.  
  1660. EESET$EVT = EESET$ASXE; # MSAS SET UP #
  1661. EESET$ASXE = 0;
  1662.  
  1663. IF ARG$SC EQ NOPARAM
  1664. THEN
  1665. BEGIN # *S* NOT SPECIFIED #
  1666. FAMSRP = FAM$NAME[LINK$ORD[0]];
  1667. MFINDEX = CMR$MFID[0];
  1668. END # *S* NOT SPECIFIED #
  1669.  
  1670. ELSE
  1671. BEGIN # *S* PARAMETER SPECIFIED #
  1672. FAMSRP = DEF$FAM;
  1673. MFINDEX = ARG$S;
  1674. END # *S* PARAMTER SPECIFIED #
  1675.  
  1676. INITSRP(CMR$MID[0],MFINDEX,FAMSRP);
  1677.  
  1678. #
  1679. * CALL *KINIT* TO INITIALIZE *K* DISPLAY.
  1680. #
  1681.  
  1682. KINIT;
  1683.  
  1684. #
  1685. * CALL *CALLSS* MACRO TO REQUEST ACTIVE SUBSYSTEM STATUS AND
  1686. * INITIALIZE RA.SSC AND *UCPPARMSW* FOR INCOMING *UCP* REQUESTS.
  1687. * *UPCPARMSW* INDICATES WHICH BUFFER THE NEXT *UCP* REQUEST
  1688. * WILL USE.
  1689. #
  1690.  
  1691. SS = SS$SYS; # REQUEST ACTIVE STATUS CODE #
  1692. CALLSS(SS,PBLOCK,NRCL); # REQUEST ACTIVE STATUS #
  1693.  
  1694. RA$SSWWRD[0] = 0;
  1695. RA$SSCINLK = FALSE;
  1696. RA$SSCPP = TRUE;
  1697. RA$SSCXP = 0;
  1698. RA$SSCVF = TRUE;
  1699. RA$SSCLP = CPRLEN + 2;
  1700. RA$SSCAP = LOC(PRAMUCP); # SET *UCP* PARAMETER ADDRESS #
  1701. RA$SSPN = "SSEXEC";
  1702. RA$SSCODE = SSID;
  1703. UCPPARMSW = SECOND; # SET NEXT BUFFER SWITCH #
  1704.  
  1705. #
  1706. * CALL *GETUDT* TO INITIALIZE UDT INTERFACE.
  1707. #
  1708.  
  1709. GETUDT;
  1710.  
  1711. IF FATALERR
  1712. THEN
  1713. BEGIN # IF FATAL ERROR #
  1714. RETURN;
  1715. END # IF FATAL ERROR #
  1716.  
  1717. #
  1718. * CALL OPENCAT TO INITIALIZE THE OCT AND OMT TABLES AND
  1719. * TO FIND ANY DESCREPENCIES IN THE AST.
  1720. #
  1721. OPENCAT;
  1722.  
  1723. #
  1724. * INITIALIZE *TDAM* INTERFACE AND ISSUE EVENT TO SWAP IN JOBS
  1725. * WAITING FOR *MSAS*.
  1726. #
  1727.  
  1728. INITDAM;
  1729.  
  1730. END # INITLZR #
  1731.  
  1732. TERM
  1733. PROC INITSRP((MID),(MIDX),(LINKFAM));
  1734. # TITLE INITSRP - INITIALIZE SLAVE REQUEST PROCESSOR. #
  1735.  
  1736. BEGIN # INITSRP #
  1737.  
  1738. #
  1739. ** INITSRP - INITIALIZE THE SLAVE REQUEST PROCESSOR.
  1740. *
  1741. * *INITSRP* INITIALIZES THE *SSEXEC* FOR MULTIMAINFRAME
  1742. * PROCESSING. IT WILL INITIALIZE THE *MTOS* FILE WHICH IS USED TO
  1743. * COMMUNICATE WITH EACH *SLVEXEC*. IT WILL ALSO ATTACH IN
  1744. * READ-ALLOW-MODIFY MODE THE *STOM* FILES FROM ALL POSSIBLE SLAVE
  1745. * MAINFRAMES SO STAGING REQUESTS FROM *SLVEXEC* PROGRAMS CAN BE
  1746. * ACCEPTED AND PROCESSED.
  1747. *
  1748. * PROC INITSRP((MID),(MIDX),(LINKFAM))
  1749. *
  1750. * ENTRY (MID) = 2 CHARACTER ID OF THE MASTER MAINFRAME.
  1751. * (MIDX) = MACHINE INDEX (1-4) OF THE MASTER MAINFRAME.
  1752. * (LINKFAM) = NAME OF THE FAMILY ON WHICH THE
  1753. * COMMUNICATION FILES RESIDE, OR ARE TO
  1754. * RESIDE.
  1755. *
  1756. * EXIT THE VARIABLES *STOM$EXPIR* AND *MTOS$EXPIR* (IN
  1757. * *COMXCTF*) ARE INITIALIZED TO INDICATE THE TIMES WHEN
  1758. * THE *STOM* FILES SHOULD BE MONITORED AND THE *MTOS*
  1759. * FILE SHOULD BE UPDATED, RESPECTIVELY. IF THE
  1760. * *SSEXEC* IS TO RUN IN SINGLE MAINFRAME MODE, THESE
  1761. * TIMES ARE SET TO THE LARGEST POSSIBLE VALUE.
  1762. *
  1763. * NOTES THE *SSEXEC* WILL RUN IN SINGLE MAINFRAME MODE IF ANY
  1764. * OF THE FOLLOWING CONDITIONS ARE MET.
  1765. * 1) THE MAINFRAME IS NOT IN MULTIMAINFRAME
  1766. * MODE.
  1767. * 2) THE *SETPFP* REQUEST FAILS.
  1768. * 3) THE *MTOS* FILE EXISTS, BUT CANNOT BE
  1769. * ATTACHED IN MODIFY MODE.
  1770. * 4) THE *MTOS* FILE DOES NOT EXIST, BUT
  1771. * CANNOT BE DEFINED.
  1772. * 5) NO VALID SLAVE MAINFRAMES CAN BE
  1773. * IDENTIFIED.
  1774. *
  1775. * ANOTHER MAINFRAME WILL NOT BE RECOGNIZED AS A VALID
  1776. * SLAVE MAINFRAME IF ANY OF THE FOLLOWING IS TRUE.
  1777. * 1) THE *STOM* FILE CANNOT BE ATTACHED IN
  1778. * READ-ALLOW-MODIFY MODE.
  1779. *
  1780. * 2) THE LENGTH OF THE *STOM* FILE INDICATES
  1781. * THAT THE *SLVEXEC* IS WORKING WITH A
  1782. * DIFFERENT SET OF INSTALLATION
  1783. * PARAMETERS.
  1784. *
  1785. * MESSAGES
  1786. * * EXEC MMF INITIALIZATION OK.*
  1787. * AN INFORMATIVE MESSAGE NOTING THAT *SSEXEC*
  1788. * IS READY TO RUN IN MULTIMAINFRAME MODE.
  1789. *
  1790. * * EXEC MMF INITIALIZATION FAILED -*
  1791. * * - ALL SLAVES OMITTED.* -OR-
  1792. * * - ATTACH MTOS FAILED.* -OR-
  1793. * * - DEFINE MTOS FAILED.* -OR-
  1794. * * - MTOS FILE BUSY.* -OR-
  1795. * * - SETPFP PROBLEM.*
  1796. * A MESSAGE INDICATING THAT THE *SSEXEC* PROGRAM
  1797. * WILL NOT RUN IN MULTIFRAME MODE FOR THE REASON
  1798. * NOTED ON THE SECOND LINE.
  1799. *
  1800. * * EXEC IN SINGLE MAINFRAME MODE.*
  1801. * AN INFORMATIVE MESSAGE INDICATING THAT THE
  1802. * *SSEXEC* PROGRAM IS RUNNING IN A SINGLE
  1803. * MAINFRAME CONFIGURATION.
  1804. *
  1805. * * EXEC - SLAVE N XXXX.*
  1806. * XXXX = ACTIVE/IDLE.
  1807. * AN INFORMATIVE MESSAGE INDICATING THAT *SSEXEC*
  1808. * IS READY TO COMMUNICATE WITH THE *SSSLV*
  1809. * PROGRAM WHICH IS RUNNING ON MAINFRAME *N*.
  1810. *
  1811. * * EXEC - SLAVE N OMITTED -*
  1812. * * - NO STOM FILE.* -OR-
  1813. * * - STOM FILE LENGTH PROBLEM.*
  1814. * A MESSAGE INDICATING THAT *SSEXEC* WILL NOT
  1815. * COMMUNICATE WITH AN *SSSLV* PROGRAM, IF ANY, ON
  1816. * MAINFRAME *N* FOR THE REASON NOTED IN THE
  1817. * SECOND LINE.
  1818. *
  1819. #
  1820.  
  1821.  
  1822. ITEM MID C(2); # MACHINE ID OF MASTER MF #
  1823. ITEM MIDX U; # INDEX (1-4) OF MASTER MF #
  1824. ITEM LINKFAM C(7); # NAME OF LINK FAMILY #
  1825.  
  1826. #
  1827. **** PROC INITSRP - XREF LIST BEGIN.
  1828. #
  1829.  
  1830. XREF
  1831. BEGIN
  1832. PROC MESSAGE; # ISSUES MESSAGE MACRO #
  1833. PROC PDATE; # ISSUE PDATE MACRO #
  1834. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
  1835. PROC READ; # READ FILE #
  1836. PROC READW; # READ LINE #
  1837. PROC REWIND; # REWIND FILE #
  1838. PROC RETERN; # RETURN FILE #
  1839. PROC RTIME; # ISSUE RTIME MACRO #
  1840. PROC SETPFP; # ISSUE SETPFP MACRO #
  1841. PROC WRITER; # WRITE FILE #
  1842. FUNC XCOD C(10); # INTEGER TO DISPLAY #
  1843. PROC ZFILL; # ZERO FILL AN ARRAY #
  1844. PROC ZSETFET; # INITIALIZE *FET* #
  1845. END
  1846.  
  1847. #
  1848. **** PROC INITSRP - XREF LIST END.
  1849. #
  1850.  
  1851. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
  1852.  
  1853.  
  1854. *CALL,COMBFAS
  1855. *CALL,COMBFET
  1856. *CALL,COMBPFP
  1857. *CALL COMBPFS
  1858. *CALL,COMXCTF
  1859. *CALL COMXINT
  1860. *CALL,COMXIPR
  1861. *CALL,COMXMMF
  1862. *CALL,COMSPFM
  1863.  
  1864.  
  1865.  
  1866. ARRAY MMFSTAT [0:0] S(4);
  1867. BEGIN
  1868. ITEM MMF$TEXT C(00,00,38) # INITIALIZATION STATUS #
  1869. =[" EXEC MMF INITIALIZATION STATUS"];
  1870. ITEM MMF$STAT C(02,30,09); # OK/FAILED - #
  1871. ITEM MMF$END U(03,48,12) =[0]; # END OF LINE #
  1872. END
  1873.  
  1874.  
  1875. ARRAY RBBUF [0:0] S(RBSIZE);; # SCRATCH BUFFER #
  1876.  
  1877.  
  1878.  
  1879. ITEM PFNAME C(7); # PERMANENT FILE NAME #
  1880. ITEM RB U; # INDEX TO A REQUEST BLOCK #
  1881. ITEM STAT U; # SCRATCH STATUS WORD #
  1882. ITEM STATM S:EXECSTAT; # STATUS OF MMF INITIALIZATION #
  1883. ITEM STATS S:EXECSTAT; # STATUS OF A SLAVE #
  1884. ITEM THISSLV U; # SCRATCH WORD #
  1885.  
  1886. CONTROL EJECT;
  1887.  
  1888. #
  1889. * INITIALIZE VARIOUS ITEMS AND POINTERS.
  1890. #
  1891.  
  1892. STATM = S"INITPROB";
  1893. L$STOM = (NUMRB + 1) * RBSIZE;
  1894. L$MTOSH = (MAXSLV + 1) * 3;
  1895. L$MTOS = L$MTOSH + NUMRB * NUMSLV;
  1896. P<MTOSHEAD> = LOC(MTOS$BUF);
  1897. P<MTOSM> = LOC(MTOB$FET);
  1898. P<STOMMBUF> = LOC(STOM$BUF);
  1899. STOMBUFL = STOM$BFL;
  1900.  
  1901. ZSETFET(LOC(MTOSM),MTOSMLFN,LOC(MTOSHEAD),L$MTOS + 1,SFETL);
  1902.  
  1903. IF MIDX EQ 0
  1904. THEN # SINGLE MAINFRAME MODE #
  1905. BEGIN
  1906. STATM = S"SMF";
  1907. GOTO INITMASTER;
  1908. END
  1909.  
  1910. #
  1911. * ISSUE A *SETPFP* SO THE COMMUNICATION FILES
  1912. * CAN BE ATTACHED.
  1913. #
  1914.  
  1915. PFP$WRD0[0] = 0;
  1916. PFP$FAM[0] = LINKFAM;
  1917. PFP$FG1[0] = TRUE; # CHANGE FAMILY #
  1918. PFP$FG4[0] = TRUE; # CHANGE USER INDEX #
  1919. PFP$UI[0] = DEF$UI;
  1920. SETPFP(PFP);
  1921. IF PFP$STAT[0] NQ 0
  1922. THEN
  1923. BEGIN
  1924. MMFD$PROB[0] = "SETPFP PROBLEM.";
  1925. GOTO INITMASTER;
  1926. END
  1927.  
  1928. #
  1929. * ATTACH THE *MTOS* FILE IN MODIFY MODE,
  1930. * AND READ IT TO THE *MTOS* BUFFER.
  1931. * USE THE *STOM* FILE BUFFER AND *FET* TO READ THE *MTOS* FILE.
  1932. #
  1933.  
  1934. ZSETFET(LOC(STOMM),MTOSMLFN,LOC(STOMMBUF),STOMBUFL,SFETL);
  1935. PFD("ATTACH",MTOSMLFN,MTBSPFN,"PW",MTOSPW,
  1936. "M","M", "RC",PFSTAT,"NA",0,"UP",0,0);
  1937. IF PFSTAT EQ FBS
  1938. THEN # FILE BUSY #
  1939. BEGIN
  1940. MMFD$PROB[0] = "MTOS FILE BUSY.";
  1941. GOTO INITMASTER;
  1942. END
  1943.  
  1944.  
  1945. IF PFSTAT EQ OK
  1946. THEN # READ *MTOS* #
  1947. BEGIN
  1948. READ(STOMM,RCL);
  1949. READW(STOMM,MTOSHEAD,L$MTOS,STAT);
  1950. END
  1951.  
  1952.  
  1953.  
  1954. IF PFSTAT NQ OK ##
  1955. OR MSH$NUMSLV[0] NQ NUMSLV ##
  1956. OR MSH$NUMRB[0] NQ NUMRB
  1957. THEN # INITIALIZE THE *MTOS* FILE #
  1958. BEGIN
  1959. PFSTAT = 1;
  1960. MSH$NUMSLV[0] = NUMSLV;
  1961. MSH$NUMRB[0] = NUMRB;
  1962. STAT = 1;
  1963. END
  1964.  
  1965. #
  1966. * INITIALIZE THE MASTER STATUS INFORMATION.
  1967. #
  1968.  
  1969. MSH$PFNM[0] = MTBSPFN;
  1970. MSH$MIDM[0] = MID;
  1971. MSH$MIDX[0] = MIDX;
  1972.  
  1973.  
  1974. IF PFSTAT NQ OK
  1975. THEN
  1976. BEGIN # CREATE *MTOS* #
  1977.  
  1978. #
  1979. * CREATE A NEW *MTOS* PERMANENT FILE WHICH
  1980. * HAS THE MASTER HEADER INFORMATION.
  1981. * REATTACH THE *MTOS* FILE IN MODIFY MODE
  1982. * SO THE *SSSLV* PROGRAMS CAN READ IT.
  1983. #
  1984.  
  1985. RETERN(STOMM,RCL);
  1986. PFD("PURGE",MTBSPFN,"PW",MTOSPW,"RC",PFSTAT,"UP",0,0);
  1987. PFD("DEFINE",MTOSMLFN,MTBSPFN,"PW",MTOSPW,"BR","N", "R",
  1988. LINK$DT[0],"RC",PFSTAT,"UP",0,0);
  1989. IF PFSTAT NQ OK
  1990. THEN # CAN NOT DEFINE #
  1991. BEGIN
  1992. MMFD$PROB[0] = "DEFINE MTOS FAILED.";
  1993. GOTO INITMASTER;
  1994. END
  1995.  
  1996. P<FETSET> = LOC(MTOSM);
  1997. FET$IN[0] = FET$FRST[0] + L$MTOS;
  1998. WRITER(MTOSM,RCL);
  1999. PFD("ATTACH",MTOSMLFN,MTBSPFN,"PW",MTOSPW,"M","M", "RC",PFSTAT
  2000. ,"NA",0,"UP",0,0);
  2001. IF PFSTAT NQ OK
  2002. THEN # ABNORMAL ERROR #
  2003. BEGIN
  2004. MMFD$PROB[0] = "ATTACH MTOS FAILED.";
  2005. GOTO INITMASTER;
  2006. END
  2007.  
  2008. END # CREATE *MTOS* #
  2009.  
  2010. STATM = S"ACTIVE";
  2011.  
  2012.  
  2013.  
  2014.  
  2015. #
  2016. * ATTACH AND READ THE *STOM* COMMUNICATION FILE
  2017. * FROM EACH POSSIBLE SLAVE AND INITIALIZE THE
  2018. * HEADER AND EACH REPLY BLOCK STATUS FOR EACH SLAVE.
  2019. #
  2020.  
  2021. SINDX = 1;
  2022. P<STOMFILE> = LOC(RBBUF);
  2023. FASTFOR DUMMY = 1 STEP 1 UNTIL MAXSLV + 1
  2024. DO
  2025. BEGIN # INITIALIZE EACH SLAVE #
  2026. IF DUMMY EQ MIDX OR ##
  2027. SINDX GR NUMSLV
  2028. THEN # BYPASS THIS *MF* #
  2029. BEGIN
  2030. TEST DUMMY;
  2031. END
  2032.  
  2033. P<MTOSREPBLK> = LOC(MTOSHEAD) + L$MTOSH + (SINDX-1)*NUMRB;
  2034. PFNAME = STOMPFN;
  2035. CHAR10 = XCOD(DUMMY);
  2036. CHAR1 = C<9,1>CHAR10;
  2037. B<36,6>PFNAME = CHAR1;
  2038. SLVN$INDX[0] = CHAR1;
  2039. MSH$PFNS[SINDX] = PFNAME;
  2040.  
  2041. #
  2042. * ATTACH AND READ THE *STOM* FILE FOR THIS SLAVE
  2043. #
  2044.  
  2045. PFD("ATTACH",PFNAME,0,"PW",STOMPW,"M","RM","RC",PFSTAT, "NA",0
  2046. ,"UP",0,0);
  2047. IF PFSTAT NQ OK
  2048. THEN # REJECT SLAVE #
  2049. BEGIN
  2050. STATS = S"OMIT";
  2051. MMFD$PROB[0] = "NO *STOM* FILE.";
  2052. GOTO INITSLAVE;
  2053. END
  2054.  
  2055. ZSETFET(LOC(STOMM),PFNAME,LOC(STOMMBUF),STOMBUFL,SFETL);
  2056. READ(STOMM,NRCL);
  2057. READW(STOMM,RBBUF,RBSIZE,STAT);
  2058. MMFD$PROB[0] = "STOM FILE LENGTH PROB.";
  2059. IF STAT NQ OK
  2060. THEN # REJECT SLAVE #
  2061. BEGIN
  2062. STATS = S"OMIT";
  2063. GOTO INITSLAVE;
  2064. END
  2065.  
  2066. PDATE(PDATESTAT[0]);
  2067. RTIME(RTIMESTAT[0]);
  2068.  
  2069. #
  2070. * INITIALIZE THE *MTOS* FILE HEADER
  2071. * TO INDICATE THE SLAVE EXEC STATUS.
  2072. #
  2073.  
  2074. MSH$SSW[SINDX] = SM$SSW[0];
  2075. MSH$MIDS[SINDX] = SM$MIDS[0];
  2076.  
  2077. IF SM$IDLE[0]
  2078. THEN
  2079. BEGIN
  2080. STATS = S"IDLE";
  2081. SLVN$STAT[0] = "IDLE.";
  2082. MSH$TIMOUT[SINDX] = MAXSECS;
  2083. END
  2084.  
  2085. ELSE
  2086. BEGIN
  2087. STATS = S"ACTIVE";
  2088. SLVN$STAT[0] = "ACTIVE.";
  2089. MSH$TIMOUT[SINDX] = RTIMSECS[0] + SLAV$INTV;
  2090. END
  2091.  
  2092. #
  2093. * CHECK THE LENGTH OF THE *STOM* FILE AND
  2094. * INITIALIZE THE MASTER REPLY CODE FIELDS.
  2095. #
  2096.  
  2097. FASTFOR RB = 1 STEP 1 UNTIL NUMRB
  2098. DO
  2099. BEGIN # CHECK LENGTH OF THE *STOM* FILE #
  2100. READW(STOMM,RBBUF,RBSIZE,STAT);
  2101. IF STAT NQ OK
  2102. THEN
  2103. BEGIN
  2104. STATS = S"OMIT";
  2105. GOTO INITSLAVE;
  2106. END
  2107.  
  2108. IF MSR$MRC[RB] EQ S"ACCEPTED"
  2109. THEN # INITIALIZE REPLY CODE AND STATUS
  2110.   FIELDS #
  2111. BEGIN
  2112. MSR$MRC[RB] = S"FINISHED";
  2113. MSR$REPLY[RB] = S"ABANDONED";
  2114. MSR$PDATE[RB] = PDATEV[0];
  2115. END
  2116.  
  2117. END # CHECK LENGTH OF THE *STOM* FILE #
  2118.  
  2119. INITSLAVE:
  2120.  
  2121. MSH$STATS[SINDX] = STATS;
  2122. IF STATS EQ S"ACTIVE" OR STATS EQ S"IDLE"
  2123. THEN # SLAVE IS DEFINED #
  2124. BEGIN
  2125. MSH$DEFD[SINDX] = TRUE;
  2126. SLAVECTR = SLAVECTR + 1;
  2127. MESSAGE(SLVNSTAT,SYSUDF1);
  2128. SINDX = SINDX + 1;
  2129. END
  2130.  
  2131. ELSE # SLAVE IS NOT DEFINED #
  2132. BEGIN
  2133. MSH$DEFD[SINDX] = FALSE;
  2134. SLVN$STAT[0] = "OMITTED - ";
  2135. MESSAGE(SLVNSTAT,SYSUDF1);
  2136. MESSAGE(MMFDETAIL,SYSUDF1);
  2137. END
  2138.  
  2139. END # INITIALIZE EACH SLAVE #
  2140.  
  2141.  
  2142.  
  2143. INITMASTER:
  2144.  
  2145. #
  2146. * ESTABLISH THE NEXT TIME TO CALL THE SLAVE
  2147. * REQUEST PROCESSOR AND TO FLUSH THE *MTOS* BUFFERS.
  2148. * ISSUE A MESSAGE WITH THE FINAL INITIALIZATION STATUS.
  2149. #
  2150.  
  2151. MTOS$EXPIR = MAXSECS;
  2152. STOM$EXPIR = MAXSECS;
  2153. IF STATM EQ S"SMF"
  2154. THEN
  2155. BEGIN
  2156. MMF$TEXT[0] = " EXEC IN SINGLE MAINFRAME MODE.";
  2157. MESSAGE(MMFSTAT,SYSUDF1);
  2158. RETURN;
  2159. END
  2160.  
  2161. IF STATM EQ S"ACTIVE"
  2162. THEN # TEST IF ALL SLAVES OMITTED #
  2163. BEGIN # CHECK SLAVE STATUS #
  2164. IF SLAVECTR NQ 0
  2165. THEN
  2166. BEGIN
  2167. MTOS$EXPIR = 0;
  2168. STOM$EXPIR = 0;
  2169. MMF$STAT[0] = "OK.";
  2170. MESSAGE(MMFSTAT,SYSUDF1);
  2171. RETURN;
  2172. END
  2173.  
  2174. ELSE
  2175. BEGIN
  2176. MMFD$PROB[0] = "ALL SLAVES OMITTED.";
  2177. END
  2178.  
  2179. END # CHECK SLAVE STATUS #
  2180.  
  2181. MMF$STAT[0] = "FAILED - ";
  2182. MESSAGE(MMFSTAT,SYSUDF1);
  2183. MESSAGE(MMFDETAIL,SYSUDF1);
  2184. RETERN(MTOSM,RCL);
  2185. RETURN;
  2186. END # INITSRP #
  2187.  
  2188. TERM
  2189. PROC INITTAB;
  2190. # TITLE INITTAB - INITIALIZES ASSORTED TABLES. #
  2191. BEGIN # INITTAB #
  2192.  
  2193. #
  2194. ** INITTAB - INITIALIZES ASSORTED TABLES.
  2195. *
  2196. * THIS ROUTINE WILL INITIALIZE TABLES USED BY *SSEXEC* AND CREATE
  2197. * THE MEMORY ALLOCATION TABLE (*MAT*) WHICH DESCRIBES THE *FWA* OF
  2198. * EACH TABLE, THE ENTRY COUNT AND THE SPACE ALLOCATED FOR EACH
  2199. * TABLE.
  2200. *
  2201. * EXIT TABLES DEFINED IN THE *MAT* HAVE BEEN INITIALIZED.
  2202. *
  2203. * MESSAGES SSEXEC SEEKING FL INCREASE.
  2204. * SSEXEC ACTIVE.
  2205. * EXEC ABNORMAL - INITTAB.
  2206. #
  2207.  
  2208. #
  2209. **** PROC INITTAB - XREF LIST BEGIN.
  2210. #
  2211.  
  2212. XREF
  2213. BEGIN
  2214. PROC ABORT; # CALLS ABORT MACRO #
  2215. PROC CALCTS; # CALCULATES TABLE SPACE #
  2216. PROC INITTS; # INITIALIZES TABLES #
  2217. PROC MEMORY; # CALLS MESSAGE MACRO #
  2218. PROC MESSAGE; # CALLS *MESSAGE* MACRO #
  2219. PROC MNGMEM; # CHANGES FIELD LENGTH #
  2220. PROC MSG; # CALLS *MESSAGE* MACRO #
  2221. PROC RECALL; # CALLS RECALL MACRO #
  2222. FUNC XCDD C(10); # INTEGER TO DECIMAL DISPLAY #
  2223. PROC ZFILL; # ZEROES BUFFER SPACE #
  2224. END
  2225.  
  2226. #
  2227. **** PROC INITTAB - XREF LIST END.
  2228. #
  2229.  
  2230. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  2231. *CALL COMBFAS
  2232. *CALL COMBMAT
  2233. *CALL COMXACM
  2234. *CALL COMXCTF
  2235. *CALL COMXMSC
  2236. *CALL COMXINT
  2237. *CALL,COMXJCA
  2238.  
  2239. ITEM DC$FL C(10); # CHARACTER FIELD FOR *XCDD* #
  2240. ITEM FLCHNG I; # FIELD LENGTH CHANGE AMOUNT #
  2241. ITEM I U; # INDEX #
  2242. ITEM RCLFLAG B; # *FL* ACCESS DELAY FLAG #
  2243. ITEM RESP U; # RESPONSE FROM *MNGMEM* #
  2244. ITEM TLAST U; # LAST TABLE WORD #
  2245. ITEM TLEN U; # TABLE LENGTH #
  2246. ITEM TSTART U; # FIRST TABLE WORD #
  2247.  
  2248. #
  2249. * ARRAY FOR *ZFILL* PROCEDURE.
  2250. #
  2251.  
  2252. BASED
  2253. ARRAY DUMAR[0:0] P(1);
  2254. ;
  2255.  
  2256.  
  2257. #
  2258. * MESSAGE BUFFER.
  2259. #
  2260.  
  2261. ARRAY MSGBUF[0:0] P(5);
  2262. BEGIN # ARRAY MSGBUF #
  2263. ITEM MSG$LINE C(00,00,40); # MESSAGE LINE #
  2264. ITEM MSG$RZRO C(04,00,12); # ZERO BYE TERMINATOR #
  2265. END # ARRAY MSGBUF #
  2266.  
  2267. ARRAY STATARY[0:0] P(1); # STATUS FOR MEMORY MACRO #
  2268. BEGIN # STATARY #
  2269. ITEM STAT U(00,00,30); # STATUS #
  2270. ITEM ZEROFL U(00,30,30); # ZERO FILL REST OF WORD #
  2271. END # STATARY #
  2272.  
  2273. CONTROL EJECT;
  2274.  
  2275. #
  2276. * CALL *CALCTS* TO CALCULATE THE ENTRY COUNTS AND THE TABLE SPACE
  2277. * REQUIRED.
  2278. #
  2279.  
  2280. CALCTS;
  2281.  
  2282. P<RA$AREA> = 0; # POINTER TO *RA* AREA #
  2283.  
  2284. #
  2285. * CYCLE THROUGH ARRAY *MAT* CALCULATING THE *FWA* OF EACH ENTRY
  2286. * BASED ON THE *FWA* AND SPACE REQUIRED OF THE PREVIOUS ENTRY.
  2287. #
  2288.  
  2289. NEXTADR = RA$HHA; # FOR *MNGMEM* OPERATIONS #
  2290. MAT$FWA[0] = RA$HHA; # USE NEXT AVAILABLE FOR FIRST #
  2291.  
  2292. SLOWFOR I = 1 STEP 1 ##
  2293. WHILE I LS MAT$ENTRY"MAT$LAST"
  2294. DO
  2295. BEGIN
  2296. MAT$FWA[I] = MAT$FWA[I-1] + MAT$SPACE[I-1];
  2297. END
  2298.  
  2299. #
  2300. * GET THE MEMORY REQUIRED FOR THE VARIABLE TABLES.
  2301. #
  2302.  
  2303. STAT = 0; # REQUEST CURRENT *FL* #
  2304. MEMORY("CM",STATARY,RCL,NA);
  2305.  
  2306. IF STAT EQ 0
  2307. THEN
  2308. BEGIN # IF CURRENT *FL* NOT RETURNED #
  2309. FE$RTN[0] = "INITTAB."; # SET ROUTINE INTO ERROR MESSAGE #
  2310. MESSAGE(FEMSG[0],UDFL1);
  2311. ABORT;
  2312. END # IF CURRENT *FL* NOT RETURNED #
  2313.  
  2314. CUR$FL = STAT; # USED BY *MNGMEM* #
  2315. MAX$FL = CUR$FL; # SET MAXIMUM *FL* #
  2316. UNU$FL = CUR$FL - NEXTADR;
  2317. FLCHNG = MAT$FWA[MAT$ENTRY"MAT$LAST" - 1] + ##
  2318. MAT$SPACE[MAT$ENTRY"MAT$LAST" - 1] - NEXTADR;
  2319. RCLFLAG = FALSE; # DELAY FLAG #
  2320.  
  2321. SLOWFOR I = 0 WHILE RESP EQ 0
  2322. DO
  2323. BEGIN # LOOP UNTIL *FL* INCREASE SATISFIED #
  2324. MNGMEM(FLCHNG,RESP); # REQUEST *FL* INCREASE #
  2325. IF RESP EQ 0
  2326. THEN
  2327. BEGIN # IF ATTEMPT UNSUCCESSFUL #
  2328. MSG$LINE[0] = "$SSEXEC SEEKING FL INCREASE.";
  2329. MESSAGE(MSGBUF[0],LINE1);
  2330. RECALL;
  2331. RCLFLAG = TRUE;
  2332. END # IF ATTEMPT UNSUCCESSFUL #
  2333.  
  2334. END # LOOP UNTIL *FL* INCREASE SATISFIED #
  2335.  
  2336. IF RCLFLAG
  2337. THEN
  2338. BEGIN # IF *FL* ACCESS DELAYED #
  2339. MSG$LINE[0] = " FL OBTAINED.";
  2340. MESSAGE(MSG$LINE[0],LINE1);
  2341. END # IF *FL* ACCESS DELAYED #
  2342.  
  2343. MSG(" ",SYSUDF1);
  2344.  
  2345. #
  2346. * CALL *INITTS* TO PRESET INITIAL VALUES IN THE VARIABLE AND FIXED
  2347. * TABLES.
  2348. #
  2349.  
  2350.  
  2351. TSTART = MAT$FWA[MAT$ENTRY"HLRQ"];
  2352. TLAST = MAT$FWA[MAT$ENTRY"MAT$LAST" -1] + ##
  2353. MAT$SPACE[MAT$ENTRY"MAT$LAST" -1];
  2354. TLEN = TLAST - TSTART;
  2355. P<DUMAR> = TSTART;
  2356. ZFILL(DUMAR,TLEN);
  2357.  
  2358. INITTS;
  2359. END # INITTAB #
  2360.  
  2361. TERM
  2362. PROC INITTS;
  2363. # TITLE INITTS - PRESET ASSORTED TABLES. #
  2364.  
  2365. BEGIN # INITTS #
  2366.  
  2367. #
  2368. ** INITTS - PRESET ASSORTED TABLES.
  2369. *
  2370. * THIS PROCEDURE WILL LINK TOGETHER ENTRIES TO FORM FREE SPACE
  2371. * CHAINS AND PRESET VALUES IN TABLES USED BY *SSEXEC*.
  2372. *
  2373. * EXIT TABLE VALUES HAVE BEEN PRESET.
  2374. #
  2375.  
  2376. #
  2377. **** PROC INITTS - XREF LIST BEGIN.
  2378. #
  2379.  
  2380. XREF
  2381. BEGIN
  2382. PROC BZFILL; # ZERO FILLS WORD #
  2383. PROC MESSAGE; # ISSUE MESSAGE #
  2384. FUNC XCOD C(10); # CHANGES INTEGER TO DISPLAY #
  2385. PROC ZFILL; # ZERO FILL BUFFER #
  2386. END
  2387.  
  2388. #
  2389. **** PROC INITTS - XREF LIST END.
  2390. #
  2391.  
  2392. DEF FILLSIZE #7#; # FILL SIZE FOR *BZFILL* #
  2393.  
  2394. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  2395. *CALL COMBFAS
  2396. *CALL COMBBZF
  2397. *CALL COMBCHN
  2398. *CALL COMBCMD
  2399. *CALL COMBFET
  2400. *CALL,COMBLBL
  2401. *CALL COMBLRQ
  2402. *CALL COMBMAT
  2403. *CALL COMBMCT
  2404. *CALL COMBTDM
  2405. *CALL COMBUDT
  2406. *CALL COMXBST
  2407. *CALL COMXCTF
  2408. *CALL COMXFCQ
  2409. *CALL COMXHLR
  2410. *CALL COMXINT
  2411. *CALL COMXLTC
  2412. *CALL COMXMSC
  2413.  
  2414. ITEM FIRST U; # POINTER TO FIRST BUFFER WORD #
  2415. ITEM I U; # INDEX #
  2416. ITEM J U; # INDEX #
  2417. ITEM MSGTEMP C(7); # TEMPORARY CHARACTER ITEM #
  2418. ITEM ZEROFILL S:TYPFILL = S"ZFILL"; # ZERO BUFFER FILL #
  2419.  
  2420.  
  2421. #
  2422. * SMALL BUFFERS AND *FETS*.
  2423. #
  2424.  
  2425. ARRAY CHARARY[0:0] P(1);
  2426. BEGIN
  2427. ITEM CHARTEMP C(00,00,10); # CHARACTER BUFFER #
  2428. ITEM CHARID C(00,42,03); # CHARACTER *ID* #
  2429. END
  2430.  
  2431. ARRAY NAMEFILE[0:0] P(1);
  2432. BEGIN # NAMFILE #
  2433. ITEM NAME$HDR C(00,00,07) = ["FILE"]; # NAME HEADER #
  2434. ITEM NAME$UNID C(00,24,03); # UNIQUE ID #
  2435. END # NAMFILE #
  2436.  
  2437. CONTROL EJECT;
  2438.  
  2439. #
  2440. * CHAIN ALL *HLRQ* ENTRIES TOGETHER AND PLACE A UNIQUE FILE NAME
  2441. * INTO EACH ENTRY. ALSO SET THE *CHN$BOC* AND *CHN$EOC* FIELDS
  2442. * IN *COMBCHN* TO POINT TO THE BEGINNING AND END OF THE *HLRQ* FREE
  2443. * SPACE CHAIN.
  2444. *
  2445. * THE UNIQUE FILE NAMES ARE OBTAINED BY PLACING A NUMERIC
  2446. * IDENTIFIER AT THE END OF THE WORD "FILE". THE NUMERIC IDENTIFIER
  2447. * IS INCREMENTED BY ONE FOR EACH NEW FILE NAME.
  2448. #
  2449.  
  2450. P<HLRQ> = MAT$FWA[MAT$ENTRY"HLRQ"]; # POINT TO FIRST ENTRY #
  2451. CHN$BOC[LCHN"HL$FRSPC"] = P<HLRQ>; # BEGINNING OF CHAIN #
  2452.  
  2453. SLOWFOR I = 1 STEP 1 ##
  2454. WHILE I LQ MAT$COUNT[MAT$ENTRY"HLRQ"]
  2455. DO
  2456. BEGIN # FOR ALL *HLRQ* ENTRIES #
  2457. CHN$EOC[LCHN"HL$FRSPC"] = P<HLRQ>; # END OF CHAIN POINTER #
  2458.  
  2459. J = I + 100;
  2460. CHARTEMP[0] = XCOD(J); # CHANGE INDEX TO DISPLAY CODE #
  2461. NAME$UNID[0] = CHARID[0];
  2462. HLR$FLNM[0] = NAME$HDR[0]; # PLACE FILE NAME INTO ENTRY #
  2463.  
  2464. HLR$LNK1[0] = P<HLRQ> + HLRQLEN; # LINK TO NEXT ENTRY #
  2465. P<HLRQ> = HLR$LNK1[0]; # POINT TO THE NEXT ENTRY #
  2466. END # FOR ALL *HLRQ* ENTRIES #
  2467.  
  2468. P<HLRQ> = P<HLRQ> - HLRQLEN; # POINT TO LAST ENTRY OF CHAIN #
  2469. HLR$LNK1[0] = 0; # CLEAR LAST POINTER #
  2470.  
  2471.  
  2472. #
  2473. * CHAIN ALL *LLRQ* ENTRIES TOGETHER INTO A FREE SPACE CHAIN.
  2474. #
  2475.  
  2476. P<LLRQ> = MAT$FWA[MAT$ENTRY"LLRQ"]; # POINT TO FIRST ENTRY #
  2477. CHN$BOC[LCHN"LL$FRSPC"] = P<LLRQ>; # BEGINNING OF CHAIN #
  2478.  
  2479. SLOWFOR I = 1 STEP 1 ##
  2480. WHILE I LQ MAT$COUNT[MAT$ENTRY"LLRQ"]
  2481. DO
  2482. BEGIN # FOR ALL *LLRQ* ENTRIES #
  2483. CHN$EOC[LCHN"LL$FRSPC"] = P<LLRQ>; # END OF CHAIN POINTER #
  2484. LLR$LINK1[0] = P<LLRQ> + LLRQENTL; # LINK TO NEXT ENTRY #
  2485. P<LLRQ> = LLR$LINK1[0]; # POINT TO NEXT ENTRY #
  2486. END # FOR ALL *LLRQ* ENTRIES #
  2487.  
  2488. P<LLRQ> = P<LLRQ> - LLRQENTL; # POINT TO LAST ENTRY OF CHAIN #
  2489. LLR$LINK1[0] = 0; # CLEAR LAST POINTER #
  2490.  
  2491.  
  2492. #
  2493. * CHAIN ALL *RTRQ* ENTRIES TOGETHER INTO A FREE SPACE CHAIN.
  2494. #
  2495.  
  2496. P<LINKWRD> = MAT$FWA[MAT$ENTRY"RTRQ"]; # POINT TO FIRST ENTRY #
  2497. CHN$BOC[LCHN"RTD$FRSPC"] = P<LINKWRD>; # BEGINNING OF CHAIN #
  2498.  
  2499. SLOWFOR I = 1 STEP 1 ##
  2500. WHILE I LQ MAT$COUNT[MAT$ENTRY"RTRQ"]
  2501. DO
  2502. BEGIN # FOR ALL *RTRQ* ENTRIES #
  2503. CHN$EOC[LCHN"RTD$FRSPC"] = P<LINKWRD>; # END OF CHAIN #
  2504. LINK$ADR[0] = P<LINKWRD> + TDAMLEN + 1; # LINK TO NEXT ENTRY #
  2505. P<LINKWRD> = LINK$ADR[0]; # POINT TO NEXT ENTRY #
  2506. END # FOR ALL *RTRQ* ENTRIES #
  2507.  
  2508. P<LINKWRD> = P<LINKWRD> - TDAMLEN - 1; # POINT TO LAST ENTRY #
  2509. LINK$ADR[0] = 0; # CLEAR LAST POINTER #
  2510.  
  2511.  
  2512. #
  2513. * CHAIN ALL *FCTQ* ENTRIES TOGETHER INTO A FREE SPACE CHAIN.
  2514. #
  2515.  
  2516. P<FCTQ> = MAT$FWA[MAT$ENTRY"FCTQ"]; # POINT TO FIRST ENTRY #
  2517. CHN$BOC[LCHN"FCT$FRSPC"] = P<FCTQ>; # BEGINNING OF CHAIN #
  2518.  
  2519. SLOWFOR I = 1 STEP 1 ##
  2520. WHILE I LQ MAT$COUNT[MAT$ENTRY"FCTQ"]
  2521. DO
  2522. BEGIN # FOR ALL *FCTQ* ENTRIES #
  2523. CHN$EOC[LCHN"FCT$FRSPC"] = P<FCTQ>; # END OF CHAIN POINTER #
  2524. FCTQLINK1[0] = P<FCTQ> + FCTQHL + FCTENTL; # LINK TO NEXT #
  2525. P<FCTQ> = FCTQLINK1[0]; # POINT TO NEXT ENTRY #
  2526. END # FOR ALL *FCTQ* ENTRIES #
  2527.  
  2528. P<FCTQ> = P<FCTQ> - FCTQHL - FCTENTL; # POINT TO LAST ENTRY #
  2529. FCTQLINK1[0] = 0; # CLEAR LAST POINTER #
  2530.  
  2531.  
  2532. #
  2533. * SET THE AUTHORIZED FLAG IN THE FIRST *BST* ENTRY.
  2534. #
  2535.  
  2536. P<BST> = MAT$FWA[MAT$ENTRY"BST"]; # POINT TO FIRST ENTRY #
  2537. BST$AUTH[1] = TRUE; # SET AUTHORIZED FLAG #
  2538.  
  2539.  
  2540. #
  2541. * INITIALIZE THE CATALOG *FET*.
  2542. #
  2543.  
  2544. P<FETSET> = MAT$FWA[MAT$ENTRY"CAT$FET"]; # POINT TO *FCT* FET #
  2545.  
  2546. FIRST = MAT$FWA[MAT$ENTRY"CAT$BUF"]; # FIRST LOCATION POINTER #
  2547. FET$IN[0] = FIRST; # IN POINTER #
  2548. FET$OUT[0] = FIRST; # OUT POINTER #
  2549. FET$LIM[0] = FIRST + SEQBL; # LIMIT #
  2550.  
  2551. FCTFADR = MAT$FWA[MAT$ENTRY"CAT$FET"];
  2552. P<FCTFET> = FCTFADR;
  2553.  
  2554.  
  2555. #
  2556. * INITIALIZE THE MAP *FET*.
  2557. #
  2558.  
  2559. P<FETSET> = MAT$FWA[MAT$ENTRY"MAP$FET"]; # POINT TO *MAP* FET #
  2560.  
  2561. FIRST = MAT$FWA[MAT$ENTRY"MAP$BUF"]; # FIRST LOCATION POINTER #
  2562. FET$IN[0] = FIRST; # IN POINTER #
  2563. FET$OUT[0] = FIRST; # OUT POINTER #
  2564. FET$LIM[0] = FIRST + MAPBUFL; # LIMIT #
  2565.  
  2566. MAPFADR = MAT$FWA[MAT$ENTRY"MAP$FET"];
  2567. P<MAPFET> = MAPFADR;
  2568.  
  2569. #
  2570. * INITIALIZE THE TEMPORARY *FET*.
  2571. #
  2572.  
  2573. P<FETSET> = MAT$FWA[MAT$ENTRY"TEMP$FET"];
  2574.  
  2575. FIRST = MAT$FWA[MAT$ENTRY"TEMP$BUF"]; # FIRST LOCATION POINTER #
  2576. FET$IN[0] = FIRST; # IN POINTER #
  2577. FET$OUT[0] = FIRST; # OUT POINTER #
  2578. FET$LIM[0] = FIRST + TBUFL; # LIMIT #
  2579.  
  2580. TFETADR = MAT$FWA[MAT$ENTRY"TEMP$FET"];
  2581. P<TFET> = TFETADR;
  2582.  
  2583. #
  2584. * INITIALIZE THE POINTERS TO THE BASED ARRAYS.
  2585. #
  2586.  
  2587. ASTBADR = MAT$FWA[MAT$ENTRY"AST$BUF"];
  2588.  
  2589. FCTBADR = MAT$FWA[MAT$ENTRY"CAT$BUF"];
  2590. P<FCTBUF> = FCTBADR;
  2591.  
  2592. MAPBADR = MAT$FWA[MAT$ENTRY"MAP$BUF"];
  2593. P<MAPBUF> = MAPBADR;
  2594.  
  2595. TBUFADR = MAT$FWA[MAT$ENTRY"TEMP$BUF"];
  2596. P<TBUF> = TBUFADR;
  2597.  
  2598. WBUFADR = MAT$FWA[MAT$ENTRY"TEMP$WB"];
  2599. P<WBUF> = WBUFADR;
  2600.  
  2601. OCTLEN = MAT$COUNT[MAT$ENTRY"OCT"];
  2602. OCTADR = MAT$FWA[MAT$ENTRY"OCT"];
  2603. P<OCT> = OCTADR;
  2604.  
  2605. OMTADR = MAT$FWA[MAT$ENTRY"OMT"];
  2606. P<OMT> = OMTADR;
  2607.  
  2608. PRMBADR = MAT$FWA[MAT$ENTRY"PREAMBLE"];
  2609. P<PRMBUF> = PRMBADR;
  2610.  
  2611. LTCTPTR = MAT$FWA[MAT$ENTRY"LTCT"];
  2612. P<LTCT> = LTCTPTR;
  2613.  
  2614. UDTCADR = MAT$FWA[MAT$ENTRY"UDT$CONT"];
  2615. P<UDT$CN> = UDTCADR + 1; # HEADER NOT INCLUDED #
  2616.  
  2617. UDTSADR = MAT$FWA[MAT$ENTRY"UDT$SM"];
  2618. P<UDT$SMA> = UDTSADR;
  2619.  
  2620. P<LABEL$CART> = MAT$FWA[MAT$ENTRY"LABBUF"];
  2621.  
  2622. MWRBADR = MAT$FWA[MAT$ENTRY"MW$BUFS"];
  2623.  
  2624. MRDBADR = MAT$FWA[MAT$ENTRY"MR$BUFS"];
  2625.  
  2626. SBTADR = MAT$FWA[MAT$ENTRY"SBT"];
  2627.  
  2628. #
  2629. * PUT THE FAMILY NAMES INTO THE *MRFT* TABLE.
  2630. #
  2631.  
  2632. P<MRFT> = MAT$FWA[MAT$ENTRY"MRFT"]; # POINT TO FIRST ENTRY #
  2633.  
  2634. SLOWFOR I = 1 STEP 1 WHILE I LQ FAMCNT
  2635. DO
  2636. BEGIN # FOR ALL *MRFT* ENTRIES #
  2637. MSGTEMP = NAMEFAM[I];
  2638. BZFILL(MSGTEMP,ZEROFILL,FILLSIZE);
  2639. MRFTFAM[(I-1)] = MSGTEMP; # MOVE FAMILY NAME #
  2640. END # FOR ALL *MRFT* ENTRIES #
  2641.  
  2642.  
  2643. END # INITTS #
  2644.  
  2645. TERM
  2646. PROC OPENCAT;
  2647.  
  2648. # TITLE OPENCAT - OPENS THE MAP AND CATALOG FILES. #
  2649.  
  2650. BEGIN # OPENCAT #
  2651.  
  2652. #
  2653. ** OPENCAT - OPENS MAP AND CATALOG FILES.
  2654. *
  2655. * THIS ROUTINE CALLS *MOPEN* AND *COPEN* TO OPEN THE *SM* MAPS
  2656. * AND THE *SFM* CATALOGS. IT ALSO REBUILDS THE FREE AU
  2657. * COUNTS IN THE *AST* TABLES AND UPDATES THE PREAMBLES.
  2658. *
  2659. * PROC OPENCAT.
  2660. *
  2661. * ENTRY USES THE LIST OF LOGICAL *SM* NUMBERS, THE LIST
  2662. * OF FAMILIES WITH 8 *SFM* CATALOGS, AND THE CATALOGS
  2663. * OF THE FAMILIES WITH 8 *SFM* CATALOGS.
  2664. *
  2665. * EXIT MAP AND CATALOG FILES HAVE BEEN OPENED AND ALL *AST*
  2666. * TABLES HAVE BEEN UPDATED.
  2667. *
  2668. * MESSAGES 1) AST UPDATED.
  2669. * PFN=PFN, FAMILY=FAMILY, UI=UI.
  2670. * SUBCATALOG SM ID=ID.
  2671. *
  2672. * 2) ATTACH ERROR ON SFM SMMAP.
  2673. * PFN=PFN, FAMILY=FAMILY, UI=UI.
  2674. *
  2675. * 3) ATTACH ERROR ON SFM SUBFAMILY CATALOG.
  2676. * PFN=PFN, FAMILY=FAMILY, UI=UI.
  2677. *
  2678. * 4) CIO ERROR ON SFM SMMAP.
  2679. * PFN=PFN, FAMILY=FAMILY, UI=UI.
  2680. *
  2681. * 5) CIO ERROR ON SFM SUBFAMILY CATALOG.
  2682. * PFN=PFN, FAMILY=FAMILY, UI=UI.
  2683. *
  2684. * 6) EXEC ABNORMAL, OPENCAT.
  2685. *
  2686. * 7) INITIALIZATION PROBLEMS -
  2687. * NO SMMAP FOUND.
  2688. #
  2689.  
  2690. #
  2691. **** PROC OPENCAT - XREF LIST BEGIN.
  2692. #
  2693.  
  2694. XREF
  2695. BEGIN
  2696. PROC ABORT; # CALLS *ABORT* MACRO #
  2697. PROC ACQ$FCT; # ACQUIRES AN *FCTQ* ENTRY #
  2698. PROC BZFILL; # BLANKS OR ZERO FILLS WORD #
  2699. PROC COPEN; # OPENS AN *MSG* CATALOG #
  2700. PROC CRAST; # CREATES AN *AST* ENTRY #
  2701. PROC CRDAST; # READS THE *AST* TABLE #
  2702. PROC MESSAGE; # CALLS *MESSAGE* MACRO #
  2703. PROC MOPEN; # OPEN A *SM* MAP #
  2704. PROC RMVBLNK; # REMOVE MULTIPLE BLANKS #
  2705. PROC RLS$FCT; # RELEASE AN *FCTQ* ENTRY #
  2706. PROC SETPFP; # SETS USER INDEX AND FAMILY #
  2707. PROC UASTPRM; # UPDATE *AST* AND PREAMBLE #
  2708. FUNC XCDD C(3); # INTEGER TO DECIMAL DISPLAY #
  2709. FUNC XCOD; # CHANGE OCTAL TO DISPLAY CODE #
  2710. PROC XWOD; # CHANGE INTEGER TO OCTAL #
  2711. END
  2712.  
  2713. #
  2714. **** PROC OPENCAT - XREF LIST END.
  2715. #
  2716.  
  2717. DEF QRADDR #0#; # ADDRESS OF *HLRQ* ENTRY #
  2718.  
  2719. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  2720.  
  2721. *CALL COMBFAS
  2722. *CALL COMBBZF
  2723. *CALL COMBCMS
  2724. *CALL COMBCMD
  2725. *CALL COMBMCT
  2726. *CALL COMBPFP
  2727. *CALL COMBUDT
  2728. *CALL COMXCTF
  2729. *CALL COMXINT
  2730. *CALL COMXMSC
  2731. *CALL COMSPFM
  2732.  
  2733. ITEM ACCM B; # FILE ACCESS MODE FLAG #
  2734. ITEM CER U; # *ACQ$FCT* RETURN CODE #
  2735. ITEM CR U; # *CRDAST* RETURN STATUS #
  2736. ITEM CSNOTFD B; # *SMMAP* NOT FOUND FLAG #
  2737. ITEM FCTX U; # LOOP INDEX - FCT ORDINAL #
  2738. ITEM FMX U; # LOOP INDEX - FAMILY #
  2739. ITEM FOUND B; # ITEM FOUND FLAG #
  2740. ITEM MMM U; # INDEX #
  2741. ITEM MOPENCALL B; # *MOPEN* CALL FLAG #
  2742. ITEM MSGTEMP C(8); # ITEM FOR *BZFILL* #
  2743. ITEM QADDR U; # ADDRESS OF *FCTQ* ENTRY #
  2744. ITEM RSTATUS U; # ERROR STATUS FROM *MOPEN* #
  2745. ITEM SFX U; # LOOP INDEX - SUBFAMILY #
  2746. ITEM SMX U; # LOOP INDEX - STORAGE MODULE #
  2747. ITEM STAT U; # RETURN STATUS #
  2748. ITEM UI U; # USER INDEX #
  2749.  
  2750. #
  2751. * ARRAY TO HOLD DATA FROM *XCDD*.
  2752. #
  2753.  
  2754. ARRAY ARTEMP[0:0] S(1);
  2755. BEGIN
  2756. ITEM TEMPCHAR C(00,00,10); # TEMPORARY CHARACTER ITEM #
  2757. ITEM CHARSUB C(00,00,01); # SUBCATALOG *SM* *ID* #
  2758. END
  2759.  
  2760. ARRAY BADDR[0:0] P(FCTENTL); # *FCT* BUFFER ADDRESS #
  2761. ;
  2762.  
  2763. ARRAY BADSUB[0:0] P(3);
  2764. BEGIN
  2765. ITEM BAD$ID C(00,00,20) = [" SUBCATALOG SM ID="]; # ID #
  2766. ITEM BAD$SUB C(02,00,01); # BAD *SM* NUMBER #
  2767. ITEM BAD$ZRO U(02,18,12) = [0]; # ZERO TERMINATOR #
  2768. END
  2769.  
  2770. ARRAY CAT[0:0] P(1); # CATALOG FILE NAME #
  2771. BEGIN # CAT #
  2772. ITEM CAT$PFN C(00,00,07) = ["SFMCAT "]; # SFMCAT #
  2773. ITEM CAT$UNID C(00,36,01); # UNIQUE IDENTIFIER #
  2774. END # CAT #
  2775.  
  2776. ARRAY DIS[0:0] P(2);
  2777. BEGIN
  2778. ITEM DIS$UI C(01,24,06); # USER INDEX IN DISPLAY CODE #
  2779. END
  2780.  
  2781. ARRAY MAP[0:0] P(1);
  2782. BEGIN # MAP #
  2783. ITEM MAP$PFN C(00,00,06) = ["SMMAP "]; # SMMAP #
  2784. ITEM MAP$UNID C(00,30,01); # UNIQUE IDENTIFIER #
  2785. END # MAP #
  2786.  
  2787.  
  2788. #
  2789. * MESSAGE BUFFER.
  2790. #
  2791.  
  2792. ARRAY MSGBUF[0:0] P(5);
  2793. BEGIN # ARRAY MSGBUF #
  2794. ITEM MSG$LINE C(00,00,40); # MESSAGE LINE #
  2795. ITEM MSG$RZRO C(04,00,12); # ZERO BYE TERMINATOR #
  2796. END # ARRAY MSGBUF #
  2797.  
  2798. ARRAY REAL$AST[1:ASTENTL] S(ASTENTW);; # BUFFER FOR *AST* TABLE
  2799.   #
  2800.  
  2801. SWITCH CERJMP:CMASTAT
  2802. CNOERRJ:NOERR, # NO ERRORS #
  2803. CINTLKJ:INTLK, # CATALOG/MAP FILE INTERLOCKED #
  2804. CFOPENJ:FOPEN, # CATALOG/MAP FILE ALREADY OPEN #
  2805. CCIOERRJ:CIOERR, # CIO ERROR #
  2806. CATTERRJ:ATTERR, # CATALOG/MAP ATTACH ERROR #
  2807. COCTFULLJ:OCTFULL; # OPEN CATALOG TABLE FULL #
  2808.  
  2809. SWITCH CGERJMP:CMASTAT
  2810. CGNOERRJ:NOERR, # NO ERRORS #
  2811. CGINTLKJ:INTLK, # CATALOG/MAP FILE INTERLOCKED #
  2812. CGNOTOPENJ:NOTOPEN, # CATALOG/MAP FILE NOT OPEN #
  2813. CGNOSUBCATJ:NOSUBCAT, # NO SUCH SUBCATALOG #
  2814. CGCIOERRJ:CIOERR, # *CIO* ERROR #
  2815. CGORDERRJ:ORDERR; # ORDINAL OUT OF RANGE #
  2816.  
  2817. SWITCH CRERJMP:CMASTAT
  2818. CRNOERRJ:NOERR, # NO ERRORS #
  2819. CRINTLKJ:INTLK, # CATALOG/MAP FILE INTERLOCKED #
  2820. CRNOTOPENJ:NOTOPEN, # CATALOG/MAP FILE NOT OPEN #
  2821. CRNOSUBCATJ:NOSUBCAT, # NO SUCH SUBCATALOG #
  2822. CRCIOERRJ:CIOERR; # *CIO* ERROR #
  2823.  
  2824. SWITCH MERJMP:CMASTAT
  2825. MNOERRJ:NOERR, # NO ERRORS #
  2826. MINTLKJ:INTLK, # CATALOG/MAP FILE INTERLOCKED #
  2827. MFOPENJ:FOPEN, # CATALOG/MAP FILE ALREADY OPEN #
  2828. MCIOERRJ:CIOERR, # *CIO* ERROR #
  2829. MATTERRJ:ATTERR, # CATALOG/MAP ATTACH ERROR #
  2830. MOCTFULLJ:OCTFULL; # OPEN CATALOG TABLE FULL #
  2831. CONTROL EJECT;
  2832.  
  2833. #
  2834. * CONSTRUCT THE MAP FILE NAME AND CALL *MOPEN* TO OPEN EACH *SM*
  2835. * MAP.
  2836. #
  2837.  
  2838.  
  2839. MSGTEMP = FAM$NAME[DEFAULTORD];
  2840. BZFILL(MSGTEMP,TYPFILL"BFILL",7);
  2841. MSGFAM[0] = MSGTEMP; # FAMILY NAME TO MESSAGE #
  2842.  
  2843. #
  2844. * ISSUE A *SETPFP* SO THE MAP FILE CAN BE ATTACHED.
  2845. #
  2846.  
  2847. PFP$UI = DEF$UI; # SET USER INDEX FOR *SETPFP* #
  2848. PFP$FAM = FAM$NAME[DEFAULTORD]; # SET FAMILY NAME FOR *SETPFP* #
  2849. PFP$FG1 = TRUE; # SET FAMILY BIT FOR *SETPFP* #
  2850. PFP$FG4 = TRUE; # SET INDEX BIT FOR *SETPFP* #
  2851. SETPFP(PFP); # SET USER INDEX AND FAMILY #
  2852.  
  2853. XWOD(DEF$UI,DIS); # CHANGE OCTAL TO DISPLAY CODE #
  2854. MSGUI[0] = DIS$UI[0]; # SET USER INDEX AND FAMILY #
  2855.  
  2856. P<UDT$SMA> = UDTSADR;
  2857. SLOWFOR SMX = 1 STEP 1 UNTIL UDT$LINE$SMN[0]
  2858. DO
  2859. BEGIN # PROCESS FOR EACH LOGICAL *SM* NUMBER #
  2860. MMM = SM$ID[1];
  2861. MAP$UNID[0] = SM$ID[1];
  2862. MSGTEMP = MAP$PFN[0];
  2863. BZFILL(MSGTEMP,TYPFILL"BFILL",7);
  2864. MSGPFN[0] = MSGTEMP; # PLACE FILE NAME INTO MESSAGE #
  2865. BZFILL(MAP,TYPFILL"ZFILL",7); # TYPFILL"ZFILL" FILE NAME #
  2866.  
  2867. RSTATUS = 0;
  2868. MOPEN(MMM,MAP$PFN[0],"M",RSTATUS);
  2869.  
  2870. #
  2871. * SIMULATED CASE STATEMENT FOR *MOPEN* PROCESSING.
  2872. #
  2873.  
  2874. GOTO MERJMP[RSTATUS];
  2875.  
  2876. MCIOERRJ:
  2877. MSG$LINE[0] = " CIO ERROR ON SFM SMMAP.";
  2878. MESSAGE(MSGBUF,UDFL1); # MESSAGE TO DAYFILE #
  2879. MSG$LINE[0] = MSG$TEXT[0];
  2880. RMVBLNK(MSGBUF[0],40);
  2881. MESSAGE(MSGBUF,UDFL1); # MESSAGE TO DAYFILE #
  2882. CSNOTFD = TRUE;
  2883. GOTO ENDCASE0; # COMMON EXIT #
  2884.  
  2885. MATTERRJ:
  2886. MSG$LINE[0] = " ATTACH ERROR ON SFM SMMAP.";
  2887. MESSAGE(MSGBUF,UDFL1);
  2888.  
  2889. MSG$LINE[0] = MSG$TEXT[0];
  2890. RMVBLNK(MSGBUF[0],40);
  2891. MESSAGE(MSGBUF,UDFL1);
  2892. CSNOTFD = TRUE;
  2893. GOTO ENDCASE0; # COMMON EXIT #
  2894.  
  2895. MNOERRJ:
  2896. MINTLKJ:
  2897. ENDCASE0:
  2898. P<UDT$SMA> = P<UDT$SMA> + SMALT;
  2899.  
  2900. #
  2901. * END OF CASE STATEMENT FOR *MOPEN* ERROR RESPONSE.
  2902. #
  2903.  
  2904. END # PROCESS FOR EACH LOGICAL *SM* NUMBER #
  2905.  
  2906. P<UDT$SMA> = UDTSADR; # RESET SMA ADDRESS #
  2907.  
  2908. IF CSNOTFD
  2909. THEN
  2910. BEGIN # NO SMMAP FOUND #
  2911. FATALERR = TRUE;
  2912.  
  2913. MSG$LINE[0] = " INITIALIZATION PROBLEMS -";
  2914. MESSAGE(MSGBUF[0],UDFL1);
  2915.  
  2916. MSG$LINE[0] = " NO SMMAP FOUND ";
  2917. MESSAGE(MSGBUF[0],UDFL1);
  2918. END # NO SMMAP FOUND #
  2919.  
  2920. CONTROL EJECT;
  2921.  
  2922. #
  2923. * CONSTRUCT THE *SFM* CATALOG FILE NAME FROM THE FAMILY NAME LIST.
  2924. * CALL *COPEN* TO OPEN THE *SFM* CATALOG. SCAN THE *FCT* TO
  2925. * RECONSTRUCT THE FREE VOLUME CHAIN AND COUNT THE
  2926. * AU AVAIABLE FOR ALLOCATION.
  2927. #
  2928.  
  2929. SLOWFOR FMX = 1 STEP 1 UNTIL FAMCNT
  2930. DO
  2931. BEGIN # FOR EACH FAMILY WITH EIGHT SUBFAMILY CATALOGS #
  2932.  
  2933. MSGTEMP = NAMEFAM[FMX];
  2934. BZFILL(MSGTEMP,TYPFILL"BFILL",7);
  2935. MSGFAM[0] = MSGTEMP;
  2936.  
  2937. SLOWFOR SFX = 0 STEP 1 UNTIL MAXSF
  2938. DO
  2939. BEGIN # FOR EACH SUBFAMILY #
  2940.  
  2941. UI = DEF$UI + SFX; # CALCULATE USER INDEX #
  2942. XWOD(UI,DIS);
  2943. MSGUI[0] = DIS$UI[0];
  2944.  
  2945. #
  2946. * ISSUE A *SETPFP* SO THE SFMCAT FILE CAN BE ATTACHED.
  2947. #
  2948.  
  2949. PFP$UI = DEF$UI + SFX; # SET USER INDEX FOR *SETPFP* #
  2950. PFP$FAM = NAMEFAM[FMX]; # SET FAMILY NAME FOR *SETPFP* #
  2951. PFP$FG1 = TRUE; # SET FAMILY BIT FOR *SETPFP* #
  2952. PFP$FG4 = TRUE; # SET INDEX BIT FOR *SETPFP* #
  2953. SETPFP(PFP); # SET USER INDEX AND FAMILY #
  2954.  
  2955. CAT$UNID[0] = XCOD(SFX); # CHANGE INDEX TO DISPLAY CODE #
  2956.  
  2957. MSGPFN[0] = CAT$PFN[0]; # PLACE FILE NAME INTO MESSAGE #
  2958.  
  2959. ACCM = FALSE; # RANDOM ACCESS MODE #
  2960. STAT = 0;
  2961. COPEN(NAMEFAM[FMX],SFX,CAT,"M",ACCM,STAT);
  2962.  
  2963. #
  2964. * SIMULATED CASE STATEMENT FOR *COPEN* ERROR RESPONSE.
  2965. #
  2966.  
  2967. GOTO CERJMP[STAT];
  2968.  
  2969. CCIOERRJ:
  2970. CINTLKJ:
  2971.  
  2972. TEST SFX; # NEXT CATALOG #
  2973.  
  2974. CATTERRJ:
  2975. MSG$LINE[0] = "ATTACH ERROR ON SFM SUBFAMILY CATALOG.";
  2976. MESSAGE(MSGBUF[0],UDFL1);
  2977.  
  2978. MSG$LINE[0] = MSG$TEXT[0];
  2979. RMVBLNK(MSGBUF[0],40);
  2980. MESSAGE(MSGBUF[0],UDFL1);
  2981. TEST SFX; # NEXT CATALOG #
  2982.  
  2983. CNOERRJ:
  2984.  
  2985. #
  2986. * END OF CASE STATEMENT FOR *COPEN* ERROR RESPONSE.
  2987. #
  2988.  
  2989. #
  2990. * THE FIRST WORD OF THE SUBCATALOG PREAMBLES
  2991. * ARE SCANNED TO DETERMINE WHICH SUBCATALOGS EXIST.
  2992. * FOR EACH EXISTING SUBCATALOG, THE NUMBER OF *FCT* ENTRIES
  2993. * TO SCAN IS OBTAINED FROM THE FIRST WORD OF THE SUBCATALOG
  2994. * PREAMBLE.
  2995. #
  2996.  
  2997. SLOWFOR SMX = 1 STEP 1 UNTIL MAXSM
  2998. DO
  2999. BEGIN # FOR EACH SUBCATALOG #
  3000. IF PRM$SCW1[SMX] EQ 0
  3001. THEN
  3002. BEGIN
  3003. TEST SMX;
  3004. END
  3005.  
  3006. #
  3007. * READ THE CATALOG *AST* AND UPDATE IT BASED ON THE
  3008. * ANALYSIS OF EACH *FCT* ENTRY IN THE SUBCATALOG.
  3009. #
  3010.  
  3011. CRDAST(NAMEFAM[FMX],SFX,PRM$SMID[SMX], ##
  3012. ASTBADR,QRADDR,CR);
  3013.  
  3014. #
  3015. * SIMULATED CASE STATEMENT FOR *CRDAST* ERROR PROCESSING.
  3016. #
  3017.  
  3018. GOTO CRERJMP[CR];
  3019.  
  3020. CRINTLKJ:
  3021. CRCIOERRJ:
  3022. TEST SFX;
  3023.  
  3024. CRNOERRJ:
  3025.  
  3026. #
  3027. * END OF SIMULATED CASE STATEMENT FOR *CRDAST* ERROR PROCESSING.
  3028. #
  3029.  
  3030. SLOWFOR FCTX = MAXGRT STEP 1 ##
  3031. WHILE FCTX LQ (PRM$ENTRC[SMX] + 15) ##
  3032. AND PRM$ENTRC[SMX] GR 0
  3033. DO
  3034. BEGIN # FOR ALL *FCT* ENTRIES FOR THIS SUBCATALOG #
  3035.  
  3036. ACQ$FCT(NAMEFAM[FMX],SFX,PRM$SMID[SMX],FCTX, ##
  3037. QADDR,QRADDR,CER );
  3038.  
  3039. #
  3040. * SIMULATED CASE STATEMENT FOR *ACQ$FCT* ERROR PROCESSING.
  3041. #
  3042.  
  3043. GOTO CGERJMP[CER];
  3044.  
  3045. CGCIOERRJ:
  3046. CGINTLKJ:
  3047. TEST SFX;
  3048.  
  3049. CGNOERRJ:
  3050.  
  3051. CRAST(FCTX,QADDR,ASTBADR);
  3052. UASTPRM(NAMEFAM[FMX],SFX,SMX,QADDR,STAT);
  3053. RLS$FCT(QADDR,0,CER);
  3054. IF CER NQ CMASTAT"NOERR"
  3055. THEN
  3056. BEGIN
  3057. GOTO RLSERR;
  3058. END
  3059.  
  3060. END # FOR ALL *FCT* ENTRIES FOR THIS SUBCATALOG #
  3061.  
  3062. #
  3063. * END OF SIMULATED CASE STATEMENT FOR *ACQ$FCT* PROCESSING.
  3064. #
  3065.  
  3066. TEMPCHAR[0] = PRM$SMID[SMX];
  3067. BAD$SUB[0] = CHARSUB[0];
  3068.  
  3069. MSG$LINE[0] = " AST UPDATED.";
  3070. MESSAGE(MSGBUF[0],UDFL1);
  3071.  
  3072. MSG$LINE[0] = MSG$TEXT[0];
  3073. RMVBLNK(MSGBUF[0],40);
  3074. MESSAGE(MSGBUF[0],UDFL1);
  3075.  
  3076. MESSAGE(BADSUB[0],UDFL1);
  3077.  
  3078. END # FOR EACH SUBCATALOG #
  3079.  
  3080. END # FOR EACH SUBFAMILY #
  3081.  
  3082. END # FOR EACH FAMILY WITH EIGHT SUBFAMILY CATALOGS #
  3083.  
  3084. RETURN;
  3085.  
  3086. MOCTFULLJ:
  3087. MFOPENJ:
  3088. COCTFULLJ:
  3089. CFOPENJ:
  3090. CRNOTOPENJ:
  3091. CRNOSUBCATJ:
  3092. CGNOTOPENJ:
  3093. CGNOSUBCATJ:
  3094. CGORDERRJ:
  3095. RLSERR:
  3096. FE$RTN[0] = "OPENCAT.";
  3097. MESSAGE(FEMSG,UDFL1); # EXEC ABNORMAL, OPENCAT #
  3098. ABORT;
  3099.  
  3100.  
  3101. END # OPENCAT #
  3102.  
  3103. TERM
  3104. PROC SET0100;
  3105. # TITLE SET0100 - PRESETS COMMON AREA(S) USED BY (1,0). #
  3106.  
  3107. BEGIN # SET0100 #
  3108.  
  3109. #
  3110. ** SET0100 - PRESETS COMMON AREA USED BY (1,0).
  3111. *
  3112. * *SET0100* IS A NON-EXECUTABLE ROUTINE WHICH PRESETS
  3113. * ANY COMMON AREA(S) USED EXCLUSIVELY BY THE (1,0) OVERLAY.
  3114. * THIS IS DONE VIA A *CONTROL PRESET* DIRECTIVE.
  3115. *
  3116. #
  3117.  
  3118. DEF LISTCON #0#;
  3119. *CALL COMBFAS
  3120.  
  3121. CONTROL PRESET;
  3122.  
  3123. *CALL COMXINT
  3124. END # SET0100 #
  3125.  
  3126. TERM
  3127. PROC TERMCAT;
  3128. # TITLE TERMCAT - CLOSES THE CATALOGS AND SMMAPS. #
  3129. BEGIN # TERMCAT #
  3130.  
  3131. #
  3132. ** *TERMCAT* - CLOSES THE CATALOGS AND SMAMAPS.
  3133. *
  3134. * THIS PROCEDURE CLOSES THE SFM CATALOGS AND SMAMAPS.
  3135. *
  3136. * PROC TERMCAT
  3137. *
  3138. * EXIT EACH SFM CATALOG AND SMMAP IS CLOSED.
  3139. #
  3140.  
  3141.  
  3142. #
  3143. **** PROC TERMCAT - XREF LIST BEGIN.
  3144. #
  3145.  
  3146. XREF
  3147. BEGIN
  3148. PROC CCLOSE; # CLOSES THE CATALOGS #
  3149. PROC MCLOSE; # CLOSES THE SMAMAPS #
  3150. END
  3151.  
  3152. #
  3153. **** PROC TERMCAT - XREF LIST END.
  3154. #
  3155.  
  3156.  
  3157. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  3158. *CALL COMBFAS
  3159. *CALL COMBCMD
  3160.  
  3161.  
  3162. ITEM CSTAT U; # STATUS RETURNED FROM CCLOSE #
  3163. ITEM I U; # LOOP COUNTER #
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169. #
  3170. * CLOSE THE CATALOGS FOR EACH FAMILY AND SUB-FAMILY
  3171. #
  3172.  
  3173. FASTFOR I = 1 STEP 1 UNTIL OCTLEN
  3174. DO
  3175. BEGIN
  3176. IF OCT$W1[I] NQ 0
  3177. THEN
  3178. BEGIN
  3179. CCLOSE(OCT$FAM[I],OCT$SUBF[I],0,CSTAT);
  3180. END
  3181.  
  3182. END
  3183.  
  3184. #
  3185. * CLOSE ALL THE SMAMAPS
  3186. #
  3187.  
  3188. FASTFOR I = 1 STEP 1 UNTIL MAXSM
  3189. DO
  3190. BEGIN
  3191. IF OMT$OPEN[I]
  3192. THEN
  3193. BEGIN
  3194. MCLOSE(I,CSTAT);
  3195. END
  3196.  
  3197. END
  3198.  
  3199. END # TERMCAT #
  3200.  
  3201. TERM # TERMCAT #
  3202. PROC TERMSCP;
  3203.  
  3204. # TITLE TERMSCP - RELINQUISHES SCP STATUS. #
  3205. BEGIN # TERMSCP #
  3206.  
  3207. #
  3208. ** TERMSCP - RELINQUISHES SCP STATUS.
  3209. *
  3210. * THIS PROCEDURE ISSUES AN SF.EXIT.
  3211. *
  3212. * PROC TERMSCP
  3213. *
  3214. #
  3215.  
  3216.  
  3217. #
  3218. **** PROC TERMSCP - XREF LIST BEGIN.
  3219. #
  3220.  
  3221. XREF
  3222. BEGIN
  3223. PROC SFCALL;
  3224. END
  3225.  
  3226. #
  3227. **** PROC TERMSCP - XREF LIST END.
  3228. #
  3229.  
  3230.  
  3231. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  3232. *CALL COMBFAS
  3233. *CALL COMBUCR
  3234.  
  3235.  
  3236.  
  3237.  
  3238. #
  3239. * ISSUE AN SF.EXIT.
  3240. #
  3241.  
  3242. SFFC = SFEXIT;
  3243. SFCALL(SFBLKPTR,RCL);
  3244. END # TERMSCP #
  3245.  
  3246. TERM
  3247. PROC WRAPUP;
  3248.  
  3249. # TITLE WRAPUP - WRAP-UP PROCESSING PRIOR TO NORMAL TERMINATION. #
  3250.  
  3251. BEGIN # WRAPUP #
  3252.  
  3253. #
  3254. ** WRAPUP - WRAPUP PROCESSING PRIOR TO NORMAL TERMINATION.
  3255. *
  3256. * THIS PROCEDURE DOES THE WRAP-UP PROCESSING PRIOR TO NORMAL
  3257. * TERMINATION.
  3258. *
  3259. * PROC WRAPUP
  3260. *
  3261. * MESSAGES CPU SECONDS = XXX.
  3262. * CPU PERCENT = XX.X.
  3263. * FL CHANGES = XXX.
  3264. * MAXIMUM FL = XXX.
  3265. * OVERLAY LOADS = XXX.
  3266. * FILES STAGED = XXX.
  3267. * FILES DESTAGED = XXX.
  3268. *
  3269. #
  3270.  
  3271. XREF
  3272. BEGIN
  3273. PROC MESSAGE; # INTERFACE TO *MESSAGE* MACRO #
  3274. PROC RTIME; # INTERFACE TO *RTIME* MACRO #
  3275. PROC TERMCAT; # CLOSES THE CATALOGS AND SMAMAPS
  3276.   #
  3277. PROC TERMSCP; # RELINQUISHES SCP STATUS #
  3278. PROC TIME; # INTERFACE TO *TIME* MACRO #
  3279. FUNC XCDD C(6); # CONVERT TO DECIMAL DISPLAY #
  3280. END
  3281.  
  3282. #
  3283. **** PROC WRAPUP - XREF LIST END.
  3284. #
  3285.  
  3286.  
  3287. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
  3288. *CALL COMBFAS
  3289. *CALL COMXMSC
  3290. *CALL COMXOVL
  3291.  
  3292. ARRAY WRAPMESS [0:0] S(3);
  3293. BEGIN
  3294. ITEM WRAPFILL1 C(00,00,01) = [" "]; # LEADING BLANK #
  3295. ITEM WRAPDESC C(00,06,14); # MSG HEADER #
  3296. ITEM WRAPEQ C(01,30,02) = ["= "]; # EQUAL SIGN #
  3297. ITEM WRAPQTY C(01,42,06); # QUANTITY #
  3298. ITEM WRAPPRD C(02,18,01) = ["."]; # PERIOD #
  3299. ITEM WRAPTERM U(02,24,12) = [0]; # MSG TERMINATOR #
  3300. END
  3301.  
  3302. ARRAY CTIMESTAT [0:0] S(1); # ACCUMULATED JOB TIME #
  3303. BEGIN
  3304. ITEM CTIMSECS U(00,24,24); # JOB SECONDS #
  3305. ITEM CTIMMILS U(00,48,12); # JOB MILLESECONDS #
  3306. END
  3307.  
  3308. ITEM PERCENT I; # PERCENT OF MACHINE TIME #
  3309. ITEM RESULT C(10); # DISPLAY CODE RESULT #
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315. TERMCAT;
  3316.  
  3317. TERMSCP;
  3318.  
  3319. #
  3320. * WRITE SYSTEM DAYFILE MESSAGES.
  3321. #
  3322.  
  3323. WRAPDESC[0] = "CPU SECONDS";
  3324. TIME(CTIMESTAT);
  3325. RESULT = XCDD(CTIMSECS[0]);
  3326. WRAPQTY[0] = C<4,6>RESULT;
  3327. MESSAGE(WRAPMESS,SYSUDF1);
  3328.  
  3329. WRAPDESC[0] = "CPU PERCENT";
  3330. RTIME(RTIMESTAT);
  3331. PERCENT = (CTIMSECS[0] * 10000) / (RTIMSECS[0] - FIRSTRTIME) + 5
  3332. ;
  3333. RESULT = XCDD(PERCENT);
  3334. C<0,4>WRAPQTY[0] = C<4,4>RESULT;
  3335. C<4,1>WRAPQTY[0] = ".";
  3336. C<5,1>WRAPQTY[0] = C<8,1>RESULT;
  3337. MESSAGE(WRAPMESS,SYSUDF1);
  3338.  
  3339. WRAPDESC[0] = "FL CHANGES";
  3340. RESULT = XCDD(NFLCHNG);
  3341. WRAPQTY[0] = C<4,6>RESULT;
  3342. MESSAGE(WRAPMESS,SYSUDF1);
  3343.  
  3344. WRAPDESC[0] = "MAXIMUM FL";
  3345. RESULT = XCDD(MAX$FL);
  3346. WRAPQTY[0] = C<4,6>RESULT;
  3347. MESSAGE(WRAPMESS,SYSUDF1);
  3348.  
  3349. WRAPDESC[0] = "OVERLAY LOADS";
  3350. RESULT = XCDD(OVLDCNT);
  3351. WRAPQTY[0] = C<4,6>RESULT;
  3352. MESSAGE(WRAPMESS,SYSUDF1);
  3353.  
  3354. WRAPDESC[0] = "FILES STAGED";
  3355. RESULT = XCDD(STGCNT);
  3356. WRAPQTY[0] = C<4,6>RESULT;
  3357. MESSAGE(WRAPMESS,SYSUDF1);
  3358.  
  3359.  
  3360. WRAPDESC[0] = "FILES DESTAGED";
  3361. RESULT = XCDD(DSTCNT);
  3362. WRAPQTY[0] = C<4,6>RESULT;
  3363. MESSAGE(WRAPMESS,SYSUDF1);
  3364. END # WRAPUP #
  3365.  
  3366. TERM
1)
FCTX),(QADDR),(ASTADDR
2)
MID),(MIDX),(LINKFAM