ACCCAT

Table Of Contents

  • [00001] PROC BFLUSH1)
1)
QRADR),ERSTAT)
  • [00002] BFLUSH - FLUSHES THE I/O BUFFER.
  • [00006] BFLUSH - FLUSHES THE I/O BUFFER.
  • [00038] PROC CPIOERR
  • [00039] PROC REWRITE
  • [00040] PROC ZSETFET
  • [00094] PROC CADDSC((FAMNM),(SUBF),(SMID ),(NUM),(QRADDR),ERRSTAT)
    • [00095] CADDSC - ADD SUBCATALOG.
    • [00099] CADDSC - ADD SUBCATALOG.
    • [00156] PROC ABORT
    • [00157] PROC BKSPRU
    • [00158] PROC CDEFTF
    • [00159] PROC CPIOERR
    • [00160] PROC MESSAGE
    • [00161] PROC OCTSRCH
    • [00162] PROC READ
    • [00163] PROC REPLCAT
    • [00164] PROC REWIND
    • [00165] PROC RPHR
    • [00166] PROC SETPFP
    • [00167] PROC WPHR
    • [00168] PROC WRITE
    • [00169] PROC WRITEF
    • [00170] PROC WRITEW
    • [00171] PROC ZSETFET
    • [00351] PROC CBUFMAN((FAMNM),(SUBF),(SMID),(FCTORD),(MODF),
      • [00353] CBUFMAN - MANAGE CATALOG *FCT* BUFFER.
      • [00357] CBUFMAN - MANAGE CATALOG *FCT* BUFFER.
      • [00406] PROC BFLUSH
      • [00407] PROC CCLOSE
      • [00408] PROC OCTSRCH
      • [00409] PROC READ
      • [00410] PROC ZSETFET
      • [00516] PROC CCLOSE((FAMNM),(SUBF),(QRADDR),ERRSTAT)
        • [00517] CCLOSE - CLOSE CATALOG.
        • [00521] CCLOSE - CLOSE CATALOG.
        • [00559] PROC OCTSRCH
        • [00560] PROC RETERN
        • [00561] PROC REWRITE
        • [00562] PROC RPHR
        • [00563] PROC WPHR
        • [00564] PROC ZFILL
        • [00565] PROC ZSETFET
        • [00666] PROC CDEFTF(FET,ERSTAT)
        • [00667] CDEFTF - DEFINE TEMPORARY CATALOG.
        • [00671] CDEFTF - DEFINE TEMPORARY CATALOG.
        • [00705] PROC PFD
        • [00706] PROC RETERN
        • [00759] PROC CEXTSC((FAMNM),(SUBF),(SMID ),(NUM),(QRADDR),ERRSTAT)
          • [00760] CEXTSC - EXTEND SUBCATALOG.
          • [00764] CEXTSC - EXTEND SUBCATALOG.
          • [00819] PROC ABORT
          • [00820] PROC BFLUSH
          • [00821] PROC CDEFTF
          • [00822] PROC CPIOERR
          • [00823] PROC MESSAGE
          • [00824] PROC OCTSRCH
          • [00825] PROC READ
          • [00826] PROC READW
          • [00827] PROC REPLCAT
          • [00828] PROC REWIND
          • [00829] PROC SETPFP
          • [00830] PROC WRITEF
          • [00831] PROC WRITEW
          • [00832] PROC ZFILL
          • [00833] PROC ZSETFET
          • [01070] PROC CFLUSH((FAMNM),(SUBF),(QRADDR),ERRSTAT)
            • [01071] CFLUSH - FLUSHES THE CATALOG I/O BUFFER.
            • [01075] CFLUSH - FLUSHES THE CATALOG I/O BUFFER.
            • [01112] PROC BFLUSH
            • [01113] PROC OCTSRCH
            • [01152] PROC CGETFCT((FAMNM),(SUBF),(SMID ),(FCTORD),(BADDR),(QRADDR),
              • [01154] CGETFCT - GET AN *FCT* ENTRY.
              • [01158] CGETFCT - GET AN *FCT* ENTRY.
              • [01204] PROC CBUFMAN
              • [01255] PROC CGETPD((FAMNM),(SUBF),(SMID ),LASTPRG,(QRADDR),ERRSTAT)
                • [01256] CGETPD - GET PURGE DATE.
                • [01260] CGETPD - GET PURGE DATE.
                • [01306] PROC CPIOERR
                • [01307] PROC OCTSRCH
                • [01308] PROC REWIND
                • [01309] PROC RPHR
                • [01310] PROC ZSETFET
                • [01365] PROC CINIT((FAMNM),(SUBF),(FLNM),ERRSTAT)
                  • [01366] CINIT - MSS CATALOG INITIALIZATION.
                  • [01370] CINIT - MSS CATALOG INITIALIZATION.
                  • [01405] PROC PFD
                  • [01406] PROC RETERN
                  • [01407] PROC WRITEF
                  • [01408] PROC WRITEW
                  • [01409] PROC ZSETFET
                  • [01487] PROC CNAME(FLNM)
                  • [01488] CNAME - GET LFN FOR CATALOG.
                  • [01492] CNAME - GET LFN FOR CATALOG.
                  • [01516] FUNC XCDD C(10)
                  • [01547] PROC COPEN((FAMNM),(SUBF),(FLNM),(ATTM),(ACCM),ERRSTAT)
                    • [01548] COPEN - OPEN CATALOG.
                    • [01552] COPEN - OPEN CATALOG.
                    • [01611] PROC CNAME
                    • [01612] PROC CRDPRM
                    • [01613] PROC PFD
                    • [01715] PROC CPIOERR((FAMNM),(SUBF),(QRADDR),ERRSTAT,FET)
                      • [01716] CPIOERR - PROCESS I/O ERROR ON MSF CATALOG.
                      • [01721] CPIOERR - PROCESS I/O ERROR ON MSF CATALOG.
                      • [01757] PROC CCLOSE
                      • [01758] PROC KREQ
                      • [01759] PROC RECALL
                      • [01811] PROC CPUTFCT((FAMNM),(SUBF),(SMID ),(FCTORD),(BADDR),(QRADDR),
                        • [01813] CPUTFCT - PUT AN *FCT* ENTRY.
                        • [01817] CPUTFCT - PUT AN *FCT* ENTRY.
                        • [01867] PROC CBUFMAN
                        • [01920] PROC CPUTPD((FAMNM),(SUBF),(SMID ),(QRADDR),ERRSTAT)
                          • [01921] CPUTPD - PUT PURGE DATE.
                          • [01925] CPUTPD - PUT PURGE DATE.
                          • [01971] PROC CPIOERR
                          • [01972] PROC OCTSRCH
                          • [01973] PROC PDATE
                          • [01974] PROC RPHR
                          • [01975] PROC WPHR
                          • [01976] PROC ZSETFET
                          • [02054] PROC CRCLMLK(ERRSTAT)
                          • [02055] CRCLMLK - RECLAIM CATALOG INTERLOCKS.
                          • [02059] CRCLMLK - RECLAIM CATALOG INTERLOCKS.
                          • [02100] PROC ABORT
                          • [02101] PROC ADD$LNK
                          • [02102] PROC BZFILL
                          • [02103] PROC CRDPRM
                          • [02104] PROC MESSAGE
                          • [02105] PROC PF
                          • [02106] PROC RMVBLNK
                          • [02107] PROC RTIME
                          • [02108] PROC SETPFP
                          • [02109] FUNC XCDD C(10)
                          • [02111] PROC ZFILL
                          • [02253] PROC CRDAST((FAMNM),(SUBF),(SMID ),(BADDR),(QRADDR),ERRSTAT)
                            • [02254] CRDAST - READ AVAILABLE STREAM TABLE.
                            • [02258] CRDAST - READ AVAILABLE STREAM TABLE.
                            • [02306] PROC CPIOERR
                            • [02307] PROC CRDPRM
                            • [02308] PROC OCTSRCH
                            • [02309] PROC READ
                            • [02310] PROC ZSETFET
                            • [02367] PROC CRDPRM((TORD),ERRSTAT)
                              • [02368] CRDPRM - READ CATALOG PREAMBLE.
                              • [02372] CRDPRM - READ CATALOG PREAMBLE.
                              • [02407] PROC CCLOSE
                              • [02408] PROC CPIOERR
                              • [02409] PROC REWIND
                              • [02410] PROC RPHR
                              • [02411] PROC ZSETFET
                              • [02477] PROC CRELSLK((FAMNM),(MASK),(QRADDR),ERRSTAT)
                                • [02478] CRELSLK - RELEASE CATALOG INTERLOCKS.
                                • [02482] CRELSLK - RELEASE CATALOG INTERLOCKS.
                                • [02515] PROC BFLUSH
                                • [02516] PROC RETERN
                                • [02517] PROC RTIME
                                • [02518] PROC ZSETFET
                                • [02564] PROC CRELSMM((FAMNM),(MASK),(QRADDR),ERRSTAT)
                                  • [02565] CRELSMM - RELEASE CATALOG IN MODIFY MODE.
                                  • [02569] CRELSMM - RELEASE CATALOG IN MODIFY MODE.
                                  • [02616] PROC ABORT
                                  • [02617] PROC BFLUSH
                                  • [02618] PROC BZFILL
                                  • [02619] PROC MESSAGE
                                  • [02620] PROC PFD
                                  • [02621] PROC RMVBLNK
                                  • [02622] PROC RTIME
                                  • [02623] PROC SETPFP
                                  • [02624] FUNC XCDD C(10)
                                  • [02626] PROC ZFILL
                                  • [02712] PROC CRMVSC((FAMNM),(SUBF),(SMID ),(QRADDR),ERRSTAT)
                                    • [02713] CRMVSC - REMOVE SUBCATALOG.
                                    • [02717] CRMVSC - REMOVE SUBCATALOG.
                                    • [02769] PROC ABORT
                                    • [02770] PROC BFLUSH
                                    • [02771] PROC CDEFTF
                                    • [02772] PROC CPIOERR
                                    • [02773] PROC MESSAGE
                                    • [02774] PROC OCTSRCH
                                    • [02775] PROC READ
                                    • [02776] PROC READW
                                    • [02777] PROC REPLCAT
                                    • [02778] PROC REWIND
                                    • [02779] PROC SETPFP
                                    • [02780] PROC WRITEF
                                    • [02781] PROC WRITEW
                                    • [02782] PROC ZSETFET
                                    • [02996] PROC CWTAST((FAMNM),(SUBF),(SMID ),(BADDR),(QRADDR),ERRSTAT)
                                      • [02997] CWTAST - WRITE AVAILABLE STREAM TABLE.
                                      • [03001] CWTAST - WRITE AVAILABLE STREAM TABLE.
                                      • [03051] PROC CPIOERR
                                      • [03052] PROC OCTSRCH
                                      • [03053] PROC REWRITE
                                      • [03054] PROC ZSETFET
                                      • [03055] PROC RPHR
                                      • [03056] PROC WPHR
                                      • [03163] PROC OCTSRCH((FAM),(SUB),ORD,(QRADR),ERRSTAT)
                                        • [03164] OCTSRCH - OPEN CATALOG TABLE SEARCH.
                                        • [03168] OCTSRCH - OPEN CATALOG TABLE SEARCH.
                                        • [03214] PROC ADD$LNK
                                        • [03287] PROC REPLCAT((ORD),ERRSTAT)
                                          • [03288] REPLCAT - REPLACES THE MSF CATALOG.
                                          • [03293] REPLACES THE MSF CATALOG.
                                          • [03345] PROC BZFILL
                                          • [03346] PROC MESSAGE
                                          • [03347] PROC PFD
                                          • [03348] PROC READ
                                          • [03349] PROC RENAME
                                          • [03350] PROC RETERN
                                          • [03351] PROC REWIND
                                          • [03352] PROC RMVBLNK
                                          • [03353] PROC WRITE
                                          • [03354] PROC WRITEF
                                          • [03355] FUNC XCDD C(10)
                                          • [03356] PROC ZFILL
                                          </WRAP> === Source Code ===
                                          ACCCAT.txt
                                          1. PROC BFLUSH((QRADR),ERSTAT);
                                          2. # TITLE BFLUSH - FLUSHES THE I/O BUFFER. #
                                          3. BEGIN # BFLUSH #
                                          4.  
                                          5. #
                                          6. ** BFLUSH - FLUSHES THE I/O BUFFER.
                                          7. *
                                          8. * *BFLUSH* FLUSHES THE *FCT* I/O BUFFER AND CLEARS THE BUFFER
                                          9. * MODIFIED FLAG IF THE DATA IN THE BUFFER HAS BEEN MODIFIED.
                                          10. *
                                          11. * BFLUSH - IS CALLED BY CBUFMAN,CEXTSC,CFLUSH,CRELSLK,CRMUSC.
                                          12. *
                                          13. * BFLUSH - IS CALLED BY CBUFMAN,CEXTSC,CFLUSH,CRELSLK,
                                          14. * CRMVSC,ASVAL,VLAMSF,VLAPFC,VLBICT,VLBLDVT,
                                          15. * VLCFS,VLFIX,VLNCS,VLSCH,VLSUBFM,VLWFIX.
                                          16. *
                                          17. * PROC BFLUSH((QRADR),ERSTAT)
                                          18. *
                                          19. * ENTRY (QRADR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          20. *
                                          21. * EXIT (ERSTAT) - ERROR STATUS.
                                          22. * (VALUES DEFINED IN *COMACMS*)
                                          23. * = NO ERRORS.
                                          24. * = *CIO* ERROR.
                                          25. * THE I/O BUFFER HAS BEEN FLUSHED IF NECESSARY AND THE
                                          26. * BUFFER MODIFIED FLAG CLEARED.
                                          27. #
                                          28.  
                                          29. ITEM QRADR U; # *HLRQ* ENTRY ADDRESS #
                                          30. ITEM ERSTAT I; # ERROR STATUS #
                                          31.  
                                          32. #
                                          33. **** PROC BFLUSH - XREF LIST BEGIN.
                                          34. #
                                          35.  
                                          36. XREF
                                          37. BEGIN
                                          38. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          39. PROC REWRITE; # REWRITE DATA FROM IO BUFFER #
                                          40. PROC ZSETFET; # INITIALIZES A FET #
                                          41. END
                                          42.  
                                          43. #
                                          44. **** PROC BFLUSH - XREF LIST END.
                                          45. #
                                          46.  
                                          47. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          48. *CALL COMBFAS
                                          49. *CALL COMBCMD
                                          50. *CALL COMBCMS
                                          51. *CALL COMBFET
                                          52. *CALL COMBMCT
                                          53. *CALL COMSPFM
                                          54.  
                                          55. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          56. CONTROL EJECT;
                                          57.  
                                          58. ORD = FB$ORD[0];
                                          59.  
                                          60. IF FB$BMF[0]
                                          61. THEN
                                          62. BEGIN # BUFFER MODIFIED #
                                          63.  
                                          64. #
                                          65. * WRITE OUT BUFFER.
                                          66. #
                                          67.  
                                          68. FB$BMF[0] = FALSE; # CLEAR BUFFER MODIFIED FLAG #
                                          69. ZSETFET(FCTFADR,OCT$LFN[ORD],FCTBADR,OCT$BUFL[ORD],RFETL);
                                          70. FET$EP[0] = TRUE;
                                          71. FET$IN[0] = FET$FRST[0] + OCT$BUFL[ORD] - 1;
                                          72. FET$R[0] = TRUE;
                                          73. FET$RR[0] = FB$PRUNUM[0];
                                          74. REWRITE(FETSET[0],RCL);
                                          75. IF FET$AT[0] NQ 0
                                          76. THEN
                                          77. BEGIN
                                          78. CPIOERR(OCT$FAM[ORD],OCT$SUBF[ORD],QRADR,ERSTAT,FETSET[0]);
                                          79. RETURN;
                                          80. END
                                          81.  
                                          82. END # BUFFER MODIFIED #
                                          83.  
                                          84. IF OCT$ATTM[ORD] NQ "M"
                                          85. THEN # IF NOT OPEN IN MODIFY MODE #
                                          86. BEGIN
                                          87. FB$CWRD[ORD] = 0; # CLEAR BUFFER CONTROL WORD #
                                          88. END
                                          89.  
                                          90. RETURN;
                                          91. END # BFLUSH #
                                          92.  
                                          93. TERM
                                          94. PROC CADDSC((FAMNM),(SUBF),(SMID ),(NUM),(QRADDR),ERRSTAT);
                                          95. # TITLE CADDSC - ADD SUBCATALOG. #
                                          96. BEGIN # CADDSC #
                                          97.  
                                          98. #
                                          99. ** CADDSC - ADD SUBCATALOG.
                                          100. *
                                          101. * *CADDSC* EXPANDS THE CATALOG FILE WITH SPACE FOR AN ADDITIONAL
                                          102. * SUBCATALOG WITH THE SPECIFIED NUMBER OF *FCT* AND *AST* ENTRIES.
                                          103. * THE CATALOG MUST BE OPEN IN MODIFY MODE.
                                          104. *
                                          105. * CADDSC - IS CALLED BY ADDCSU.
                                          106. *
                                          107. * CADDSC - IS CALLED BY ADDCSU.
                                          108. *
                                          109. * PROC CADDSC((FAMNM),(SUBF),(SMID ),(NUM),(QRADDR),ERRSTAT)
                                          110. *
                                          111. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          112. * 7 CHARACTER MAXIMUM.
                                          113. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          114. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          115. * (NUM) - NUMBER OF *FCT* (AND *AST*) ENTRIES TO ADD.
                                          116. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          117. *
                                          118. * EXIT THE SUBCATALOG HAS BEEN ADDED AND THE CATALOG PREAMBLE
                                          119. * HAS BEEN UPDATED TO REFLECT THE CHANGE.
                                          120. * (ERRSTAT) - ERROR STATUS.
                                          121. * (VALUES DEFINED IN *COMBCMS*)
                                          122. * = NO ERRORS.
                                          123. * = CATALOG FILE INTERLOCKED.
                                          124. * = CATALOG NOT OPEN.
                                          125. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          126. * = SUBCATALOG ALREADY EXISTS.
                                          127. * = *CIO* ERROR.
                                          128. * IF THE DESIRED FAMILY IS NOT FOUND ON A *SETPFP*, AN
                                          129. * ERROR MESSAGE IS ISSUED AND THE PROGRAM IS ABORTED.
                                          130. *
                                          131. * NOTES THE CATALOG IS RE-ATTACHED IN WRITE MODE BEFORE ADDING
                                          132. * THE SUBCATALOG, (IN ORDER TO EXTEND THE CATALOG), AND
                                          133. * WHEN FINISHED, THE FILE IS ATTACHED IN MODIFY MODE
                                          134. * AGAIN. SPACE FOR A SUBCATALOG IS ALWAYS ADDED IN FULL
                                          135. * PRU-S, SO THAT EACH *FCT* AND *AST* BEGINS AT A PRU
                                          136. * BOUNDARY. HOWEVER, THE LENGTH OF THE *FCT* AND *AST*
                                          137. * MAINTAINED IN THE CATALOG PREAMBLE REFLECTS THE
                                          138. * NUMBER OF ENTRIES SPECIFIED BY (NUM).
                                          139. *
                                          140. * MESSAGES * PROGRAM ABNORMAL, CADDSC.*.
                                          141. #
                                          142.  
                                          143. ITEM FAMNM C(7); # FAMILY NAME #
                                          144. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          145. ITEM SMID U; # SM IDENTIFIER #
                                          146. ITEM NUM I; # NUMBER OF ENTRIES TO ADD #
                                          147. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          148. ITEM ERRSTAT I; # ERROR STATUS #
                                          149.  
                                          150. #
                                          151. **** PROC CADDSC - XREF LIST BEGIN.
                                          152. #
                                          153.  
                                          154. XREF
                                          155. BEGIN
                                          156. PROC ABORT; # ABORT #
                                          157. PROC BKSPRU; # BACKSPACE PHYSICAL RECORDS #
                                          158. PROC CDEFTF; # DEFINE TEMPORARY CATALOG #
                                          159. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          160. PROC MESSAGE; # ISSUE MESSAGE #
                                          161. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          162. PROC READ; # READ FILE TO *CIO* BUFFER #
                                          163. PROC REPLCAT; # REPLACE MSF CATALOG #
                                          164. PROC REWIND; # REWIND A FILE #
                                          165. PROC RPHR; # READ PRU TO *CIO* BUFFER #
                                          166. PROC SETPFP; # SET PERMANENT FILE PARAMETERS #
                                          167. PROC WPHR; # WRITE PRU FROM *CIO* BUFFER #
                                          168. PROC WRITE; # WRITE DATA FROM *CIO* BUFFER #
                                          169. PROC WRITEF; # WRITE END OF FILE #
                                          170. PROC WRITEW; # WRITE DATA FROM WORKING BUFFER #
                                          171. PROC ZSETFET; # INITIALIZES A FET #
                                          172. END
                                          173.  
                                          174. #
                                          175. **** PROC CADDSC - XREF LIST END.
                                          176. #
                                          177.  
                                          178. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          179. *CALL COMBFAS
                                          180. *CALL COMBCMD
                                          181. *CALL COMBCMS
                                          182. *CALL COMBFET
                                          183. *CALL COMXMSC
                                          184. *CALL COMBMCT
                                          185. *CALL COMBPFP
                                          186.  
                                          187. ITEM I I; # LOOP COUNTER #
                                          188. ITEM LOCAT I; # LOCATION OF NEW SUBCATALOG #
                                          189. ITEM NAST I; # NUMBER OF PRU-S IN *AST* #
                                          190. ITEM NFCT I; # NUMBER OF PRU-S IN *FCT* #
                                          191. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          192. ITEM STAT I; # ATTACH STATUS #
                                          193. ITEM TEMP I; # TEMPORARY STORAGE #
                                          194. CONTROL EJECT;
                                          195.  
                                          196. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          197. IF ERRSTAT NQ CMASTAT"NOERR"
                                          198. THEN
                                          199. BEGIN
                                          200. RETURN; # RETURN ERROR STATUS #
                                          201. END
                                          202.  
                                          203. P<PREAMBLE> = OCT$PRMA[ORD];
                                          204. IF PRM$SCW1[SMID ] NQ 0
                                          205. THEN # SUBCATALOG ALREADY EXISTS #
                                          206. BEGIN
                                          207. ERRSTAT = CMASTAT"SCEXISTS";
                                          208. RETURN; # RETURN ERROR STATUS #
                                          209. END
                                          210.  
                                          211. IF OCT$ATTM[ORD] NQ "M"
                                          212. THEN # NOT OPEN IN MODIFY MODE #
                                          213. BEGIN
                                          214. ERRSTAT = CMASTAT"MODERR";
                                          215. RETURN; # RETURN ERROR STATUS #
                                          216. END
                                          217.  
                                          218. #
                                          219. * DEFINE TEMPORARY FILE AND COPY CATALOG TO IT.
                                          220. #
                                          221.  
                                          222. PFP$WRD0[0] = 0; # SET FAMILY AND USER INDEX #
                                          223. PFP$FAM[0] = OCT$FAM[ORD];
                                          224. PFP$UI[0] = DEF$UI + OCT$SUBF[ORD];
                                          225. PFP$FG1[0] = TRUE;
                                          226. PFP$FG4[0] = TRUE;
                                          227. SETPFP(PFP);
                                          228. IF PFP$STAT[0] NQ 0
                                          229. THEN # FAMILY NOT FOUND #
                                          230. BEGIN
                                          231. CMA$RTN[0] = "CADDSC.";
                                          232. MESSAGE(CMAMSG,UDFL1); # ISSUE ERROR MESSAGE #
                                          233. ABORT;
                                          234. END
                                          235.  
                                          236.  
                                          237. ZSETFET(TFETADR,OCT$LFN[ORD],TBUFADR,TBUFL,RFETL);
                                          238. ZSETFET(TFETADR+RFETL,TSFMCAT,TBUFADR,TBUFL,RFETL);
                                          239. P<FETSET> = TFETADR;
                                          240. FET$EP[0] = TRUE;
                                          241. FET$EP[1] = TRUE;
                                          242. REWIND(FETSET[0],NRCL);
                                          243. CDEFTF(FETSET[1],ERRSTAT); # DEFINE TEMPORARY CATALOG FILE #
                                          244. IF ERRSTAT NQ CMASTAT"NOERR"
                                          245. THEN
                                          246. BEGIN
                                          247. RETURN; # RETURN ERROR STATUS #
                                          248. END
                                          249.  
                                          250.  
                                          251. REPEAT WHILE NOT FET$EOI[0]
                                          252. DO # COPY CATALOG FILE #
                                          253. BEGIN
                                          254. READ(FETSET[0],RCL);
                                          255. FET$IN[1] = FET$IN[0];
                                          256. WRITE(FETSET[1],RCL);
                                          257. FET$OUT[0] = FET$OUT[1];
                                          258. END
                                          259.  
                                          260. WRITEF(FETSET[1],RCL);
                                          261.  
                                          262. #
                                          263. * CALCULATE NUMBER OF PRU-S TO ADD.
                                          264. #
                                          265.  
                                          266. NAST =(MAXORD/PRULEN)* 2 + 1;
                                          267.  
                                          268. #
                                          269. * ALLOCATE SPACE AT END OF FILE.
                                          270. #
                                          271.  
                                          272. FET$R[1] = TRUE;
                                          273. BKSPRU(FETSET[1],2,RCL);
                                          274. IF FET$AT[1] NQ 0
                                          275. THEN
                                          276. BEGIN
                                          277. GOTO ERR;
                                          278. END
                                          279.  
                                          280. LOCAT = FET$CRI[1]; # LOCATION OF NEW SUBCATALOG #
                                          281. SLOWFOR I = 1 STEP 1 UNTIL WBUFL
                                          282. DO
                                          283. BEGIN
                                          284. WBUF$W[I] = 0; # ZERO FILL WORKING BUFFER #
                                          285. END
                                          286.  
                                          287. SLOWFOR I = NAST STEP -1 UNTIL 1
                                          288. DO
                                          289. BEGIN
                                          290. WRITEW(FETSET[1],WBUF,WBUFL,STAT);
                                          291. IF STAT NQ 0
                                          292. THEN # *CIO* ERROR #
                                          293. BEGIN
                                          294. GOTO ERR;
                                          295. END
                                          296.  
                                          297. END
                                          298.  
                                          299. WRITEF(FETSET[1],RCL);
                                          300. IF FET$AT[1] NQ 0
                                          301. THEN
                                          302. BEGIN
                                          303. GOTO ERR;
                                          304. END
                                          305.  
                                          306. #
                                          307. * UPDATE CATALOG PREAMBLE.
                                          308. #
                                          309.  
                                          310. PRM$SMID[SMID ] = SMID ;
                                          311. PRM$ENTRC[SMID] = 0;
                                          312. PRM$ASTLOC[SMID] = LOCAT ;
                                          313. PRM$FCTLOC[SMID] = LOCAT + NAST;
                                          314. PRM$MXAUS[SMID] = 0;
                                          315. PRM$MXAUL[SMID] = 0;
                                          316. PRM$PDATE[SMID] = 0;
                                          317. FET$RR[1] = 1; # WRITE UPDATED PREAMBLE #
                                          318. FET$IN[1] = FET$FRST[1];
                                          319. FET$OUT[1] = FET$FRST[1];
                                          320. RPHR(FETSET[1],RCL);
                                          321. IF FET$AT[1] NQ 0
                                          322. THEN
                                          323. BEGIN
                                          324. GOTO ERR;
                                          325. END
                                          326.  
                                          327. TBUF$W[SMID +1] = PRM$SCW1[SMID];
                                          328. TBUF$W1[SMID+1] = PRM$SCW2[SMID];
                                          329. TBUF$W2[SMID+1] = PRM$SCW2[SMID];
                                          330. FET$RR[1] = 1;
                                          331. FET$W[1] = TRUE;
                                          332. WPHR(FETSET[1],RCL);
                                          333. IF FET$AT[1] NQ 0
                                          334. THEN
                                          335. BEGIN
                                          336. GOTO ERR;
                                          337. END
                                          338.  
                                          339. #
                                          340. * REPLACE MSF CATALOG WITH NEW CATALOG (*TSFMCAT*).
                                          341. #
                                          342.  
                                          343. REPLCAT(ORD,ERRSTAT);
                                          344. RETURN;
                                          345.  
                                          346. ERR: # PROCESS *CIO* ERROR #
                                          347. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,FETSET[1]);
                                          348. END # CADDSC #
                                          349.  
                                          350. TERM
                                          351. PROC CBUFMAN((FAMNM),(SUBF),(SMID),(FCTORD),(MODF),
                                          352. (QRADDR),ERRSTAT);
                                          353. # TITLE CBUFMAN - MANAGE CATALOG *FCT* BUFFER. #
                                          354. BEGIN # CBUFMAN #
                                          355.  
                                          356. #
                                          357. ** CBUFMAN - MANAGE CATALOG *FCT* BUFFER.
                                          358. *
                                          359. * *CBUFMAN* ENSURES THAT THE REQUESTED FILE AND CARTRIDGE TABLE
                                          360. * ENTRY IS IN THE CATALOG *FCT* I/O BUFFER. THE WORD OFFSET OF THE
                                          361. * ENTRY WITHIN THE BUFFER IS RETURNED TO THE CALLER.
                                          362. *
                                          363. * CBUFMAN - IS CALLED BY CGETFCT,CPUTFCT.
                                          364. *
                                          365. * PROC CBUFMAN((FAMNM),(SUBF),(SMID ),(FCTORD),OFFSET,(MODF),
                                          366. * (QRADDR),ERRSTAT)
                                          367. *
                                          368. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          369. * 7 CHARACTER MAXIMUM.
                                          370. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          371. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          372. * (FCTORD) - ORDINAL OF ENTRY IN *FCT*.
                                          373. * (MODF) - CATALOG ATTACH MODE FLAG.
                                          374. * = FALSE, MODIFY MODE NOT REQUIRED.
                                          375. * = TRUE, MODIFY MODE IS REQUIRED.
                                          376. * (QRADDR) - ADDRESS OF *HLRQ* ENTRY, ELSE ZERO.
                                          377. *
                                          378. * EXIT THE REQUESTED *FCT* ENTRY IS IN THE *FCT* I/O BUFFER.
                                          379. * (OFFSET) - WORD OFFSET OF ENTRY WITHIN BUFFER.
                                          380. * (ERRSTAT) - ERROR STATUS.
                                          381. * (VALUES DEFINED IN *COMBCMS*)
                                          382. * = NO ERROR.
                                          383. * = CATALOG FILE INTERLOCKED.
                                          384. * = CATALOG NOT OPEN.
                                          385. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          386. * = NO SUCH SUBCATALOG.
                                          387. * = *CIO* ERROR.
                                          388. * = *FCT* ORDINAL OUT OF RANGE.
                                          389. #
                                          390.  
                                          391. ITEM FAMNM C(7); # FAMILY NAME #
                                          392. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          393. ITEM SMID U; # SM IDENTIFIER #
                                          394. ITEM FCTORD I; # *FCT* ORDINAL #
                                          395. ITEM OFFSET I; # WORD OFFSET WITHIN BUFFER #
                                          396. ITEM MODF B; # MODIFY MODE FLAG #
                                          397. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          398. ITEM ERRSTAT I; # ERROR STATUS #
                                          399.  
                                          400. #
                                          401. **** PROC CBUFMAN - XREF LIST BEGIN.
                                          402. #
                                          403.  
                                          404. XREF
                                          405. BEGIN
                                          406. PROC BFLUSH; # BUFFER FLUSH #
                                          407. PROC CCLOSE; # CLOSE CATALOG #
                                          408. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          409. PROC READ; # READ FILE TO *CIO* BUFFER #
                                          410. PROC ZSETFET; # INITIALIZES A FET #
                                          411. END
                                          412.  
                                          413. #
                                          414. **** PROC CBUFMAN - XREF LIST END.
                                          415. #
                                          416.  
                                          417. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          418. *CALL COMBFAS
                                          419. *CALL COMBCMD
                                          420. *CALL COMBCMS
                                          421. *CALL COMBFET
                                          422. *CALL COMBMCT
                                          423. *CALL COMXMSC
                                          424. *CALL COMSPFM
                                          425.  
                                          426. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          427. ITEM PRUNUM I; # PRU NUMBER #
                                          428. ITEM TEMP I; # TEMPORARY STORAGE ITEM #
                                          429.  
                                          430. CONTROL EJECT;
                                          431.  
                                          432. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          433. IF ERRSTAT NQ CMASTAT"NOERR"
                                          434. THEN
                                          435. BEGIN
                                          436. RETURN; # RETURN ERROR STATUS #
                                          437. END
                                          438.  
                                          439. P<PREAMBLE> = OCT$PRMA[ORD];
                                          440. IF PRM$SCW1[SMID ] EQ 0
                                          441. THEN # IF NO SUCH SUBCATALOG EXISTS #
                                          442. BEGIN
                                          443. ERRSTAT = CMASTAT"NOSUBCAT";
                                          444. RETURN; # RETURN ERROR STATUS #
                                          445. END
                                          446.  
                                          447. IF FCTORD GR (PRM$ENTRC[SMID] + 15) OR FCTORD LQ 15
                                          448. THEN # IF *FCT* ORDINAL BAD #
                                          449. BEGIN
                                          450. ERRSTAT = CMASTAT"ORDERR";
                                          451. RETURN; # RETURN ERROR STATUS #
                                          452. END
                                          453.  
                                          454. IF MODF AND OCT$ATTM[ORD] NQ "M"
                                          455. THEN # IF NOT OPEN IN MODIFY MODE #
                                          456. BEGIN
                                          457. ERRSTAT = CMASTAT"MODERR";
                                          458. RETURN; # RETURN ERROR STATUS #
                                          459. END
                                          460.  
                                          461. #
                                          462. * CALCULATE POSITION OF REQUESTED *FCT* ENTRY.
                                          463. * (PRUNUM) = PRU OFFSET WITHIN CATALOG.
                                          464. #
                                          465.  
                                          466. TEMP = 16 * (FCTORD - 16);
                                          467. PRUNUM = PRM$FCTLOC[SMID ] + TEMP;
                                          468.  
                                          469. #
                                          470. * ENSURE THAT REQUESTED *FCT* ENTRY IS IN I/O BUFFER.
                                          471. #
                                          472.  
                                          473. IF PRUNUM NQ FB$PRUNUM[0]
                                          474. OR ORD NQ FB$ORD[0]
                                          475. OR PRM$SUBF[0] NQ SUBF
                                          476. OR PRM$FAM[0] NQ FAMNM
                                          477. THEN # IF ENTRY NOT IN BUFFER #
                                          478. BEGIN # READ ENTRY INTO BUFFER #
                                          479. IF PRM$SUBF[0] EQ SUBF
                                          480. AND PRM$FAM[0] EQ FAMNM
                                          481. THEN
                                          482. BEGIN
                                          483. BFLUSH(QRADDR,ERRSTAT); # FLUSH CATALOG *FCT* I/O BUFFER #
                                          484. IF ERRSTAT NQ CMASTAT"NOERR"
                                          485. THEN
                                          486. BEGIN
                                          487. RETURN;
                                          488. END
                                          489. END
                                          490.  
                                          491.  
                                          492. ZSETFET(FCTFADR,OCT$LFN[ORD],FCTBADR,OCT$BUFL[ORD],RFETL);
                                          493. P<FETSET> = FCTFADR;
                                          494. FET$EP[0] = TRUE;
                                          495. FET$R[0] = TRUE;
                                          496. FET$RR[0] = PRUNUM;
                                          497. READ(FETSET[0],RCL);
                                          498. IF FET$AT[0] NQ 0
                                          499. THEN
                                          500. BEGIN
                                          501. CCLOSE(FAMNM,SUBF,QRADDR,ERRSTAT); # CLOSE CATALOG #
                                          502. ERRSTAT = CMASTAT"CIOERR"; # RETURN ERROR STATUS #
                                          503. RETURN;
                                          504. END
                                          505.  
                                          506. FB$ORD[0] = ORD; # SET BUFFER CONTROL WORD #
                                          507. FB$PRUCNT[0] = OCT$BUFL[ORD]/PRULEN;
                                          508. FB$PRUNUM[0] = PRUNUM;
                                          509. END # READ ENTRY INTO BUFFER #
                                          510.  
                                          511.  
                                          512. RETURN;
                                          513. END # CBUFMAN #
                                          514.  
                                          515. TERM
                                          516. PROC CCLOSE((FAMNM),(SUBF),(QRADDR),ERRSTAT);
                                          517. # TITLE CCLOSE - CLOSE CATALOG. #
                                          518. BEGIN # CCLOSE #
                                          519.  
                                          520. #
                                          521. ** CCLOSE - CLOSE CATALOG.
                                          522. *
                                          523. * *CCLOSE* TERMINATES CATALOG USAGE. IF THE CATALOG WAS
                                          524. * OPEN IN MODIFY MODE, THE UPDATED PREAMBLE IS WRITTEN
                                          525. * BACK TO THE CATALOG AND THE *FCT* I/O BUFFER IS FLUSHED
                                          526. * (IF THE DATA IN THE BUFFER WAS MODIFIED).
                                          527. * THE CATALOG FILE IS RETURNED AND THE *OCT* ENTRY IS CLEARED.
                                          528. *
                                          529. * CCLOSE - IS CALLED BY CBUFMAN,CPIOERR,CRDPRM,DBFLAG,DBFMAP,
                                          530. * DBRDFIL,DBREL,TERMCAT,USRPBAS,USRPDE,VLSUBFM.
                                          531. *
                                          532. * PROC CCLOSE((FAMNM),(SUBF),(QRADDR),ERRSTAT)
                                          533. *
                                          534. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          535. * 7 CHARACTER MAXIMUM.
                                          536. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          537. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          538. *
                                          539. * EXIT (ERRSTAT) - ERROR STATUS.
                                          540. * (VALUES DEFINED IN *COMBCMS*)
                                          541. * = NO ERRORS.
                                          542. * = CATALOG FILE INTERLOCKED.
                                          543. * = CATALOG NOT OPEN.
                                          544. * = *CIO* ERROR.
                                          545. *
                                          546. #
                                          547.  
                                          548. ITEM FAMNM C(7); # FAMILY NAME #
                                          549. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          550. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          551. ITEM ERRSTAT I; # ERROR STATUS #
                                          552.  
                                          553. #
                                          554. **** PROC CCLOSE - XREF LIST BEGIN.
                                          555. #
                                          556.  
                                          557. XREF
                                          558. BEGIN
                                          559. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          560. PROC RETERN; # RETURN FILE TO SYSTEM #
                                          561. PROC REWRITE; # REWRITE DATA FROM I/O BUFFER #
                                          562. PROC RPHR; # READ PRU TO *CIO* BUFFER #
                                          563. PROC WPHR; # WRITE PRU FROM *CIO* BUFFER #
                                          564. PROC ZFILL; # ZERO FILLS A BUFFER #
                                          565. PROC ZSETFET; # INITIALIZES A FET #
                                          566. END
                                          567.  
                                          568. #
                                          569. **** PROC CCLOSE - XREF LIST END.
                                          570. #
                                          571.  
                                          572. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          573. *CALL COMBFAS
                                          574. *CALL COMBCMD
                                          575. *CALL COMBCMS
                                          576. *CALL COMBFET
                                          577. *CALL COMBMCT
                                          578. *CALL COMSPFM
                                          579.  
                                          580. ITEM I I; # LOOP COUNTER #
                                          581. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          582. CONTROL EJECT;
                                          583.  
                                          584. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          585. IF ERRSTAT NQ CMASTAT"NOERR"
                                          586. THEN
                                          587. BEGIN
                                          588. RETURN; # RETURN ERROR STATUS #
                                          589. END
                                          590.  
                                          591. IF FB$BMF[0] AND ORD EQ FB$ORD[0]
                                          592. THEN
                                          593. BEGIN # FLUSH BUFFER #
                                          594. ZSETFET(FCTFADR,OCT$LFN[ORD],FCTBADR,OCT$BUFL[ORD],RFETL);
                                          595. FET$EP[0] = TRUE;
                                          596. FET$R[0] = TRUE;
                                          597. FET$IN[0] = FET$FRST[0] + OCT$BUFL[ORD] - 1;
                                          598. FET$RR[0] = FB$PRUNUM[0];
                                          599. REWRITE(FETSET[0],RCL);
                                          600. IF FET$AT[0] NQ 0
                                          601. THEN
                                          602. BEGIN
                                          603. ERRSTAT = CMASTAT"CIOERR";
                                          604. FET$AT[0] = 0;
                                          605. END
                                          606.  
                                          607. FB$CWRD[0] = 0;
                                          608. END # FLUSH BUFFER #
                                          609.  
                                          610. ZSETFET(TFETADR,OCT$LFN[ORD],TBUFADR,2*PRULEN,RFETL);
                                          611.  
                                          612. #
                                          613. * WRITE UPDATED PREAMBLE BACK TO THE CATALOG FILE.
                                          614. #
                                          615.  
                                          616. IF OCT$ATTM[ORD] EQ "M"
                                          617. THEN # IF CATALOG OPEN IN MODIFY MODE #
                                          618. BEGIN # UPDATE CATALOG PREAMBLE #
                                          619. FET$EP[0] = TRUE;
                                          620. FET$R[0] = TRUE;
                                          621. FET$RR[0] = 1;
                                          622. RPHR(FETSET[0],RCL);
                                          623. IF FET$AT[0] NQ 0
                                          624. THEN
                                          625. BEGIN
                                          626. ERRSTAT = CMASTAT"CIOERR";
                                          627. FET$AT[0] = 0;
                                          628. END
                                          629.  
                                          630. P<PREAMBLE> = OCT$PRMA[ORD];
                                          631. FASTFOR I = 0 STEP 1 UNTIL MAXSM
                                          632. DO
                                          633. BEGIN
                                          634. TBUF$W[I+1] = PRM$SCW1[I];
                                          635. TBUF$W1[I+1] = PRM$SCW2[I];
                                          636. TBUF$W2[I+1] = PRM$SCW3[I];
                                          637. END
                                          638.  
                                          639. FET$RR[0] = 1;
                                          640. FET$W[0] = TRUE;
                                          641. WPHR(FETSET[0],RCL);
                                          642. IF FET$AT[0] NQ 0
                                          643. THEN
                                          644. BEGIN
                                          645. ERRSTAT = CMASTAT"CIOERR";
                                          646. FET$AT[0] = 0;
                                          647. END
                                          648.  
                                          649. END # UPDATE CATALOG PREAMBLE #
                                          650.  
                                          651. #
                                          652. * RETURN CATALOG FILE.
                                          653. #
                                          654.  
                                          655. RETERN(FETSET[0],RCL);
                                          656.  
                                          657. #
                                          658. * CLEAR ENTRY IN OPEN CATALOG TABLE.
                                          659. #
                                          660.  
                                          661. ZFILL(OCT[ORD],OCTENTL);
                                          662. RETURN;
                                          663. END # CCLOSE #
                                          664.  
                                          665. TERM
                                          666. PROC CDEFTF(FET,ERSTAT);
                                          667. # TITLE CDEFTF - DEFINE TEMPORARY CATALOG. #
                                          668. BEGIN # CDEFTF #
                                          669.  
                                          670. #
                                          671. ** CDEFTF - DEFINE TEMPORARY CATALOG.
                                          672. *
                                          673. * *CDEFTF* DEFINES A FILE TO BE USED FOR CHANGING THE
                                          674. * SIZE OF THE MSS CATALOG.
                                          675. *
                                          676. * CDEFTF - IS CALLED BY CADDSC, CEXTSC,CRMVSC.
                                          677. *
                                          678. *
                                          679. * PROC CDEFTF(FET,ERSTAT)
                                          680. *
                                          681. * ENTRY FET - AN ARRAY CONTAINING THE FET FOR *TSFMCAT*.
                                          682. *
                                          683. * EXIT A FILE NAMED *TSFMCAT* HAS BEEN DEFINED.
                                          684. * (ERSTAT) - ERROR STATUS.
                                          685. * (VALUES DEFINED IN *COMBCMS*)
                                          686. * = NO ERRORS.
                                          687. * = *CIO* ERROR.
                                          688. * = FILE DEFINE ERROR.
                                          689. * = FILE PURGE ERROR.
                                          690. *
                                          691. *
                                          692. * NOTES IF THE FILE ALREADY EXISTS, IT IS PURGED AND
                                          693. * REDEFINED.
                                          694. #
                                          695.  
                                          696. ARRAY FET [0:0] P(1); ; # FET FOR FILE *TSFMCAT* #
                                          697. ITEM ERSTAT I; # ERROR STATUS #
                                          698.  
                                          699. #
                                          700. **** PROC CDEFTF - XREF LIST BEGIN.
                                          701. #
                                          702.  
                                          703. XREF
                                          704. BEGIN
                                          705. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
                                          706. PROC RETERN; # RETURN FILE TO SYSTEM #
                                          707. END
                                          708.  
                                          709. #
                                          710. **** PROC CDEFTF - XREF LIST END.
                                          711. #
                                          712.  
                                          713. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          714. *CALL COMBFAS
                                          715. *CALL COMBCMS
                                          716. *CALL COMBPFS
                                          717. *CALL COMXMSC
                                          718. *CALL COMSPFM
                                          719. CONTROL EJECT;
                                          720.  
                                          721. PFD("DEFINE",TSFMCAT,0,"BR","Y","SR","MR","RC",PFSTAT,"UP",0,0);
                                          722. IF PFSTAT NQ 0
                                          723. THEN
                                          724. BEGIN # DEFINE ERROR #
                                          725. IF PFSTAT EQ FAP
                                          726. THEN
                                          727. BEGIN # FILE ALREADY EXISTS #
                                          728. PFD("PURGE",TSFMCAT,"RC",PFSTAT,"UP",0,0);
                                          729. IF PFSTAT NQ 0
                                          730. THEN # IF PURGE ERROR #
                                          731. BEGIN
                                          732. ERSTAT = CMASTAT"TPRGERR";
                                          733. RETURN;
                                          734. END
                                          735.  
                                          736. RETERN(FET[0],RCL);
                                          737. PFD("DEFINE",TSFMCAT,0,"BR","Y","SR","MR",
                                          738. "RC",PFSTAT,"UP",0,0);
                                          739. IF PFSTAT NQ 0
                                          740. THEN # IF DEFINE ERROR #
                                          741. BEGIN
                                          742. ERSTAT = CMASTAT"TDEFERR";
                                          743. RETURN;
                                          744. END
                                          745.  
                                          746. END # FILE ALREADY EXISTS #
                                          747.  
                                          748. ELSE
                                          749. BEGIN
                                          750. ERSTAT = CMASTAT"TDEFERR";
                                          751. RETURN;
                                          752. END
                                          753.  
                                          754. END # DEFINE ERROR #
                                          755.  
                                          756. END # CDEFTF #
                                          757.  
                                          758. TERM
                                          759. PROC CEXTSC((FAMNM),(SUBF),(SMID ),(NUM),(QRADDR),ERRSTAT);
                                          760. # TITLE CEXTSC - EXTEND SUBCATALOG. #
                                          761. BEGIN # CEXTSC #
                                          762.  
                                          763. #
                                          764. ** CEXTSC - EXTEND SUBCATALOG.
                                          765. *
                                          766. * *CEXTSC* EXPANDS AND REORGANIZES THE CATALOG FILE TO ACCOMODATE
                                          767. * AN INCREASE IN THE SIZE OF THE SUBCATALOG. THE CATALOG MUST BE
                                          768. * OPEN IN MODIFY MODE.
                                          769. *
                                          770. * CEXTSC - IS CALLED BY ADDCUBE.
                                          771. *
                                          772. * PROC CEXTSC((FAMNM),(SUBF),(SMID ),(NUM),(QRADDR),ERRSTAT)
                                          773. *
                                          774. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          775. * 7 CHARACTER MAXIMUM.
                                          776. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          777. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          778. * (NUM) - NUMBER OF *FCT* (AND *AST*) ENTRIES TO ADD.
                                          779. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          780. *
                                          781. * EXIT THE SIZE OF THE SPECIFIED SUBCATALOG HAS BEEN
                                          782. * INCREASED AND THE PREAMBLE HAS BEEN UPDATED TO
                                          783. * REFLECT THE CHANGE.
                                          784. * (ERRSTAT) - ERROR STATUS.
                                          785. * (VALUES DEFINED IN *COMBCMS*)
                                          786. * = NO ERRORS.
                                          787. * = CATALOG FILE INTERLOCKED.
                                          788. * = CATALOG NOT OPEN.
                                          789. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          790. * = NO SUCH SUBCATALOG.
                                          791. * = *CIO* ERROR.
                                          792. * = FILE DEFINE ERROR.
                                          793. * = FILE ATTACH ERROR.
                                          794. * = FILE PURGE ERROR.
                                          795. * = FILE RENAME ERROR.
                                          796. * IF THE DESIRED FAMILY IS NOT FOUND ON A *SETPFP*, AN
                                          797. * ERROR MESSAGE IS ISSUED AND THE PROGRAM IS ABORTED.
                                          798. *
                                          799. * NOTES THE CATALOG IS RE-ATTACHED IN WRITE MODE IN ORDER TO
                                          800. * EXTEND THE SUBCATALOG, AND WHEN FINISHED, THE FILE IS
                                          801. * ATTACHED IN MODIFY MODE AGAIN.
                                          802. *
                                          803. * MESSAGES * PROGRAM ABNORMAL, CEXTSC.*.
                                          804. #
                                          805.  
                                          806. ITEM FAMNM C(7); # FAMILY NAME #
                                          807. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          808. ITEM SMID U; # SM IDENTIFIER #
                                          809. ITEM NUM I; # NUMBER OF ENTRIES TO ADD #
                                          810. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          811. ITEM ERRSTAT I; # ERROR STATUS #
                                          812.  
                                          813. #
                                          814. **** PROC CEXTSC - XREF LIST BEGIN.
                                          815. #
                                          816.  
                                          817. XREF
                                          818. BEGIN
                                          819. PROC ABORT; # ABORT #
                                          820. PROC BFLUSH; # FLUSH *FCT* I/O BUFFER #
                                          821. PROC CDEFTF; # DEFINE TEMPORARY CATALOG #
                                          822. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          823. PROC MESSAGE; # ISSUE MESSAGE #
                                          824. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          825. PROC READ; # READ FILE TO *CIO* BUFFER #
                                          826. PROC READW; # READ DATA TO WORKING BUFFER #
                                          827. PROC REPLCAT; # REPLACE MSF CATALOG #
                                          828. PROC REWIND; # REWIND A FILE #
                                          829. PROC SETPFP; # SET PERMANENT FILE PARAMETERS #
                                          830. PROC WRITEF; # WRITE END OF FILE #
                                          831. PROC WRITEW; # WRITE DATA FROM WORKING BUFFER #
                                          832. PROC ZFILL; # ZERO FILL BUFFER #
                                          833. PROC ZSETFET; # INITIALIZES A FET #
                                          834. END
                                          835.  
                                          836. #
                                          837. **** PROC CEXTSC - XREF LIST END.
                                          838. #
                                          839.  
                                          840. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          841. *CALL COMBFAS
                                          842. *CALL COMBBZF
                                          843. *CALL COMBCMD
                                          844. *CALL COMBCMS
                                          845. *CALL COMBFET
                                          846. *CALL COMBMCT
                                          847. *CALL COMBPFP
                                          848. *CALL COMXMSC
                                          849.  
                                          850. ITEM EXT1 I; # EXTEND VALUE 1 #
                                          851. ITEM EXT2 I; # EXTEND VALUE 2 #
                                          852. ITEM I I; # LOOP COUNTER #
                                          853. ITEM J I; # LOOP COUNTER #
                                          854. ITEM N I; # COUNTER #
                                          855. ITEM NAST I; # NUMBER OF PRU-S IN *AST* #
                                          856. ITEM NFCT I; # NUMBER OF PRU-S IN *FCT* #
                                          857. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          858. ITEM STAT I; # STATUS #
                                          859. ITEM TEMP I; # TEMPORARY STORAGE #
                                          860. ITEM WRD$AV I; # NUMBER OF WORDS AVAILABLE #
                                          861. ITEM WRD$ND I; # NUMBER OF WORDS NEEDED #
                                          862. CONTROL EJECT;
                                          863.  
                                          864. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          865. IF ERRSTAT NQ CMASTAT"NOERR"
                                          866. THEN
                                          867. BEGIN
                                          868. RETURN; # RETURN ERROR STATUS #
                                          869. END
                                          870.  
                                          871. IF OCT$ATTM[ORD] NQ "M"
                                          872. THEN # IF NOT OPEN IN MODIFY MODE #
                                          873. BEGIN
                                          874. ERRSTAT = CMASTAT"MODERR";
                                          875. RETURN; # RETURN ERROR STATUS #
                                          876. END
                                          877.  
                                          878. P<PREAMBLE> = OCT$PRMA[ORD];
                                          879. IF PRM$SCW1[SMID ] EQ 0
                                          880. THEN # IF NO SUCH SUBCATALOG #
                                          881. BEGIN
                                          882. ERRSTAT = CMASTAT"NOSUBCAT";
                                          883. RETURN; # RETURN ERROR STATUS #
                                          884. END
                                          885.  
                                          886. BFLUSH(QRADDR,ERRSTAT); # FLUSH CATALOG *FCT* I/O BUFFER #
                                          887. FB$CWRD[0] = 0;
                                          888. IF ERRSTAT NQ CMASTAT"NOERR"
                                          889. THEN
                                          890. BEGIN
                                          891. RETURN;
                                          892. END
                                          893.  
                                          894. #
                                          895. * SET FAMILY AND USER INDEX.
                                          896. #
                                          897.  
                                          898. PFP$WRD0[0] = 0;
                                          899. PFP$FAM[0] = OCT$FAM[ORD];
                                          900. PFP$UI[0] = DEF$UI + OCT$SUBF[ORD];
                                          901. PFP$FG1[0] = TRUE;
                                          902. PFP$FG4[0] = TRUE;
                                          903. SETPFP(PFP);
                                          904. IF PFP$STAT[0] NQ 0
                                          905. THEN # IF FAMILY NOT FOUND #
                                          906. BEGIN
                                          907. CMA$RTN[0] = "CEXTSC.";
                                          908. MESSAGE(CMAMSG,UDFL1); # ISSUE ERROR MESSAGE #
                                          909. ABORT;
                                          910. END
                                          911.  
                                          912. ZSETFET(TFETADR,OCT$LFN[ORD],FCTBADR,SEQBL,RFETL);
                                          913. FET$EP[0] = TRUE;
                                          914. ZSETFET(TFETADR+RFETL,TSFMCAT,TBUFADR,TBUFL,RFETL);
                                          915. FET$EP[0] = TRUE;
                                          916. REWIND(TFET[0],NRCL);
                                          917. CDEFTF(TFET[1],ERRSTAT); # DEFINE TEMPORARY CATALOG FILE #
                                          918. IF ERRSTAT NQ CMASTAT"NOERR"
                                          919. THEN
                                          920. BEGIN
                                          921. RETURN; # RETURN ERROR STATUS #
                                          922. END
                                          923.  
                                          924. #
                                          925. * DETERMINE CATALOG EXTENSION VALUES.
                                          926. * (EXT1) = RELATIVE SECTOR ADDRESS TO BEGIN *FCT* EXTENSION AT.
                                          927. * (NFCT) = NUMBER OF PRU-S NEEDED FOR THE *FCT* EXTENSION.
                                          928. #
                                          929.  
                                          930. EXT1 = PRM$FCTLOC[SMID] + PRM$ENTRC[SMID] * 16;
                                          931. NFCT = 16 * NUM;
                                          932.  
                                          933.  
                                          934. #
                                          935. * UPDATE CATALOG PREAMBLE.
                                          936. #
                                          937.  
                                          938. PRM$ENTRC[SMID ] = PRM$ENTRC[SMID ] + NUM;
                                          939. FASTFOR I = 1 STEP 1 UNTIL MAXSM
                                          940. DO
                                          941. BEGIN
                                          942. IF PRM$ASTLOC[I] GR PRM$ASTLOC[SMID]
                                          943. THEN # IF SUBCATALOG LOCATION CHANGED #
                                          944. BEGIN
                                          945. PRM$FCTLOC[I] = PRM$FCTLOC[I] + NFCT;
                                          946. PRM$ASTLOC[I] = PRM$ASTLOC[I] + NFCT;
                                          947. END
                                          948.  
                                          949. END
                                          950.  
                                          951. #
                                          952. * TRANSFER CATALOG FILE TO TEMPORARY FILE, EXTENDING SUBCATALOG.
                                          953. #
                                          954.  
                                          955. READ(TFET[0],RCL);
                                          956. READW(TFET[0],WBUF,WBUFL,STAT);
                                          957. IF STAT EQ CIOERR
                                          958. THEN # IF *CIO* ERROR #
                                          959. BEGIN
                                          960. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[0]);
                                          961. RETURN;
                                          962. END
                                          963.  
                                          964. IF STAT NQ 0
                                          965. THEN # IF TRANSFER NOT COMPLETE #
                                          966. BEGIN
                                          967. CMA$RTN[0] = "CEXTSC.";
                                          968. MESSAGE(CMAMSG,UDFL1);
                                          969. ABORT;
                                          970. END
                                          971.  
                                          972. P<TBUF> = WBUFADR;
                                          973. FASTFOR I = 0 STEP 1 UNTIL MAXSM
                                          974. DO
                                          975. BEGIN
                                          976. TBUF$W[I+1] = PRM$SCW1[I];
                                          977. TBUF$W1[I+1] = PRM$SCW2[I];
                                          978. TBUF$W2[I+1] = PRM$SCW3[I];
                                          979. END
                                          980. P<TBUF> = TBUFADR;
                                          981.  
                                          982. WRITEW(TFET[1],WBUF,WBUFL,STAT);
                                          983. SLOWFOR I = 2 STEP 1 WHILE STAT EQ 0
                                          984. DO
                                          985. BEGIN # TRANSFER CATALOG #
                                          986. IF I EQ EXT1
                                          987. THEN
                                          988. BEGIN # FILE TO BE EXTENDED #
                                          989.  
                                          990. ZFILL(WBUF,WBUFL);
                                          991.  
                                          992. SLOWFOR J = 1 STEP 1 UNTIL NFCT
                                          993. DO
                                          994. BEGIN
                                          995. WRITEW(TFET[1],WBUF,WBUFL,STAT);
                                          996. IF STAT NQ 0
                                          997. THEN # IF *CIO* ERROR #
                                          998. BEGIN
                                          999. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[1]);
                                          1000. RETURN;
                                          1001. END
                                          1002.  
                                          1003. END
                                          1004.  
                                          1005. END # FILE TO BE EXTENDED #
                                          1006.  
                                          1007. READW(TFET[0],WBUF,WBUFL,STAT);
                                          1008. IF STAT EQ CIOERR
                                          1009. THEN # IF *CIO* ERROR #
                                          1010. BEGIN
                                          1011. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[0]);
                                          1012. RETURN;
                                          1013. END
                                          1014.  
                                          1015. IF STAT NQ 0 AND (I + 1) EQ EXT1
                                          1016. THEN # ADD SPACE AT END OF FILE #
                                          1017. BEGIN
                                          1018. SLOWFOR J = 1 STEP 1 UNTIL NFCT
                                          1019. DO
                                          1020. BEGIN
                                          1021. WRITEW(TFET[1],WBUF,WBUFL,STAT);
                                          1022. IF STAT NQ 0
                                          1023. THEN
                                          1024. BEGIN
                                          1025. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[1]);
                                          1026. RETURN;
                                          1027. END
                                          1028.  
                                          1029. END
                                          1030.  
                                          1031. STAT = -1;
                                          1032. TEST I;
                                          1033. END
                                          1034.  
                                          1035.  
                                          1036. IF STAT NQ 0
                                          1037. THEN # IF *EOR*, *EOF* OR *EOI* #
                                          1038. BEGIN
                                          1039. TEST I; # EXIT LOOP #
                                          1040. END
                                          1041.  
                                          1042. WRITEW(TFET[1],WBUF,WBUFL,STAT);
                                          1043. IF STAT NQ 0
                                          1044. THEN # *CIO* ERROR #
                                          1045. BEGIN
                                          1046. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[1]);
                                          1047. RETURN;
                                          1048. END
                                          1049.  
                                          1050.  
                                          1051. END # TRANSFER CATALOG #
                                          1052.  
                                          1053. WRITEF(TFET[1],RCL);
                                          1054. IF FET$AT[0] NQ 0
                                          1055. THEN
                                          1056. BEGIN
                                          1057. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[1]);
                                          1058. RETURN;
                                          1059. END
                                          1060.  
                                          1061. #
                                          1062. * REPLACE MSF CATALOG WITH NEW CATALOG (*TSFMCAT*).
                                          1063. #
                                          1064.  
                                          1065. REPLCAT(ORD,ERRSTAT);
                                          1066. RETURN;
                                          1067. END # CEXTSC #
                                          1068.  
                                          1069. TERM
                                          1070. PROC CFLUSH((FAMNM),(SUBF),(QRADDR),ERRSTAT);
                                          1071. # TITLE CFLUSH - FLUSHES THE CATALOG I/O BUFFER. #
                                          1072. BEGIN # CFLUSH #
                                          1073.  
                                          1074. #
                                          1075. ** CFLUSH - FLUSHES THE CATALOG I/O BUFFER.
                                          1076. *
                                          1077. * *CFLUSH* CHECKS FOR ERRORS AND CALLS *BFLUSH* TO FLUSH THE
                                          1078. * CATALOG I/O BUFFER, WHICH IS USED FOR READING AND WRITING
                                          1079. * *FCT* ENTRIES. THE CATALOG MUST BE OPEN IN MODIFY MODE.
                                          1080. *
                                          1081. * CFLUSH - IS CALLED BY ADDCAR,ADDCSU,ADDCUBE,DESTAGR,PURGCHN,
                                          1082. * PURGFCT,RMVCAR,RMVCUBE,STAGER.
                                          1083. *
                                          1084. *
                                          1085. * PROC CFLUSH((FAMNM),(SUBF),(QRADDR),ERRSTAT)
                                          1086. *
                                          1087. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          1088. * 7 CHARACTER MAXIMUM.
                                          1089. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1090. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          1091. *
                                          1092. * EXIT (ERRSTAT) - ERROR STATUS.
                                          1093. * (VALUES DEFINED IN *COMBCMS*)
                                          1094. * = NO ERRORS.
                                          1095. * = CATALOG FILE INTERLOCKED.
                                          1096. * = CATALOG NOT OPEN.
                                          1097. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          1098. * = *CIO* ERROR.
                                          1099. #
                                          1100.  
                                          1101. ITEM FAMNM C(7); # FAMILY NAME #
                                          1102. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1103. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          1104. ITEM ERRSTAT I; # ERROR STATUS #
                                          1105.  
                                          1106. #
                                          1107. **** PROC CFLUSH - XREF LIST BEGIN.
                                          1108. #
                                          1109.  
                                          1110. XREF
                                          1111. BEGIN
                                          1112. PROC BFLUSH; # BUFFER FLUSH #
                                          1113. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          1114. END
                                          1115.  
                                          1116. #
                                          1117. **** PROC CFLUSH - XREF LIST END.
                                          1118. #
                                          1119.  
                                          1120. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1121. *CALL COMBFAS
                                          1122. *CALL COMBCMD
                                          1123. *CALL COMBCMS
                                          1124. *CALL COMSPFM
                                          1125.  
                                          1126. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          1127. CONTROL EJECT;
                                          1128.  
                                          1129. #
                                          1130. * FIND ENTRY IN THE OPEN CATALOG TABLE.
                                          1131. #
                                          1132.  
                                          1133. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT);
                                          1134. IF ERRSTAT NQ CMASTAT"NOERR"
                                          1135. THEN
                                          1136. BEGIN
                                          1137. RETURN; # RETURN ERROR STATUS #
                                          1138. END
                                          1139.  
                                          1140. IF OCT$ATTM[ORD] NQ "M"
                                          1141. THEN # IF NOT OPEN IN MODIFY MODE #
                                          1142. BEGIN
                                          1143. ERRSTAT = CMASTAT"MODERR"; # RETURN ERROR STATUS #
                                          1144. RETURN;
                                          1145. END
                                          1146.  
                                          1147. BFLUSH(QRADDR,ERRSTAT); # FLUSH CATALOG *FCT* I/O BUFFER #
                                          1148. RETURN;
                                          1149. END # CFLUSH #
                                          1150.  
                                          1151. TERM
                                          1152. PROC CGETFCT((FAMNM),(SUBF),(SMID ),(FCTORD),(BADDR),(QRADDR),
                                          1153. ERRSTAT);
                                          1154. # TITLE CGETFCT - GET AN *FCT* ENTRY. #
                                          1155. BEGIN # CGETFCT #
                                          1156.  
                                          1157. #
                                          1158. ** CGETFCT - GET AN *FCT* ENTRY.
                                          1159. *
                                          1160. *
                                          1161. * *CGETFCT* RETURNS THE REQUESTED FILE AND CARTRIDGE TABLE ENTRY
                                          1162. * TO THE CALLER.
                                          1163. *
                                          1164. * CGETFCT - IS CALLED BY ACQ$FCT,DBFLAG,DBFMAP,DBRDFIL,DBREL,
                                          1165. * LBRMMSC,OPENCAT,USANALF,USRPDE,VLBLDVT.
                                          1166. *
                                          1167. * PROC CGETFCT((FAMNM),(SUBF),(SMID ),(FCTORD),(BADDR),
                                          1168. * (QRADDR),ERRSTAT)
                                          1169. *
                                          1170. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          1171. * 7 CHARACTER MAXIMUM.
                                          1172. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1173. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          1174. * (FCTORD) - ORDINAL OF ENTRY IN *FCT*.
                                          1175. * (BADDR) - ADDRESS OF BUFFER TO RECEIVE *FCT* ENTRY.
                                          1176. * (QRADDR) - ADDRESS OF *HLRQ* ENTRY, ELSE ZERO.
                                          1177. *
                                          1178. * EXIT THE REQUESTED *FCT* ENTRY IS RETURNED TO THE CALLER AT
                                          1179. * THE ADDRESS SPECIFIED BY (BADDR).
                                          1180. * (ERRSTAT) - ERROR STATUS.
                                          1181. * (VALUES DEFINED IN *COMBCMS*)
                                          1182. * = NO ERROR.
                                          1183. * = CATALOG FILE INTERLOCKED.
                                          1184. * = CATALOG NOT OPEN.
                                          1185. * = NO SUCH SUBCATALOG.
                                          1186. * = *CIO* ERROR.
                                          1187. * = *FCT* ORDINAL OUT OF RANGE.
                                          1188. #
                                          1189.  
                                          1190. ITEM FAMNM C(7); # FAMILY NAME #
                                          1191. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1192. ITEM SMID U; # SM IDENTIFIER #
                                          1193. ITEM FCTORD I; # *FCT* ORDINAL #
                                          1194. ITEM BADDR U; # ADDRESS OF *FCT* ENTRY BUFFER #
                                          1195. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          1196. ITEM ERRSTAT I; # ERROR STATUS #
                                          1197.  
                                          1198. #
                                          1199. **** PROC CGETFCT - XREF LIST BEGIN.
                                          1200. #
                                          1201.  
                                          1202. XREF
                                          1203. BEGIN
                                          1204. PROC CBUFMAN; # MANAGE CATALOG *FCT* BUFFER #
                                          1205. END
                                          1206.  
                                          1207. #
                                          1208. **** PROC CGETFCT - XREF LIST END.
                                          1209. #
                                          1210.  
                                          1211. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1212. *CALL COMBFAS
                                          1213. *CALL COMBCMD
                                          1214. *CALL COMBCMS
                                          1215. *CALL COMBMCT
                                          1216.  
                                          1217. ITEM I I; # LOOP COUNTER #
                                          1218. ITEM MODF B = FALSE; # MODIFY MODE FLAG #
                                          1219. ITEM OFFSET I; # WORD OFFSET WITHIN BUFFER #
                                          1220.  
                                          1221. BASED
                                          1222. ARRAY ENTBUF [1:FCTENTL] P(1); # *FCT* ENTRY BUFFER #
                                          1223. BEGIN
                                          1224. ITEM ENT$WRD I(00,00,60); # ENTRY WORD #
                                          1225. END
                                          1226.  
                                          1227. CONTROL EJECT;
                                          1228.  
                                          1229. #
                                          1230. * ENSURE THAT REQUESTED *FCT* ENTRY IS WITHIN I/O BUFFER.
                                          1231. #
                                          1232.  
                                          1233. CBUFMAN(FAMNM,SUBF,SMID,FCTORD,MODF,QRADDR,ERRSTAT);
                                          1234. IF ERRSTAT NQ CMASTAT"NOERR"
                                          1235. THEN
                                          1236. BEGIN
                                          1237. RETURN; # RETURN ERROR STATUS #
                                          1238. END
                                          1239.  
                                          1240. #
                                          1241. * TRANSFER ENTRY TO CALLERS BUFFER.
                                          1242. #
                                          1243.  
                                          1244. P<ENTBUF> = BADDR;
                                          1245. SLOWFOR I = 1 STEP 1 UNTIL FCTENTL
                                          1246. DO
                                          1247. BEGIN
                                          1248. ENT$WRD[I] = FCTB$WRD[I];
                                          1249. END
                                          1250.  
                                          1251. RETURN;
                                          1252. END # CGETFCT #
                                          1253.  
                                          1254. TERM
                                          1255. PROC CGETPD((FAMNM),(SUBF),(SMID ),LASTPRG,(QRADDR),ERRSTAT);
                                          1256. # TITLE CGETPD - GET PURGE DATE. #
                                          1257. BEGIN # CGETPD #
                                          1258.  
                                          1259. #
                                          1260. ** CGETPD - GET PURGE DATE.
                                          1261. *
                                          1262. *
                                          1263. * *CGETPD* GETS THE DATE AND TIME OF THE LAST PURGE OF ORPHAN
                                          1264. * FILES (AN MSF FILE WITH NO REFERENCE TO IT IN THE *PFC*) FROM THE
                                          1265. * APPROPRIATE CATALOG PREAMBLE ENTRY.
                                          1266. *
                                          1267. * CGETPD - IS CALLED BY GETPD AND VLSUBTD.
                                          1268. *
                                          1269. * PROC CGETPD((FAMNM),(SUBF),(SMID ),LASTPRG,(QRADDR),ERRSTAT)
                                          1270. *
                                          1271. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED
                                          1272. * 7 CHARACTER MAXIMUM.
                                          1273. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1274. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          1275. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          1276. *
                                          1277. * EXIT (LASTPRG) - LAST PURGE DATE AND TIME IN PACKED FORMAT,
                                          1278. * AS RETURNED BY THE *PDATE* MACRO.
                                          1279. * (ERRSTAT) - ERROR STATUS.
                                          1280. * (VALUES DEFINED IN *COMBCMS*)
                                          1281. * = NO ERROR.
                                          1282. * = CATALOG FILE INTERLOCKED.
                                          1283. * = CATALOG NOT OPEN.
                                          1284. * = NO SUCH SUBCATALOG EXISTS.
                                          1285. * = *CIO* ERROR.
                                          1286. *
                                          1287. * NOTES THE PREAMBLE TABLE DOES NOT CONTAIN THE LAST PURGE
                                          1288. * DATE AND TIME (ONLY THE FIRST WORD OF EACH SUBCATALOG
                                          1289. * ENTRY IS IN THE TABLE), SO THE PREAMBLE MUST BE READ
                                          1290. * FROM THE CATALOG.
                                          1291. #
                                          1292.  
                                          1293. ITEM FAMNM C(7); # FAMILY NAME #
                                          1294. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1295. ITEM SMID U; # SM IDENTIFIER #
                                          1296. ITEM LASTPRG U; # LAST PURGE DATE #
                                          1297. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          1298. ITEM ERRSTAT I; # ERROR STATUS #
                                          1299.  
                                          1300. #
                                          1301. **** PROC CGETPD - XREF LIST BEGIN.
                                          1302. #
                                          1303.  
                                          1304. XREF
                                          1305. BEGIN
                                          1306. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          1307. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          1308. PROC REWIND; # REWIND FILE #
                                          1309. PROC RPHR; # READ PRU TO *CIO* BUFFER #
                                          1310. PROC ZSETFET; # INITIALIZES A FET #
                                          1311. END
                                          1312.  
                                          1313. #
                                          1314. **** PROC CGETPD - XREF LIST END.
                                          1315. #
                                          1316.  
                                          1317. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1318. *CALL COMBFAS
                                          1319. *CALL COMBCMD
                                          1320. *CALL COMBCMS
                                          1321. *CALL COMBFET
                                          1322. *CALL COMBMCT
                                          1323. *CALL COMXMSC
                                          1324.  
                                          1325. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          1326. CONTROL EJECT;
                                          1327.  
                                          1328. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          1329. IF ERRSTAT NQ CMASTAT"NOERR"
                                          1330. THEN
                                          1331. BEGIN
                                          1332. RETURN; # RETURN ERROR STATUS #
                                          1333. END
                                          1334.  
                                          1335. P<PREAMBLE> = OCT$PRMA[ORD];
                                          1336. IF PRM$SCW1[SMID ] EQ 0
                                          1337. THEN # IF NO SUCH SUBCATALOG #
                                          1338. BEGIN
                                          1339. ERRSTAT = CMASTAT"NOSUBCAT";
                                          1340. RETURN;
                                          1341. END
                                          1342.  
                                          1343.  
                                          1344. #
                                          1345. * GET DATE AND TIME OF LAST PURGE OF ORPHAN FILES.
                                          1346. #
                                          1347.  
                                          1348. ZSETFET(TFETADR,OCT$LFN[ORD],TBUFADR,TBUFL,RFETL);
                                          1349. FET$EP[0] = TRUE;
                                          1350. REWIND(FETSET[0],RCL);
                                          1351. RPHR(FETSET[0],RCL);
                                          1352. IF FET$AT[0] NQ 0
                                          1353. THEN
                                          1354. BEGIN
                                          1355. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,FETSET[0]);
                                          1356. RETURN;
                                          1357. END
                                          1358.  
                                          1359. P<PREAMBLE> = TBUFADR;
                                          1360. LASTPRG = PRM$PDATE[SMID ];
                                          1361. RETURN;
                                          1362. END # CGETPD #
                                          1363.  
                                          1364. TERM
                                          1365. PROC CINIT((FAMNM),(SUBF),(FLNM),ERRSTAT);
                                          1366. # TITLE CINIT - MSS CATALOG INITIALIZATION. #
                                          1367. BEGIN # CINIT #
                                          1368.  
                                          1369. #
                                          1370. ** CINIT - MSS CATALOG INITIALIZATION.
                                          1371. *
                                          1372. * CINIT - IS CALLED BY DFCAT OF THE SSDEF DECK.
                                          1373. *
                                          1374. * *CINIT* CREATES A FILE AND INITIALIZES IT AS A SKELETON CATALOG
                                          1375. * CONTAINING A PREAMBLE BUT NO SUBCATALOGS. THE PREAMBLE CONTAINS
                                          1376. * THE FAMILY NAME AND SUBFAMILY DESIGNATOR IN THE HEADER.
                                          1377. *
                                          1378. * PROC CINIT((FAMNM),(SUBF),(FLNM),ERRSTAT)
                                          1379. *
                                          1380. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          1381. * 7 CHARACTER MAXIMUM.
                                          1382. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1383. * (FLNM) - CATALOG FILE NAME, LEFT JUSTIFIED, ZERO
                                          1384. * FILLED, 7 CHARACTER MAXIMUM.
                                          1385. *
                                          1386. * EXIT (ERRSTAT) - ERROR STATUS.
                                          1387. * (VALUES DEFINED IN *COMBCMS*)
                                          1388. * = NO ERROR.
                                          1389. * = CATALOG FILE ALREADY EXISTS.
                                          1390. * = *CIO* ERROR.
                                          1391. * = CATALOG DEFINE ERROR.
                                          1392. #
                                          1393.  
                                          1394. ITEM FAMNM C(7); # FAMILY NAME #
                                          1395. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1396. ITEM FLNM C(7); # CATALOG FILE NAME #
                                          1397. ITEM ERRSTAT I; # ERROR STATUS #
                                          1398.  
                                          1399. #
                                          1400. **** PROC CINIT - XREF LIST BEGIN.
                                          1401. #
                                          1402.  
                                          1403. XREF
                                          1404. BEGIN
                                          1405. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
                                          1406. PROC RETERN; # RETURN FILE TO SYSTEM #
                                          1407. PROC WRITEF; # WRITE END OF FILE #
                                          1408. PROC WRITEW; # WRITE DATA FROM WORKING BUFFER #
                                          1409. PROC ZSETFET; # INITIALIZES A FET #
                                          1410. END
                                          1411.  
                                          1412. #
                                          1413. **** PROC CINIT - XREF LIST END.
                                          1414. #
                                          1415.  
                                          1416. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1417. *CALL COMBFAS
                                          1418. *CALL COMBCMD
                                          1419. *CALL COMBCMS
                                          1420. *CALL COMBFET
                                          1421. *CALL COMBMCT
                                          1422. *CALL COMBPFS
                                          1423. *CALL COMXMSC
                                          1424. *CALL COMSPFM
                                          1425.  
                                          1426. ITEM I I; # LOOP COUNTER #
                                          1427. ITEM STAT I; # DEFINE STATUS #
                                          1428. CONTROL EJECT;
                                          1429.  
                                          1430. #
                                          1431. * DEFINE CATALOG FILE.
                                          1432. #
                                          1433.  
                                          1434. ERRSTAT = CMASTAT"NOERR";
                                          1435. PFD("DEFINE",FLNM,0,"BR","Y","SR","MR","RC",PFSTAT,"UP",0,0);
                                          1436. IF PFSTAT NQ 0
                                          1437. THEN
                                          1438. BEGIN # DEFINE ERROR #
                                          1439. IF PFSTAT EQ FAP
                                          1440. THEN # IF FILE ALREADY EXISTS #
                                          1441. BEGIN
                                          1442. ERRSTAT = CMASTAT"INTLZD";
                                          1443. END
                                          1444.  
                                          1445. ELSE
                                          1446. BEGIN
                                          1447. ERRSTAT = CMASTAT"DEFERR";
                                          1448. END
                                          1449.  
                                          1450. RETURN; # RETURN ERROR STATUS #
                                          1451. END # DEFINE ERROR #
                                          1452.  
                                          1453. #
                                          1454. * CREATE SKELETON CATALOG.
                                          1455. #
                                          1456.  
                                          1457. FASTFOR I = 1 STEP 1 UNTIL WBUFL
                                          1458. DO # ZERO FILL WORKING BUFFER #
                                          1459. BEGIN
                                          1460. WBUF$W[I] = 0;
                                          1461. END
                                          1462.  
                                          1463. P<PREAMBLE> = WBUFADR;
                                          1464. PRM$FAM[0] = FAMNM;
                                          1465. PRM$SUBF[0] = SUBF;
                                          1466. #
                                          1467. * THE PRM$ID IS SET TO 1 FOR THE M860 SFMCAT SO THAT IF
                                          1468. * MSS AMD M860 ARE EVER RUN IN PARALLEL PFDUMP CAN DISTINGUISH
                                          1469. * BETWEEN THE TWO.
                                          1470. #
                                          1471. PRM$ID[0] = 1;
                                          1472. ZSETFET(TFETADR,FLNM,TBUFADR,TBUFL,RFETL); # SET UP FET #
                                          1473. FET$EP[0] = TRUE;
                                          1474. WRITEW(FETSET[0],PREAMBLE,WBUFL,STAT);
                                          1475. WRITEF(FETSET[0],RCL);
                                          1476. IF FET$AT[0] NQ 0
                                          1477. THEN
                                          1478. BEGIN
                                          1479. ERRSTAT = CMASTAT"CIOERR";
                                          1480. END
                                          1481.  
                                          1482. RETERN(FETSET[0],RCL);
                                          1483. RETURN;
                                          1484. END # CINIT #
                                          1485.  
                                          1486. TERM
                                          1487. PROC CNAME(FLNM);
                                          1488. # TITLE CNAME - GET LFN FOR CATALOG. #
                                          1489. BEGIN # CNAME #
                                          1490.  
                                          1491. #
                                          1492. ** CNAME - GET LFN FOR CATALOG.
                                          1493. *
                                          1494. * *CNAME* SUPPLIES A 7 CHARACTER NAME TO BE USED AS THE LFN ON AN
                                          1495. * ATTACH OF A CATALOG FILE.
                                          1496. *
                                          1497. * CNAME - IS CALLED BY COPEN.
                                          1498. * PROC CNAME(FLNM)
                                          1499. *
                                          1500. * EXIT (FLNM) - A SEVEN CHARACTER FILE NAME.
                                          1501. *
                                          1502. * NOTES *INT$NUM* IS INITIALIZED TO 1000000D SO THAT
                                          1503. * WHEN IT IS CONVERTED TO DISPLAY CODE, THE RESULT
                                          1504. * WILL CONTAIN DISPLAY CODED NUMBERS IN THE BOTTOM
                                          1505. * 6 CHARACTERS RATHER THAN BLANKS.
                                          1506. #
                                          1507.  
                                          1508. ITEM FLNM C(7); # FILE NAME #
                                          1509.  
                                          1510. #
                                          1511. **** PROC CNAME - XREF LIST BEGIN.
                                          1512. #
                                          1513.  
                                          1514. XREF
                                          1515. BEGIN
                                          1516. FUNC XCDD C(10); # INTEGER TO DISPLAY CODE
                                          1517.   CONVERSION #
                                          1518. END
                                          1519.  
                                          1520. #
                                          1521. **** PROC CNAME - XREF LIST END.
                                          1522. #
                                          1523.  
                                          1524. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1525. *CALL COMBFAS
                                          1526. *CALL COMBCMD
                                          1527.  
                                          1528. ITEM DC$NUM C(10); # DISPLAY CODE NUMBER #
                                          1529. ITEM INT$NUM I = 1000000; # INTEGER NUMBER #
                                          1530. ITEM NEXTNM C(7) = "C000000"; # NEXT FILE NAME #
                                          1531. CONTROL EJECT;
                                          1532.  
                                          1533. FLNM = NEXTNM; # SET FILE NAME #
                                          1534.  
                                          1535. #
                                          1536. * INCREMENT FILE NAME.
                                          1537. #
                                          1538.  
                                          1539. INT$NUM = INT$NUM + 1;
                                          1540. DC$NUM = XCDD(INT$NUM);
                                          1541. C<1,6>NEXTNM = C<4,6>DC$NUM;
                                          1542. B<0,60>DC$NUM = 0; # CLEAR DISPLAY CODE VALUE #
                                          1543. RETURN;
                                          1544. END # CNAME #
                                          1545.  
                                          1546. TERM
                                          1547. PROC COPEN((FAMNM),(SUBF),(FLNM),(ATTM),(ACCM),ERRSTAT);
                                          1548. # TITLE COPEN - OPEN CATALOG. #
                                          1549. BEGIN # COPEN #
                                          1550.  
                                          1551. #
                                          1552. ** COPEN - OPEN CATALOG.
                                          1553. *
                                          1554. * *COPEN* PREPARES THE GIVEN CATALOG FOR SUBSEQUENT REFERENCE
                                          1555. * BY THE CALLER.
                                          1556. *
                                          1557. * COPEN - IS CALLED BY DBMAIN,LBRMMSC,OPENCAT,USRPDE,USRPBAS,
                                          1558. * VLSUBFM.
                                          1559. *
                                          1560. * PROC COPEN((FAMNM),(SUBF),(FLNM),(ATTM),(ACCM),ERRSTAT)
                                          1561. *
                                          1562. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          1563. * 7 CHARACTER MAXIMUM.
                                          1564. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1565. * (FLNM) - CATALOG FILE NAME, LEFT JUSTIFIED, ZERO
                                          1566. * FILLED, 7 CHARACTER MAXIMUM.
                                          1567. * (ATTM) - FILE ATTACH MODE IN DISPLAY CODE.
                                          1568. * = *M*, MODIFY MODE.
                                          1569. * = *RM*, READ/ALLOW MODIFY MODE.
                                          1570. * (ACCM) - FILE ACCESS MODE.
                                          1571. * = FALSE, RANDOM ACCESS.
                                          1572. * = TRUE, SEQUENTIAL ACCESS.
                                          1573. *
                                          1574. * CALLER MUST ISSUE *SETPFP* TO APPROPRIATE FAMILY AND
                                          1575. * USER INDEX, IF THE CATALOG FILE IS NOT LOCAL.
                                          1576. *
                                          1577. * EXIT (ERRSTAT) - ERROR STATUS.
                                          1578. * (VALUES DEFINED IN *COMBCMS*)
                                          1579. * = NO ERRORS.
                                          1580. * = CATALOG FILE INTERLOCKED.
                                          1581. * = CATALOG ALREADY OPEN.
                                          1582. * = *CIO* ERROR.
                                          1583. * = CATALOG ATTACH ERROR.
                                          1584. * = OPEN CATALOG TABLE FULL.
                                          1585. *
                                          1586. * NOTES THE PFN OF AN MSF CATALOG IS *SFMCATX*, WHERE *X* IS
                                          1587. * THE SUBFAMILY DESIGNATOR.
                                          1588. * *COPEN* ATTACHES THE CATALOG FILE *SFMCATX*, CREATES
                                          1589. * AN ENTRY IN THE *OCT* AND IF THE CATALOG IS NOT
                                          1590. * INTERLOCKED, THE FIRST WORD OF THE HEADER AND OF EACH
                                          1591. * SUBCATALOG ENTRY IN THE PREAMBLE IS READ INTO A
                                          1592. * TABLE. IF THE CALLER HAS ALREADY ATTACHED THE
                                          1593. * CATALOG FILE, (FLNM) MUST BE THE LFN OF THE FILE
                                          1594. * INSTEAD OF THE PFN, SO THAT THE ATTACH WILL BE
                                          1595. * BYPASSED.
                                          1596. #
                                          1597.  
                                          1598. ITEM FAMNM C(7); # FAMILY NAME #
                                          1599. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1600. ITEM FLNM C(7); # CATALOG FILE NAME #
                                          1601. ITEM ATTM C(2); # FILE ATTACH MODE #
                                          1602. ITEM ACCM B; # FILE ACCESS MODE #
                                          1603. ITEM ERRSTAT I; # ERROR STATUS #
                                          1604.  
                                          1605. #
                                          1606. **** PROC COPEN - XREF LIST BEGIN.
                                          1607. #
                                          1608.  
                                          1609. XREF
                                          1610. BEGIN
                                          1611. PROC CNAME; # GET CATALOG LFN #
                                          1612. PROC CRDPRM; # READ CATALOG PREAMBLE #
                                          1613. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
                                          1614. END
                                          1615.  
                                          1616. #
                                          1617. **** PROC COPEN - XREF LIST END.
                                          1618. #
                                          1619.  
                                          1620. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1621. *CALL COMBFAS
                                          1622. *CALL COMBCMD
                                          1623. *CALL COMBCMS
                                          1624. *CALL COMBMCT
                                          1625. *CALL COMBPFS
                                          1626. *CALL COMXCTF
                                          1627. *CALL COMXMSC
                                          1628. *CALL COMSPFM
                                          1629.  
                                          1630. ITEM I I; # LOOP COUNTER #
                                          1631. ITEM LFN C(7); # LOCAL FILE NAME #
                                          1632. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          1633. CONTROL EJECT;
                                          1634.  
                                          1635. ERRSTAT = CMASTAT"NOERR";
                                          1636. IF C<0,6>FLNM EQ SFMCAT
                                          1637. THEN # IF FILE NOT ALREADY ATTACHED #
                                          1638. BEGIN
                                          1639.  
                                          1640. #
                                          1641. * ATTACH CATALOG FILE.
                                          1642. #
                                          1643.  
                                          1644. CNAME(LFN);
                                          1645. PFD("ATTACH",LFN,FLNM,"M",ATTM,"RC",PFSTAT,"NA",0,"UP",0,0);
                                          1646. IF PFSTAT NQ 0 AND PFSTAT NQ FBS
                                          1647. THEN # IF ATTACH ERROR #
                                          1648. BEGIN
                                          1649. ERRSTAT = CMASTAT"ATTERR";
                                          1650. RETURN; # RETURN ERROR STATUS #
                                          1651. END
                                          1652.  
                                          1653. END
                                          1654.  
                                          1655. ELSE
                                          1656. BEGIN
                                          1657. LFN = FLNM;
                                          1658. END
                                          1659.  
                                          1660. #
                                          1661. * CREATE AN OPEN CATALOG TABLE ENTRY.
                                          1662. #
                                          1663.  
                                          1664. ORD = 0;
                                          1665. FASTFOR I = 1 STEP 1 WHILE I LQ OCTLEN AND ORD EQ 0
                                          1666. DO
                                          1667. BEGIN # SEARCH *OCT* #
                                          1668. IF OCT$SUBF[I] EQ SUBF ##
                                          1669. AND OCT$FAM[I] EQ FAMNM
                                          1670. THEN # IF CATALOG ALREADY OPEN #
                                          1671. BEGIN
                                          1672. ERRSTAT = CMASTAT"FOPEN";
                                          1673. RETURN; # RETURN ERROR STATUS #
                                          1674. END
                                          1675.  
                                          1676. IF OCT$W1[I] EQ 0
                                          1677. THEN # IF EMPTY ENTRY #
                                          1678. BEGIN
                                          1679. ORD = I;
                                          1680. END
                                          1681.  
                                          1682. END # SEARCH *OCT* #
                                          1683.  
                                          1684. IF ORD EQ 0
                                          1685. THEN # IF NO EMPTY ENTRIES #
                                          1686. BEGIN
                                          1687. ERRSTAT = CMASTAT"OCTFULL";
                                          1688. RETURN; # RETURN ERROR STATUS #
                                          1689. END
                                          1690.  
                                          1691. OCT$FAM[ORD] = FAMNM;
                                          1692. OCT$SUBF[ORD] = SUBF;
                                          1693. OCT$LFN[ORD] = LFN;
                                          1694. OCT$ATTM[ORD] = ATTM;
                                          1695. OCT$BUFL[ORD] = SEQBL;
                                          1696.  
                                          1697. #
                                          1698. * CHECK FOR CATALOG INTERLOCK.
                                          1699. #
                                          1700.  
                                          1701. IF PFSTAT EQ FBS
                                          1702. THEN # IF CATALOG INTERLOCKED #
                                          1703. BEGIN
                                          1704. OCT$INTLK[ORD] = TRUE; # SET INTERLOCK FLAGS #
                                          1705. GLBINTLK = TRUE;
                                          1706. ERRSTAT = CMASTAT"INTLK";
                                          1707. RETURN; # RETURN WITH INTERLOCK STATUS #
                                          1708. END
                                          1709.  
                                          1710. CRDPRM(ORD,ERRSTAT); # READ AND UPDATE PREAMBLE #
                                          1711. RETURN;
                                          1712. END # COPEN #
                                          1713.  
                                          1714. TERM
                                          1715. PROC CPIOERR((FAMNM),(SUBF),(QRADDR),ERRSTAT,FET);
                                          1716. # TITLE CPIOERR - PROCESS I/O ERROR ON MSF CATALOG. #
                                          1717.  
                                          1718. BEGIN # CPIOERR #
                                          1719.  
                                          1720. #
                                          1721. ** CPIOERR - PROCESS I/O ERROR ON MSF CATALOG.
                                          1722. *
                                          1723. * *CPIOERR* CLOSES THE MSF CATALOG WITH THE I/O ERROR AND SETS
                                          1724. * AN I/O ERROR STATUS. IF CALLED BY THE MSS EXECUTIVE IT ALSO
                                          1725. * DUMPS THE FET FOR THE CATALOG TO *LOGFILE* AND ISSUES
                                          1726. * AN ERROR MESSAGE TO THE K-DISPLAY AND TO EXEC-S DAYFILE.
                                          1727. *
                                          1728. * CPIOERR - IS CALLED BY BFLUSH,CADDSC,CEXTSC,CGETPD,CPUTPD,
                                          1729. * CRDAST,CWTAST.
                                          1730. *
                                          1731. * PROC CPIOERR((FAMNM),(SUBF),(QRADDR),ERRSTAT,FET)
                                          1732. *
                                          1733. * ENTRY (FAMNM) - FAMILY NAME.
                                          1734. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1735. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          1736. * FET - AN ARRAY CONTAINING THE FET FOR THE MSF CATALOG.
                                          1737. *
                                          1738. * EXIT (ERRSTAT) - ERROR STATUS (VALUES DEFINED IN
                                          1739. * *COMBCMS*).
                                          1740. * = *CIO* ERROR.
                                          1741. *
                                          1742. * MESSAGES * I/O ERROR ON SFMCATN, CATALOG CLOSED.
                                          1743. * RESPOND GO TO ACKNOWLEDGE.*
                                          1744. #
                                          1745.  
                                          1746. ITEM FAMNM C(7); # FAMILY NAME #
                                          1747. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1748. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          1749. ITEM ERRSTAT I; # ERROR STATUS #
                                          1750.  
                                          1751. #
                                          1752. **** PROC CPIOERR - XREF LIST BEGIN.
                                          1753. #
                                          1754.  
                                          1755. XREF
                                          1756. BEGIN
                                          1757. PROC CCLOSE; # CLOSE MSF CATALOG #
                                          1758. PROC KREQ; # K-DISPLAY REQUEST #
                                          1759. PROC RECALL; # RECALL #
                                          1760. END
                                          1761.  
                                          1762. #
                                          1763. **** PROC CPIOERR - XREF LIST END.
                                          1764. #
                                          1765.  
                                          1766. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1767. *CALL COMBFAS
                                          1768. *CALL COMBCMD
                                          1769. *CALL COMBCMS
                                          1770. *CALL COMBKDD
                                          1771.  
                                          1772. ARRAY FET [0:0] P(RFETL); ; # MSF CATALOG FET #
                                          1773. CONTROL EJECT;
                                          1774.  
                                          1775. IF EXEC
                                          1776. THEN
                                          1777. BEGIN # MSS EXECUTIVE PROCESSING #
                                          1778.  
                                          1779. #
                                          1780. * ISSUE ERROR MESSAGE TO EXEC-S DAYFILE AND TO THE K-DISPLAY.
                                          1781. #
                                          1782.  
                                          1783. P<KWORD> = LOC(KDISBLK[0]);
                                          1784. IF KW$WORD[0] NQ 0 AND NOT KW$COMP[0]
                                          1785. THEN # PREVIOUS MESSAGE NOT ISSUED #
                                          1786. BEGIN # K-DISPLAY WORD BUSY #
                                          1787. REPEAT WHILE NOT KW$COMP[0]
                                          1788. DO # WAIT FOR MESSAGE TO BE ISSUED #
                                          1789. BEGIN
                                          1790. RECALL(0);
                                          1791. END
                                          1792.  
                                          1793. END # K-DISPLAY WORD BUSY #
                                          1794.  
                                          1795. KW$WORD[0] = 0;
                                          1796. KW$IC[0] = TRUE;
                                          1797. KW$RPGO[0] = TRUE;
                                          1798. KW$DF[0] = TRUE;
                                          1799. KW$LINE1[0] = KM"KM13";
                                          1800. KW$LINE2[0] = KM"KM21";
                                          1801. KP$SF = SUBF;
                                          1802. KREQ(P<KWORD>,KLINK);
                                          1803. END # MSS EXECUTIVE PROCESSING #
                                          1804.  
                                          1805. CCLOSE(FAMNM,SUBF,QRADDR,ERRSTAT); # CLOSE MSF CATALOG #
                                          1806. ERRSTAT = CMASTAT"CIOERR";
                                          1807. RETURN;
                                          1808. END # CPIOERR #
                                          1809.  
                                          1810. TERM
                                          1811. PROC CPUTFCT((FAMNM),(SUBF),(SMID ),(FCTORD),(BADDR),(QRADDR),
                                          1812. ERRSTAT);
                                          1813. # TITLE CPUTFCT - PUT AN *FCT* ENTRY. #
                                          1814. BEGIN # CPUTFCT #
                                          1815.  
                                          1816. #
                                          1817. ** CPUTFCT - PUT AN *FCT* ENTRY.
                                          1818. *
                                          1819. * *CPUTFCT* TRANSFERS THE SPECIFIED FILE AND CARTRIDGE TABLE ENTRY
                                          1820. * FROM THE CALLERS BUFFER TO THE I/O BUFFER. THE CATALOG MUST
                                          1821. * BE OPEN IN MODIFY MODE.
                                          1822. *
                                          1823. * CPUTFCT - IS CALLED BY RLS$FCT.
                                          1824. * PROC CPUTFCT((FAMNM),(SUBF),(SMID ),(FCTORD),(BADDR),
                                          1825. * (QRADDR),ERRSTAT)
                                          1826. *
                                          1827. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          1828. * 7 CHARACTER MAXIMUM.
                                          1829. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1830. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          1831. * (FCTORD) - ORDINAL OF ENTRY IN *FCT*.
                                          1832. * (BADDR) - ADDRESS OF BUFFER TO RECEIVE *FCT* ENTRY.
                                          1833. * (QRADDR) - ADDRESS OF *HLRQ* ENTRY, ELSE ZERO.
                                          1834. *
                                          1835. * EXIT THE REQUESTED *FCT* ENTRY IS TRANSFERRED TO THE *FCT*
                                          1836. * I/O BUFFER FROM THE ADDRESS SPECIFIED BY (BADDR).
                                          1837. * (ERRSTAT) - ERROR STATUS.
                                          1838. * (VALUES DEFINED IN *COMBCMS*)
                                          1839. * = NO ERROR.
                                          1840. * = CATALOG FILE INTERLOCKED.
                                          1841. * = CATALOG NOT OPEN.
                                          1842. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          1843. * = NO SUCH SUBCATALOG.
                                          1844. * = *CIO* ERROR.
                                          1845. * = *FCT* ORDINAL OUT OF RANGE.
                                          1846. *
                                          1847. * NOTES THE *FCT* ENTRY IS TRANSFERRED FROM THE CALLERS BUFFER
                                          1848. * BACK TO THE I/O BUFFER, BUT IS NOT WRITTEN TO THE
                                          1849. * CATALOG FILE UNTIL SOME SUBSEQUENT REQUEST CAUSES
                                          1850. * THE I/O BUFFER TO BE FLUSHED.
                                          1851. #
                                          1852.  
                                          1853. ITEM FAMNM C(7); # FAMILY NAME #
                                          1854. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1855. ITEM SMID U; # SM IDENTIFIER #
                                          1856. ITEM FCTORD I; # *FCT* ORDINAL #
                                          1857. ITEM BADDR U; # ADDRESS OF *FCT* ENTRY BUFFER #
                                          1858. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          1859. ITEM ERRSTAT I; # ERROR STATUS #
                                          1860.  
                                          1861. #
                                          1862. **** PROC CPUTFCT - XREF LIST BEGIN.
                                          1863. #
                                          1864.  
                                          1865. XREF
                                          1866. BEGIN
                                          1867. PROC CBUFMAN; # MANAGE CATALOG *FCT* BUFFER #
                                          1868. END
                                          1869.  
                                          1870. #
                                          1871. **** PROC CPUTFCT - XREF LIST END.
                                          1872. #
                                          1873.  
                                          1874. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1875. *CALL COMBFAS
                                          1876. *CALL COMBCMD
                                          1877. *CALL COMBCMS
                                          1878. *CALL COMBMCT
                                          1879.  
                                          1880. ITEM I I; # LOOP COUNTER #
                                          1881. ITEM MODF B = TRUE; # MODIFY MODE FLAG #
                                          1882. ITEM OFFSET I; # WORD OFFSET WITHIN BUFFER #
                                          1883.  
                                          1884. BASED
                                          1885. ARRAY ENTBUF [1:FCTENTL] P(1); # *FCT* ENTRY BUFFER #
                                          1886. BEGIN
                                          1887. ITEM ENT$WRD I(00,00,60); # ENTRY WORD #
                                          1888. END
                                          1889.  
                                          1890. CONTROL EJECT;
                                          1891.  
                                          1892. #
                                          1893. * ENSURE THAT REQUESTED *FCT* ENTRY IS WITHIN I/O BUFFER.
                                          1894. #
                                          1895.  
                                          1896. CBUFMAN(FAMNM,SUBF,SMID,FCTORD,MODF,QRADDR,ERRSTAT);
                                          1897. IF ERRSTAT NQ CMASTAT"NOERR"
                                          1898. THEN
                                          1899. BEGIN
                                          1900. RETURN; # RETURN ERROR STATUS #
                                          1901. END
                                          1902.  
                                          1903. #
                                          1904. * TRANSFER ENTRY TO *FCT* I/O BUFFER.
                                          1905. #
                                          1906.  
                                          1907. P<FCTBUF> = FCTBADR;
                                          1908. P<ENTBUF> = BADDR;
                                          1909. SLOWFOR I = 1 STEP 1 UNTIL FCTENTL
                                          1910. DO
                                          1911. BEGIN
                                          1912. FCTB$WRD[I] = ENT$WRD[I];
                                          1913. END
                                          1914.  
                                          1915. FB$BMF[0] = TRUE; # SET BUFFER MODIFIED FLAG #
                                          1916. RETURN;
                                          1917. END # CPUTFCT #
                                          1918.  
                                          1919. TERM
                                          1920. PROC CPUTPD((FAMNM),(SUBF),(SMID ),(QRADDR),ERRSTAT);
                                          1921. # TITLE CPUTPD - PUT PURGE DATE. #
                                          1922. BEGIN # CPUTPD #
                                          1923.  
                                          1924. #
                                          1925. ** CPUTPD - PUT PURGE DATE.
                                          1926. *
                                          1927. * *CPUTPD* PUTS THE DATE AND TIME OF THE LAST PURGE OF ORPHAN
                                          1928. * FILES (AN MSF FILE WITH NO REFERENCE TO IT IN THE PFC) INTO THE
                                          1929. * APPROPRIATE CATALOG PREAMBLE ENTRY. THE CURRENT PACKED DATE AND
                                          1930. * TIME IS USED. THE CATALOG MUST BE OPEN IN MODIFY MODE.
                                          1931. *
                                          1932. * CPUTPD - IS CALLED BY PURGCHN,UPDCAT.
                                          1933. *
                                          1934. * PROC CPUTPD((FAMNM),(SUBF),(SMID ),(QRADDR),ERRSTAT)
                                          1935. *
                                          1936. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          1937. * 7 CHARACTER MAXIMUM.
                                          1938. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          1939. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          1940. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          1941. *
                                          1942. * EXIT THE CURRENT PACKED DATE AND TIME IS WRITTEN IN THE
                                          1943. * SPECIFIED SUBCATALOG ENTRY IN THE PREAMBLE.
                                          1944. * (ERRSTAT) - ERROR STATUS.
                                          1945. * (VALUES DEFINED IN *COMBCMS*)
                                          1946. * = NO ERRORS.
                                          1947. * = CATALOG FILE INTERLOCKED.
                                          1948. * = CATALOG NOT OPEN.
                                          1949. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          1950. * = NO SUCH SUBCATALOG EXISTS.
                                          1951. * = *CIO* ERROR.
                                          1952. *
                                          1953. * NOTE THE PREAMBLE TABLE DOES NOT CONTAIN THE LAST PURGE
                                          1954. * DATE AND TIME (ONLY THE FIRST WORD OF EACH SUBCATALOG
                                          1955. * ENTRY IS IN THE TABLE), SO THE PREAMBLE MUST BE READ
                                          1956. * FROM AND WRITTEN TO THE CATALOG.
                                          1957. #
                                          1958.  
                                          1959. ITEM FAMNM C(7); # FAMILY NAME #
                                          1960. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          1961. ITEM SMID U; # SM IDENTIFIER #
                                          1962. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          1963. ITEM ERRSTAT I; # ERROR STATUS #
                                          1964.  
                                          1965. #
                                          1966. **** PROC CPUTPD - XREF LIST BEGIN.
                                          1967. #
                                          1968.  
                                          1969. XREF
                                          1970. BEGIN
                                          1971. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          1972. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          1973. PROC PDATE; # OBTAIN PACKED DATE AND TIME #
                                          1974. PROC RPHR; # READ PRU TO *CIO* BUFFER #
                                          1975. PROC WPHR; # WRITE PRU FROM *CIO* BUFFER #
                                          1976. PROC ZSETFET; # INITIALIZES A FET #
                                          1977. END
                                          1978.  
                                          1979. #
                                          1980. **** PROC CPUTPD - XREF LIST END.
                                          1981. #
                                          1982.  
                                          1983. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          1984. *CALL COMBFAS
                                          1985. *CALL COMBCMD
                                          1986. *CALL COMBCMS
                                          1987. *CALL COMBFET
                                          1988. *CALL COMBMCT
                                          1989. *CALL COMXMSC
                                          1990. *CALL COMSPFM
                                          1991.  
                                          1992. ITEM LASTPRG U; # LAST PURGE DATE #
                                          1993. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          1994. CONTROL EJECT;
                                          1995.  
                                          1996. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          1997. IF ERRSTAT NQ CMASTAT"NOERR"
                                          1998. THEN
                                          1999. BEGIN
                                          2000. RETURN; # RETURN ERROR STATUS #
                                          2001. END
                                          2002.  
                                          2003. IF OCT$ATTM[ORD] NQ "M"
                                          2004. THEN # IF NOT OPEN IN MODIFY MODE #
                                          2005. BEGIN
                                          2006. ERRSTAT = CMASTAT"MODERR";
                                          2007. RETURN; # RETURN ERROR STATUS #
                                          2008. END
                                          2009.  
                                          2010. P<PREAMBLE> = OCT$PRMA[ORD];
                                          2011. IF PRM$SCW1[SMID ] EQ 0
                                          2012. THEN # IF NO SUCH SUBCATALOG #
                                          2013. BEGIN
                                          2014. ERRSTAT = CMASTAT"NOSUBCAT";
                                          2015. RETURN;
                                          2016. END
                                          2017.  
                                          2018. #
                                          2019. * PUT DATE AND TIME OF LAST PURGE OF ORPHAN FILES INTO PREAMBLE.
                                          2020. #
                                          2021.  
                                          2022. PDATE(LASTPRG); # GET PACKED DATE AND TIME #
                                          2023. PRM$PDATE[SMID] = LASTPRG;
                                          2024. ZSETFET(TFETADR,OCT$LFN[ORD],TBUFADR,TBUFL,RFETL);
                                          2025. FET$EP[0] = TRUE;
                                          2026. FET$R[0] = TRUE;
                                          2027. FET$RR[0] = 1;
                                          2028. RPHR(FETSET[0],RCL);
                                          2029. IF FET$AT[0] NQ 0
                                          2030. THEN
                                          2031. BEGIN
                                          2032. GOTO ERR;
                                          2033. END
                                          2034.  
                                          2035. P<PREAMBLE> = TBUFADR;
                                          2036. PRM$PDATE[SMID ] = LASTPRG;
                                          2037. FET$RR[0] = 1;
                                          2038. FET$W[0] = TRUE;
                                          2039. WPHR(FETSET[0],RCL);
                                          2040. IF FET$AT[0] NQ 0
                                          2041. THEN
                                          2042. BEGIN
                                          2043. GOTO ERR;
                                          2044. END
                                          2045.  
                                          2046. RETURN;
                                          2047.  
                                          2048. ERR: # PROCESS *CIO* ERROR #
                                          2049. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,FETSET[0]);
                                          2050. RETURN;
                                          2051. END # CPUTPD #
                                          2052.  
                                          2053. TERM
                                          2054. PROC CRCLMLK(ERRSTAT);
                                          2055. # TITLE CRCLMLK - RECLAIM CATALOG INTERLOCKS. #
                                          2056. BEGIN # CRCLMLK #
                                          2057.  
                                          2058. #
                                          2059. ** CRCLMLK - RECLAIM CATALOG INTERLOCKS.
                                          2060. *
                                          2061. * *CRCLMLK* TRIES TO RECLAIM ALL MSF CATALOG INTERLOCKS. IF THE
                                          2062. * INTERLOCK IS RECLAIMED, (THE CATALOG IS SUCCESSFULLY ATTACHED)
                                          2063. * THE STATUS OF ALL WAITING-FOR-INTERLOCK REQUESTS ARE SET
                                          2064. * TO READY.
                                          2065. *
                                          2066. * CRCLMLK - IS CALLED BY RCLMLK.
                                          2067. *
                                          2068. * PROC CRCLMLK(ERRSTAT)
                                          2069. *
                                          2070. * EXIT THE CATALOG INTERLOCK IS RECLAIMED IF THE CATALOG
                                          2071. * WAS SUCCESSFULLY ATTACHED.
                                          2072. * (ERRSTAT) - ERROR STATUS.
                                          2073. * (VALUES DEFINED IN *COMBCMS*)
                                          2074. * = NO ERRORS.
                                          2075. * = *CIO* ERROR.
                                          2076. * = CATALOG ATTACH ERROR.
                                          2077. * IF THE DESIRED FAMILY IS NOT FOUND ON A *SETPFP*, AN
                                          2078. * ERROR MESSAGE IS ISSUED AND THE PROGRAM IS ABORTED.
                                          2079. *
                                          2080. * NOTES IF A CATALOG OPEN REQUEST WAS PREVIOUSLY ISSUED BUT
                                          2081. * THE CATALOG WAS INTERLOCKED AT THAT TIME, THE
                                          2082. * REMAINDER OF THE OPEN PROCESSING WILL BE DONE IF THE
                                          2083. * CATALOG INTERLOCK IS RECLAIMED. FOR ALL OTHER
                                          2084. * REQUESTS, THE INTERLOCK BIT IN THE *OCT* IS MERELY
                                          2085. * CLEARED.
                                          2086. *
                                          2087. * MESSAGES * PROGRAM ABNORMAL, CRCLMLK.*.
                                          2088. * * UNABLE TO REATTACH MSF CATALOG.
                                          2089. * SFMCATN FOR FAMILY FFFFFFF CLOSED.*
                                          2090. #
                                          2091.  
                                          2092. ITEM ERRSTAT I; # ERROR STATUS #
                                          2093.  
                                          2094. #
                                          2095. **** PROC CRCLMLK - XREF LIST BEGIN.
                                          2096. #
                                          2097.  
                                          2098. XREF
                                          2099. BEGIN
                                          2100. PROC ABORT; # ABORT #
                                          2101. PROC ADD$LNK; # ADD ENTRY TO END OF CHAIN #
                                          2102. PROC BZFILL; # BLANK OR ZERO FILL WORD #
                                          2103. PROC CRDPRM; # READ CATALOG PREAMBLE #
                                          2104. PROC MESSAGE; # ISSUE MESSAGE #
                                          2105. PROC PF; # *PFM* REQUEST INTERFACE #
                                          2106. PROC RMVBLNK; # REMOVE MULTIPLE BLANKS #
                                          2107. PROC RTIME; # GET REAL TIME CLOCK READING #
                                          2108. PROC SETPFP; # SET PERMANENT FILE PARAMETERS #
                                          2109. FUNC XCDD C(10); # INTEGER TO DISPLAY CODE
                                          2110.   CONVERSION #
                                          2111. PROC ZFILL; # ZERO FILL A BUFFER #
                                          2112. END
                                          2113.  
                                          2114. #
                                          2115. **** PROC CRCLMLK - XREF LIST END.
                                          2116. #
                                          2117.  
                                          2118. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          2119. *CALL COMBFAS
                                          2120. *CALL COMBBZF
                                          2121. *CALL COMBCHN
                                          2122. *CALL COMBCMD
                                          2123. *CALL COMBCMS
                                          2124. *CALL COMBMCT
                                          2125. *CALL COMBPFP
                                          2126. *CALL COMXCTF
                                          2127. *CALL COMXHLR
                                          2128. *CALL COMXIPR
                                          2129. *CALL COMXMSC
                                          2130. *CALL COMSPFM
                                          2131.  
                                          2132. ITEM CATPFN C(7); # MSS CATALOG PFN #
                                          2133. ITEM DIS$SUBF C(10); # SUBFAMILY (DISPLAY CODE) #
                                          2134. ITEM FAMILY C(7); # FAMILY NAME #
                                          2135. ITEM I I; # LOOP COUNTER #
                                          2136. ITEM INTLK B; # INTERLOCK STATUS #
                                          2137. ITEM STAT I; # ATTACH STATUS #
                                          2138. ITEM TEMP U; # TEMPORARY STORAGE #
                                          2139. CONTROL EJECT;
                                          2140.  
                                          2141. ERRSTAT = CMASTAT"NOERR"; # INITIALIZE VALUES #
                                          2142. INTLK = FALSE;
                                          2143. PFP$WRD0[0] = 0;
                                          2144. PFP$FG1[0] = TRUE;
                                          2145. PFP$FG4[0] = TRUE;
                                          2146.  
                                          2147. #
                                          2148. * SEARCH OPEN CATALOG TABLE FOR INTERLOCKED CATALOGS.
                                          2149. #
                                          2150.  
                                          2151. FASTFOR I = 1 STEP 1 UNTIL OCTLEN
                                          2152. DO
                                          2153. BEGIN # SEARCH *OCT* #
                                          2154. IF NOT OCT$INTLK[I]
                                          2155. THEN # IF CATALOG NOT INTERLOCKED #
                                          2156. BEGIN
                                          2157. TEST I; # CHECK NEXT ENTRY #
                                          2158. END
                                          2159.  
                                          2160. PFP$FAM[0] = OCT$FAM[I]; # SET FAMILY AND USER INDEX #
                                          2161. PFP$UI[0] = DEF$UI + OCT$SUBF[I];
                                          2162. SETPFP(PFP);
                                          2163. IF PFP$STAT[0] NQ 0
                                          2164. THEN # IF FAMILY NOT FOUND #
                                          2165. BEGIN
                                          2166. CMA$RTN[0] = "CRCLMLK.";
                                          2167. MESSAGE(CMAMSG,UDFL1); # ISSUE ERROR MESSAGE #
                                          2168. ABORT;
                                          2169. END
                                          2170.  
                                          2171. #
                                          2172. * ATTEMPT CATALOG FILE ATTACH.
                                          2173. #
                                          2174.  
                                          2175. CATPFN = SFMCAT; # BUILD CATALOG PFN #
                                          2176. DIS$SUBF = XCDD(OCT$SUBF[I]);
                                          2177. C<6,1>CATPFN = C<9,1>DIS$SUBF;
                                          2178. PF("ATTACH",OCT$LFN[I],CATPFN,"M",OCT$ATTM[I],
                                          2179. "RC",STAT,"NA",0,"UP",0,"SR","IE",0);
                                          2180. IF STAT EQ FBS OR STAT EQ PFA OR STAT EQ INA ##
                                          2181. OR STAT EQ FTF OR STAT EQ PEA
                                          2182. THEN # FILE BUSY OR TEMPORARY ERROR #
                                          2183. BEGIN
                                          2184. INTLK = TRUE;
                                          2185. END
                                          2186.  
                                          2187. ELSE
                                          2188. BEGIN # FILE NOT INTERLOCKED #
                                          2189. OCT$INTLK[I] = FALSE;
                                          2190. TEMP = OCT$LINK[I];
                                          2191. OCT$LINK[I] = 0;
                                          2192. REPEAT WHILE TEMP NQ 0
                                          2193. DO
                                          2194. BEGIN # ADD WAITING REQUESTS TO READY CHAIN #
                                          2195. P<HLRQ> = TEMP;
                                          2196. TEMP = HLR$LNK1[0];
                                          2197. ADD$LNK(P<HLRQ>,LCHN"HL$READY",0);
                                          2198. END # ADD WAITING REQUESTS TO READY CHAIN #
                                          2199.  
                                          2200. IF STAT NQ 0
                                          2201. THEN # IF ATTACH ERROR #
                                          2202. BEGIN
                                          2203. CMSGLINE[0] = CMSG3;
                                          2204. MESSAGE(CMSGAREA,UDFL1);
                                          2205. CMSGLINE[0] = CMSGCLOSE;
                                          2206. CMSGCSUBF[0] = C<9,1>DIS$SUBF;
                                          2207. FAMILY = OCT$FAM[I];
                                          2208. BZFILL(FAMILY,TYPFILL"BFILL",7);
                                          2209. CMSGCFAM[0] = FAMILY;
                                          2210. RMVBLNK(CMSGAREA,48);
                                          2211. MESSAGE(CMSGAREA,UDFL1);
                                          2212. ZFILL(OCT[I],OCTENTL); # CLEAR *OCT* ENTRY #
                                          2213. TEST I;
                                          2214. END
                                          2215.  
                                          2216. #
                                          2217. * CHECK FOR CATALOG OPENED.
                                          2218. #
                                          2219.  
                                          2220. IF OCT$PRMA[I] EQ 0
                                          2221. THEN # IF CATALOG OPEN NOT COMPLETE #
                                          2222. BEGIN
                                          2223. CRDPRM(I,ERRSTAT); # FINISH CATALOG OPEN #
                                          2224. IF ERRSTAT NQ CMASTAT"NOERR"
                                          2225. THEN
                                          2226. BEGIN
                                          2227. RETURN; # RETURN ERROR STATUS #
                                          2228. END
                                          2229.  
                                          2230. END
                                          2231.  
                                          2232. END # FILE NOT INTERLOCKED #
                                          2233.  
                                          2234. END # SEARCH *OCT* #
                                          2235.  
                                          2236. IF NOT INTLK
                                          2237. THEN # IF NO CATALOGS INTERLOCKED #
                                          2238. BEGIN
                                          2239. GLBINTLK = FALSE; # CLEAR GLOBAL INTERLOCK FLAG #
                                          2240. ITLK$EXPIR = 0;
                                          2241. END
                                          2242.  
                                          2243. ELSE
                                          2244. BEGIN
                                          2245. RTIME(RTIMESTAT[0]);
                                          2246. ITLK$EXPIR = RTIMSECS[0] + INLK$INTV;
                                          2247. END
                                          2248.  
                                          2249. RETURN;
                                          2250. END # CRCLMLK #
                                          2251.  
                                          2252. TERM
                                          2253. PROC CRDAST((FAMNM),(SUBF),(SMID ),(BADDR),(QRADDR),ERRSTAT);
                                          2254. # TITLE CRDAST - READ AVAILABLE STREAM TABLE. #
                                          2255. BEGIN # CRDAST #
                                          2256.  
                                          2257. #
                                          2258. ** CRDAST - READ AVAILABLE STREAM TABLE.
                                          2259. *
                                          2260. * *CRDAST* READS THE ENTIRE AVAILABLE STREAM TABLE DIRECTLY INTO
                                          2261. * THE CALLERS BUFFER.
                                          2262. *
                                          2263. * CRDAST - IS CALLED BY ADDCAR,ADDCUBE,ADDCSU,ALLOCAT,DESTAGR,
                                          2264. * OPENCAT,PURGCHN,PURGFCT,RLSUNS,RMVCAR,RMVCUBE,SERAST,
                                          2265. * STAGER,UPDCAT.
                                          2266. *
                                          2267. * PROC CRDAST((FAMNM),(SUBF),(SMID ),(BADDR),(QRADDR),ERRSTAT)
                                          2268. *
                                          2269. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          2270. * 7 CHARACTER MAXIMUM.
                                          2271. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          2272. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          2273. * (BADDR) - ADDRESS OF BUFFER TO CONTAIN *AST*.
                                          2274. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          2275. *
                                          2276. * EXIT THE *AST* HAS BEEN READ INTO THE BUFFER AT THE ADDRESS
                                          2277. * SPECIFIED BY (BADDR).
                                          2278. * (ERRSTAT) - ERROR STATUS.
                                          2279. * (VALUES DEFINED IN *COMBCMS*)
                                          2280. * = NO ERRORS.
                                          2281. * = CATALOG FILE INTERLOCKED.
                                          2282. * = CATALOG NOT OPEN.
                                          2283. * = NO SUCH SUBCATALOG.
                                          2284. * = *CIO* ERROR.
                                          2285. *
                                          2286. * NOTES THE *AST* IS READ DIRECTLY INTO THE CALLERS BUFFER.
                                          2287. * IT IS THE CALLERS RESPONSIBILITY TO ENSURE THAT THE
                                          2288. * BUFFER IS LARGE ENOUGH TO CONTAIN THE ENTIRE *AST*.
                                          2289. * THE BUFFER SIZE SHOULD BE THE LENGTH OF THE *AST*
                                          2290. * ROUNDED UP TO A PRU SIZE MULTIPLE OR LARGER.
                                          2291. #
                                          2292.  
                                          2293. ITEM FAMNM C(7); # FAMILY NAME #
                                          2294. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          2295. ITEM SMID U; # SM IDENTIFIER #
                                          2296. ITEM BADDR U; # *AST* BUFFER ADDRESS #
                                          2297. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          2298. ITEM ERRSTAT I; # ERROR STATUS #
                                          2299.  
                                          2300. #
                                          2301. **** PROC CRDAST - XREF LIST BEGIN.
                                          2302. #
                                          2303.  
                                          2304. XREF
                                          2305. BEGIN
                                          2306. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          2307. PROC CRDPRM;
                                          2308. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          2309. PROC READ; # READ FILE TO *CIO* BUFFER #
                                          2310. PROC ZSETFET; # INITIALIZES A FET #
                                          2311. END
                                          2312.  
                                          2313. #
                                          2314. **** PROC CRDAST - XREF LIST END.
                                          2315. #
                                          2316.  
                                          2317. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          2318. *CALL COMBFAS
                                          2319. *CALL COMBCMD
                                          2320. *CALL COMBCMS
                                          2321. *CALL COMBFET
                                          2322. *CALL COMBMCT
                                          2323. *CALL COMXMSC
                                          2324.  
                                          2325. ITEM LENGTH I; # *AST* LENGTH #
                                          2326. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          2327. CONTROL EJECT;
                                          2328.  
                                          2329. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          2330. IF ERRSTAT NQ CMASTAT"NOERR"
                                          2331. THEN
                                          2332. BEGIN
                                          2333. RETURN; # RETURN ERROR STATUS #
                                          2334. END
                                          2335.  
                                          2336. P<PREAMBLE> = OCT$PRMA[ORD];
                                          2337. IF PRM$SCW1[SMID ] EQ 0
                                          2338. THEN # IF NO SUCH SUBCATALOG #
                                          2339. BEGIN
                                          2340. ERRSTAT = CMASTAT"NOSUBCAT";
                                          2341. RETURN;
                                          2342. END
                                          2343.  
                                          2344. LENGTH = ABUFLEN;
                                          2345.  
                                          2346. #
                                          2347. * READ ENTIRE *AST* INTO CALLERS BUFFER.
                                          2348. #
                                          2349.  
                                          2350. ZSETFET(TFETADR,OCT$LFN[ORD],BADDR,LENGTH,RFETL);
                                          2351. FET$EP[0] = TRUE;
                                          2352. FET$R[0] = TRUE;
                                          2353. FET$RR[0] = PRM$ASTLOC[SMID ];
                                          2354. READ(FETSET[0],RCL);
                                          2355. IF FET$AT[0] NQ 0
                                          2356. THEN
                                          2357. BEGIN
                                          2358. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,FETSET[0]);
                                          2359. RETURN;
                                          2360. END
                                          2361.  
                                          2362. CRDPRM(ORD,ERRSTAT);
                                          2363. RETURN;
                                          2364. END # CRDAST #
                                          2365.  
                                          2366. TERM
                                          2367. PROC CRDPRM((TORD),ERRSTAT);
                                          2368. # TITLE CRDPRM - READ CATALOG PREAMBLE. #
                                          2369. BEGIN # CRDPRM #
                                          2370.  
                                          2371. #
                                          2372. ** CRDPRM - READ CATALOG PREAMBLE.
                                          2373. *
                                          2374. * *CRDPRM* READS THE HEADER OF EACH
                                          2375. * SUBCATALOG ENTRY IN THE PREAMBLE INTO A BUFFER (THE
                                          2376. * PREAMBLE TABLE).
                                          2377. *
                                          2378. * CRDPRM - IS CALLED BY COPEN.
                                          2379. *
                                          2380. * PROC CRDPRM((TORD),ERRSTAT)
                                          2381. *
                                          2382. * ENTRY (TORD) - ORDINAL OF CATALOGS ENTRY IN THE OPEN CATALOG
                                          2383. * TABLE.
                                          2384. *
                                          2385. * EXIT A CATALOG PREAMBLE IS READ INTO A BUFFER AND
                                          2386. * UPDATED.
                                          2387. * (ERRSTAT) - ERROR STATUS.
                                          2388. * (VALUES DEFINED IN *COMBCMS*)
                                          2389. * = NO ERRORS.
                                          2390. * = *CIO* ERROR.
                                          2391. * = CATALOG ATTACH ERROR.
                                          2392. *
                                          2393. * NOTES WHEN A CATALOG IS OPENED, A PREAMBLE IS READ
                                          2394. * INTO THE PREAMBLE TABLE, TO BE USED TO REFERENCE
                                          2395. * DATA IN THE PREAMBLE, THUS REDUCING DISK REFERENCES.
                                          2396. #
                                          2397.  
                                          2398. ITEM TORD I; # OPEN CATALOG TABLE ORDINAL #
                                          2399. ITEM ERRSTAT I; # ERROR STATUS #
                                          2400.  
                                          2401. #
                                          2402. **** PROC CRDPRM - XREF LIST BEGIN.
                                          2403. #
                                          2404.  
                                          2405. XREF
                                          2406. BEGIN
                                          2407. PROC CCLOSE; # CLOSE CATALOGS #
                                          2408. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          2409. PROC REWIND; # REWIND FILE #
                                          2410. PROC RPHR; # READ PRU TO *CIO* BUFFER #
                                          2411. PROC ZSETFET; # INITIALIZES A FET #
                                          2412. END
                                          2413.  
                                          2414. #
                                          2415. **** PROC CRDPRM - XREF LIST END.
                                          2416. #
                                          2417.  
                                          2418. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          2419. *CALL COMBFAS
                                          2420. *CALL COMBCMD
                                          2421. *CALL COMBCMS
                                          2422. *CALL COMBFET
                                          2423. *CALL COMBMCT
                                          2424. *CALL COMXMSC
                                          2425.  
                                          2426. ITEM I I; # LOOP COUNTER #
                                          2427. ITEM J I; # LOOP COUNTER #
                                          2428. CONTROL EJECT;
                                          2429.  
                                          2430. #
                                          2431. * READ CATALOG PREAMBLE INTO BUFFER.
                                          2432. #
                                          2433.  
                                          2434. OCT$PRMA[TORD] = (PRMBADR+((TORD-1)*PRMTLEN*3));
                                          2435. ZSETFET(TFETADR,OCT$LFN[TORD],TBUFADR,2*PRULEN,RFETL);
                                          2436. FET$EP[0] = TRUE;
                                          2437. REWIND(FETSET[0],RCL);
                                          2438. RPHR(FETSET[0],RCL);
                                          2439. IF FET$AT[0] NQ 0
                                          2440. THEN
                                          2441. BEGIN
                                          2442. GOTO ERR;
                                          2443. END
                                          2444.  
                                          2445. P<PREAMBLE> = OCT$PRMA[TORD];
                                          2446.  
                                          2447. #
                                          2448. * TRANSFER HEADER OF EACH ENTRY TO THE TABLE.
                                          2449. #
                                          2450.  
                                          2451. FASTFOR I = 0 STEP 1 UNTIL MAXSM
                                          2452. DO
                                          2453. BEGIN
                                          2454. PRM$SCW1[I] = TBUF$W[I + 1];
                                          2455. PRM$SCW2[I] = TBUF$W1[I + 1];
                                          2456. PRM$SCW3[I] = TBUF$W2[I + 1];
                                          2457. END
                                          2458.  
                                          2459. IF OCT$FAM[TORD] NQ PRM$FAM[0] ##
                                          2460. OR OCT$SUBF[TORD] NQ PRM$SUBF[0]
                                          2461. THEN # IF WRONG CATALOG ATTACHED #
                                          2462. BEGIN
                                          2463. CCLOSE(OCT$FAM[TORD],OCT$SUBF[TORD],0,ERRSTAT);
                                          2464. ERRSTAT = CMASTAT"ATTERR";
                                          2465. RETURN; # RETURN ERROR STATUS #
                                          2466. END
                                          2467.  
                                          2468.  
                                          2469. # CHANGE DELETED 36 LINES THAT UPDATED STREAM COUNTS #
                                          2470. RETURN;
                                          2471. ERR: # PROCESS *CIO* ERROR #
                                          2472. CPIOERR(OCT$FAM[TORD],OCT$SUBF[TORD],0,ERRSTAT,FETSET[0]);
                                          2473. RETURN;
                                          2474. END # CRDPRM #
                                          2475.  
                                          2476. TERM
                                          2477. PROC CRELSLK((FAMNM),(MASK),(QRADDR),ERRSTAT);
                                          2478. # TITLE CRELSLK - RELEASE CATALOG INTERLOCKS. #
                                          2479. BEGIN # CRELSLK #
                                          2480.  
                                          2481. #
                                          2482. ** CRELSLK - RELEASE CATALOG INTERLOCKS.
                                          2483. *
                                          2484. * *CRELSLK* RETURNS THE SPECIFIED CATALOGS IF THEY ARE INTERLOCKED
                                          2485. * AND SETS THE INTERLOCK BIT IN THE OPEN CATALOG TABLE TO INDICATE
                                          2486. * THAT THE INTERLOCK HAS BEEN GIVEN UP BY *MSSEXEC*.
                                          2487. *
                                          2488. * CRELSLK - IS CALLED BY HLRQMTR,TDAM$RP.
                                          2489. *
                                          2490. * PROC CRELSLK((FAMNM),(MASK),(QRADDR),ERRSTAT)
                                          2491. *
                                          2492. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          2493. * 7 CHARACTER MAXIMUM.
                                          2494. * (MASK) - THE 8-BIT DEVICE MASK FOR A DEVICE.
                                          2495. *
                                          2496. * EXIT (ERRSTAT) - ERROR STATUS.
                                          2497. * (VALUES DEFINED IN *COMBCMS*)
                                          2498. * = *CIO* ERROR.
                                          2499. * THE SPECIFIED CATALOGS ARE RETURNED. THE INTERLOCK
                                          2500. * BIT IS SET IN THE CORRESPONDING *OCT* ENTRIES, AND THE
                                          2501. * GLOBAL INTERLOCK FLAG IS SET.
                                          2502. #
                                          2503.  
                                          2504. ITEM FAMNM C(7); # FAMILY NAME #
                                          2505. ITEM MASK U; # DEVICE MASK #
                                          2506. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          2507. ITEM ERRSTAT I; # ERROR STATUS #
                                          2508.  
                                          2509. #
                                          2510. **** PROC CRELSLK - XREF LIST BEGIN.
                                          2511. #
                                          2512.  
                                          2513. XREF
                                          2514. BEGIN
                                          2515. PROC BFLUSH; # BUFFER FLUSH #
                                          2516. PROC RETERN; # RETURN FILE TO SYSTEM #
                                          2517. PROC RTIME; # GET REAL TIME CLOCK READING #
                                          2518. PROC ZSETFET; # INITIALIZES A FET #
                                          2519. END
                                          2520.  
                                          2521. #
                                          2522. **** PROC CRELSLK - XREF LIST END.
                                          2523. #
                                          2524.  
                                          2525. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          2526. *CALL COMBFAS
                                          2527. *CALL COMBCMD
                                          2528. *CALL COMBCMS
                                          2529. *CALL COMXCTF
                                          2530. *CALL COMXIPR
                                          2531.  
                                          2532. ITEM I I; # LOOP COUNTER #
                                          2533. CONTROL EJECT;
                                          2534.  
                                          2535. ERRSTAT = CMASTAT"NOERR";
                                          2536. BFLUSH(QRADDR,ERRSTAT); # FLUSH CATALOG *FCT* I/O BUFFER #
                                          2537. IF ERRSTAT NQ CMASTAT"NOERR"
                                          2538. THEN
                                          2539. BEGIN
                                          2540. RETURN;
                                          2541. END
                                          2542.  
                                          2543. FASTFOR I = 1 STEP 1 UNTIL OCTLEN
                                          2544. DO
                                          2545. BEGIN
                                          2546. IF OCT$FAM[I] EQ FAMNM AND NOT OCT$INTLK[I] ##
                                          2547. AND B<(59-OCT$SUBF[I]),1>MASK EQ 1
                                          2548. THEN # IF INTERLOCK TO BE GIVEN UP #
                                          2549. BEGIN
                                          2550. GLBINTLK = TRUE; # SET GLOBAL INTERLOCK FLAG #
                                          2551. OCT$INTLK[I] = TRUE;
                                          2552. RTIME(RTIMESTAT[0]);
                                          2553. ITLK$EXPIR = RTIMSECS[0] + INLK$INTV;
                                          2554. ZSETFET(TFETADR,OCT$LFN[I],TBUFADR,TBUFL,RFETL);
                                          2555. RETERN(TFET[0],RCL);
                                          2556. END
                                          2557.  
                                          2558. END
                                          2559.  
                                          2560. RETURN;
                                          2561. END # CRELSLK #
                                          2562.  
                                          2563. TERM
                                          2564. PROC CRELSMM((FAMNM),(MASK),(QRADDR),ERRSTAT);
                                          2565. # TITLE CRELSMM - RELEASE CATALOG IN MODIFY MODE. #
                                          2566. BEGIN # CRELSMM #
                                          2567.  
                                          2568. #
                                          2569. ** CRELSMM - RELEASE CATALOG IN MODIFY MODE.
                                          2570. *
                                          2571. * *CRELSMM* ATTACHES THE SPECIFIED CATALOGS IN UPDATE MODE
                                          2572. * (RELINQUISHING MODIFY MODE) IF THEY ARE INTERLOCKED BY
                                          2573. * *SSEXEC* AND SETS THE UPDATE MODE INTERLOCK FLAG IN THE
                                          2574. * OPEN CATALOG TABLE. *PFDUMP* WILL ATTACH THE CATALOGS IN
                                          2575. * READ/ALLOW UPDATE MODE, PREVENTING *SSEXEC* FROM
                                          2576. * RECLAIMING THE CATALOGS IN MODIFY MODE UNTIL IT RETURNS
                                          2577. * THEM. DESTAGING FILES AND ADDING, EXTENDING OR REMOVING
                                          2578. * SUBCATALOGS ARE NOT ALLOWED WHILE THIS INTERLOCK IS SET.
                                          2579. *
                                          2580. * PROC CRELSMM((FAMNM),(MASK),(QRADDR),ERRSTAT)
                                          2581. *
                                          2582. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          2583. * 7 CHARACTER MAXIMUM.
                                          2584. * (MASK) - THE 8-BIT DEVICE MASK FOR A DEVICE.
                                          2585. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          2586. *
                                          2587. * EXIT (ERRSTAT) - ERROR STATUS.
                                          2588. * (VALUES DEFINED IN *COMACMS*)
                                          2589. * = NO ERRORS.
                                          2590. * = I/O ERROR.
                                          2591. * = CATALOG ATTACH ERROR.
                                          2592. * IF THE DESIRED FAMILY IS NOT FOUND ON A *SETPFP*, AN
                                          2593. * ERROR MESSAGE IS ISSUED AND THE PROGRAM IS ABORTED.
                                          2594. *
                                          2595. * THE SPECIFIED CATALOGS ARE ATTACHED IN UPDATE MODE.
                                          2596. * THE INTERLOCK FLAG IS SET IN THE CORRESPONDING *OCT*
                                          2597. * ENTRIES AND THE GLOBAL INTERLOCK FLAG IS SET, IF THE
                                          2598. * INTERLOCK WAS RELEASED.
                                          2599. *
                                          2600. * MESSAGES * PROGRAM ABNORMAL, CRELSMM.*
                                          2601. * * UNABLE TO REATTACH SMF CATALOG.
                                          2602. * SMFCATN FOR FAMILY FFFFFFF CLOSED.*
                                          2603. #
                                          2604.  
                                          2605. ITEM FAMNM C(7); # FAMILY NAME #
                                          2606. ITEM MASK U; # DEVICE MASK #
                                          2607. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          2608. ITEM ERRSTAT I; # ERROR STATUS #
                                          2609.  
                                          2610. #
                                          2611. **** PROC CRELSMM - XREF LIST BEGIN.
                                          2612. #
                                          2613.  
                                          2614. XREF
                                          2615. BEGIN
                                          2616. PROC ABORT; # ABORT #
                                          2617. PROC BFLUSH; # BUFFER FLUSH #
                                          2618. PROC BZFILL; # BLANK OR ZERO FILL WORD #
                                          2619. PROC MESSAGE; # ISSUE MESSAGE #
                                          2620. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
                                          2621. PROC RMVBLNK; # REMOVE MULTIPLE BLANKS #
                                          2622. PROC RTIME; # GET REAL TIME CLOCK READING #
                                          2623. PROC SETPFP; # SET PERMANENT FILE PARAMETERS #
                                          2624. FUNC XCDD C(10); # INTEGER TO DISPLAY CODE
                                          2625.   CONVERSION #
                                          2626. PROC ZFILL; # ZERO FILL A BUFFER #
                                          2627. END
                                          2628.  
                                          2629. #
                                          2630. **** PROC CRELSMM - XREF LIST END.
                                          2631. #
                                          2632.  
                                          2633. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          2634. *CALL COMBFAS
                                          2635. *CALL COMBBZF
                                          2636. *CALL COMBCMD
                                          2637. *CALL COMBCMS
                                          2638. *CALL COMBPFP
                                          2639. *CALL COMBPFS
                                          2640. *CALL COMXCTF
                                          2641. *CALL COMXIPR
                                          2642.  
                                          2643. ITEM CATPFN C(7); # MSF CATALOG PFN #
                                          2644. ITEM DIS$SUBF C(10); # SUBFAMILY (DISPLAY CODE) #
                                          2645. ITEM FAMILY C(7); # FAMILY NAME #
                                          2646. ITEM I I; # LOOP COUNTER #
                                          2647. CONTROL EJECT;
                                          2648.  
                                          2649. ERRSTAT = CMASTAT"NOERR";
                                          2650. BFLUSH(QRADDR,ERRSTAT); # FLUSH CATALOG *FCT* I/O BUFFER #
                                          2651. IF ERRSTAT NQ CMASTAT"NOERR"
                                          2652. THEN
                                          2653. BEGIN
                                          2654. RETURN;
                                          2655. END
                                          2656.  
                                          2657. FASTFOR I = 1 STEP 1 UNTIL OCTLEN
                                          2658. DO
                                          2659. BEGIN # SEARCH *OCT* #
                                          2660. IF OCT$FAM[I] EQ FAMNM ##
                                          2661. AND NOT OCT$INTLK[I] ##
                                          2662. # AND NOT OCT$UMI[I] #
                                          2663. AND B<(59-OCT$SUBF[I]),1>MASK EQ 1
                                          2664. THEN
                                          2665. BEGIN # INTERLOCK TO BE GIVEN UP #
                                          2666. PFP$FAM[0] = OCT$FAM[I]; # SET FAMILY AND USER INDEX #
                                          2667. PFP$UI[0] = DEF$UI + OCT$SUBF[I];
                                          2668. PFP$FG1[0] = TRUE;
                                          2669. PFP$FG4[0] = TRUE;
                                          2670. SETPFP(PFP);
                                          2671. IF PFP$STAT NQ 0
                                          2672. THEN # IF FAMILY NOT FOUND #
                                          2673. BEGIN
                                          2674. CMA$RTN[0] = "CRELSMM.";
                                          2675. MESSAGE(CMAMSG,UDFL1); # ISSUE ERROR MESSAGE #
                                          2676. ABORT;
                                          2677. END
                                          2678.  
                                          2679. CATPFN = SFMCAT; # REATTACH IN UPDATE MODE #
                                          2680. DIS$SUBF = XCDD(OCT$SUBF[I]);
                                          2681. C<6,1>CATPFN = C<9,1>DIS$SUBF;
                                          2682. PFD("ATTACH",OCT$LFN[I],CATPFN,"M","U",
                                          2683. "RC",PFSTAT,"NA",0,"UP",0,0);
                                          2684. IF PFSTAT NQ 0
                                          2685. THEN # ATTACH ERROR #
                                          2686. BEGIN
                                          2687. CMSGLINE[0] = CMSG3;
                                          2688. MESSAGE(CMSGAREA,UDFL1);
                                          2689. CMSGLINE[0] = CMSGCLOSE;
                                          2690. CMSGCSUBF[0] = C<9,1>DIS$SUBF;
                                          2691. FAMILY = OCT$FAM[I];
                                          2692. BZFILL(FAMILY,TYPFILL"BFILL",7);
                                          2693. CMSGCFAM[0] = FAMILY;
                                          2694. RMVBLNK(CMSGAREA,48);
                                          2695. MESSAGE(CMSGAREA,UDFL1);
                                          2696. ZFILL(OCT[I],OCTENTL); # CLEAR *OCT* ENTRY #
                                          2697. TEST I;
                                          2698. END
                                          2699.  
                                          2700. GLBINTLK = TRUE; # SET GLOBAL INTERLOCK FLAG #
                                          2701. # OCT$UMI[I] = TRUE #
                                          2702. RTIME(RTIMESTAT[0]);
                                          2703. ITLK$EXPIR = RTIMSECS[0] + INLK$INTV;
                                          2704. END # INTERLOCK TO BE GIVEN UP #
                                          2705.  
                                          2706. END # SEARCH *OCT* #
                                          2707.  
                                          2708. RETURN;
                                          2709. END # CRELSMM #
                                          2710.  
                                          2711. TERM
                                          2712. PROC CRMVSC((FAMNM),(SUBF),(SMID ),(QRADDR),ERRSTAT);
                                          2713. # TITLE CRMVSC - REMOVE SUBCATALOG. #
                                          2714. BEGIN # CRMVSC #
                                          2715.  
                                          2716. #
                                          2717. ** CRMVSC - REMOVE SUBCATALOG.
                                          2718. *
                                          2719. * *CRMVSC* REMOVES THE SPECIFIED SUBCATALOG FROM THE CATALOG FILE.
                                          2720. * THE CATALOG MUST BE OPEN IN MODIFY MODE.
                                          2721. *
                                          2722. * CRMVSC - IS CALLED BY RMVCSU.
                                          2723. *
                                          2724. * PROC CRMVSC((FAMNM),(SUBF),(SMID ),(QRADDR),ERRSTAT)
                                          2725. *
                                          2726. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          2727. * 7 CHARACTER MAXIMUM.
                                          2728. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          2729. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          2730. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          2731. *
                                          2732. * EXIT THE SUBCATALOG HAS BEEN REMOVED AND THE CATALOG
                                          2733. * PREAMBLE HAS BEEN UPDATED TO REFLECT THE CHANGE.
                                          2734. * (ERRSTAT) - ERROR STATUS.
                                          2735. * (VALUES DEFINED IN *COMBCMS*)
                                          2736. * = NO ERRORS.
                                          2737. * = CATALOG FILE INTERLOCKED.
                                          2738. * = CATALOG NOT OPEN.
                                          2739. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          2740. * = NO SUCH SUBCATALOG.
                                          2741. * = *CIO* ERROR.
                                          2742. * = FILE DEFINE ERROR.
                                          2743. * = FILE ATTACH ERROR.
                                          2744. * = FILE PURGE ERROR.
                                          2745. * = FILE RENAME ERROR.
                                          2746. * IF THE DESIRED FAMILY IS NOT FOUND ON A *SETPFP*, AN
                                          2747. * ERROR MESSAGE IS ISSUED AND THE PROGRAM IS ABORTED.
                                          2748. *
                                          2749. * NOTES THE CATALOG IS RE-ATTACHED IN WRITE MODE BEFORE
                                          2750. * REMOVING THE SUBCATALOG IN ORDER TO ALTER THE FILE
                                          2751. * LENGTH, AND WHEN FINISHED, THE FILE IS ATTACHED IN
                                          2752. * MODIFY MODE AGAIN.
                                          2753. *
                                          2754. * MESSAGES * PROGRAM ABNORMAL, CRMVSC.*.
                                          2755. #
                                          2756.  
                                          2757. ITEM FAMNM C(7); # FAMILY NAME #
                                          2758. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          2759. ITEM SMID U; # SM IDENTIFIER #
                                          2760. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          2761. ITEM ERRSTAT I; # ERROR STATUS #
                                          2762.  
                                          2763. #
                                          2764. **** PROC CRMVSC - XREF LIST BEGIN.
                                          2765. #
                                          2766.  
                                          2767. XREF
                                          2768. BEGIN
                                          2769. PROC ABORT; # ABORT #
                                          2770. PROC BFLUSH; # FLUSH *FCT* I/O BUFFER #
                                          2771. PROC CDEFTF; # DEFINE TEMPORARY CATALOG #
                                          2772. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          2773. PROC MESSAGE; # ISSUE MESSAGE #
                                          2774. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          2775. PROC READ; # READ FILE TO *CIO* BUFFER #
                                          2776. PROC READW; # READ DATA TO WORKING BUFFER #
                                          2777. PROC REPLCAT; # REPLACE MSF CATALOG #
                                          2778. PROC REWIND; # REWIND A FILE #
                                          2779. PROC SETPFP; # SET PERMANENT FILE PARAMETERS #
                                          2780. PROC WRITEF; # WRITE END OF FILE #
                                          2781. PROC WRITEW; # WRITE DATA FROM WORKING BUFFER #
                                          2782. PROC ZSETFET; # INITIALIZES A FET #
                                          2783. END
                                          2784.  
                                          2785. #
                                          2786. **** PROC CRMVSC - XREF LIST END.
                                          2787. #
                                          2788.  
                                          2789. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          2790. *CALL COMBFAS
                                          2791. *CALL COMBCMD
                                          2792. *CALL COMBCMS
                                          2793. *CALL COMBFET
                                          2794. *CALL COMBMCT
                                          2795. *CALL COMBPFP
                                          2796. *CALL COMXMSC
                                          2797.  
                                          2798. ITEM I I; # LOOP COUNTER #
                                          2799. ITEM J I; # LOOP COUNTER #
                                          2800. ITEM NAST I; # NUMBER OF PRU-S IN *AST* #
                                          2801. ITEM NFCT I; # NUMBER OF PRU-S IN *FCT* #
                                          2802. ITEM NPRU I; # NUMBER OF PRU-S TO REMOVE #
                                          2803. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          2804. ITEM RMV I; # SUBCATALOG LOCATION #
                                          2805. ITEM STAT I; # STATUS #
                                          2806. CONTROL EJECT;
                                          2807.  
                                          2808. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          2809. IF ERRSTAT NQ CMASTAT"NOERR"
                                          2810. THEN
                                          2811. BEGIN
                                          2812. RETURN; # RETURN ERROR STATUS #
                                          2813. END
                                          2814.  
                                          2815. IF OCT$ATTM[ORD] NQ "M"
                                          2816. THEN # IF NOT OPEN IN MODIFY MODE #
                                          2817. BEGIN
                                          2818. ERRSTAT = CMASTAT"MODERR";
                                          2819. RETURN; # RETURN ERROR STATUS #
                                          2820. END
                                          2821.  
                                          2822. P<PREAMBLE> = OCT$PRMA[ORD];
                                          2823. IF PRM$SCW1[SMID ] EQ 0
                                          2824. THEN # IF NO SUCH SUBCATALOG #
                                          2825. BEGIN
                                          2826. ERRSTAT = CMASTAT"NOSUBCAT";
                                          2827. RETURN; # RETURN ERROR STATUS #
                                          2828. END
                                          2829.  
                                          2830. BFLUSH(QRADDR,ERRSTAT); # FLUSH CATALOG *FCT* I/O BUFFER #
                                          2831. FB$CWRD[0] = 0;
                                          2832. IF ERRSTAT NQ CMASTAT"NOERR"
                                          2833. THEN
                                          2834. BEGIN
                                          2835. RETURN;
                                          2836. END
                                          2837.  
                                          2838. #
                                          2839. * SET FAMILY AND USER INDEX.
                                          2840. #
                                          2841.  
                                          2842. PFP$WRD0[0] = 0;
                                          2843. PFP$FAM[0] = OCT$FAM[ORD];
                                          2844. PFP$UI[0] = DEF$UI + OCT$SUBF[ORD];
                                          2845. PFP$FG1[0] = TRUE;
                                          2846. PFP$FG4[0] = TRUE;
                                          2847. SETPFP(PFP);
                                          2848. IF PFP$STAT[0] NQ 0
                                          2849. THEN # IF FAMILY NOT FOUND #
                                          2850. BEGIN
                                          2851. CMA$RTN[0] = "CRMVSC.";
                                          2852. MESSAGE(CMAMSG,UDFL1); # ISSUE ERROR MESSAGE #
                                          2853. ABORT;
                                          2854. END
                                          2855.  
                                          2856. ZSETFET(TFETADR,OCT$LFN[ORD],FCTBADR,SEQBL,RFETL);
                                          2857. FET$EP[0] = TRUE;
                                          2858. ZSETFET(TFETADR+RFETL,TSFMCAT,TBUFADR,TBUFL,RFETL);
                                          2859. FET$EP[0] = TRUE;
                                          2860. REWIND(TFET[0],NRCL);
                                          2861. CDEFTF(TFET[1],ERRSTAT); # DEFINE TEMPORARY CATALOG FILE #
                                          2862. IF ERRSTAT NQ CMASTAT"NOERR"
                                          2863. THEN
                                          2864. BEGIN
                                          2865. RETURN; # RETURN ERROR STATUS #
                                          2866. END
                                          2867.  
                                          2868. #
                                          2869. * DETERMINE SUBCATALOG LENGTH.
                                          2870. #
                                          2871.  
                                          2872. NFCT = PRM$ENTRC[SMID] * 16;
                                          2873. NAST = (MAXORD/PRULEN) * 2 + 1;
                                          2874. NPRU = NFCT + NAST; # SUBCATALOG LENGTH IN PRU-S #
                                          2875.  
                                          2876. #
                                          2877. * UPDATE CATALOG PREAMBLE.
                                          2878. #
                                          2879.  
                                          2880. RMV = PRM$ASTLOC[SMID]; # SAVE SUBCATALOG LOCATION #
                                          2881. PRM$SCW1[SMID ] = 0; # CLEAR ENTRY IN PREAMBLE #
                                          2882. FASTFOR I = 1 STEP 1 UNTIL MAXSM
                                          2883. DO
                                          2884. BEGIN
                                          2885. IF PRM$FCTLOC[I] GR RMV
                                          2886. THEN # IF SUBCATALOG LOCATION CHANGED #
                                          2887. BEGIN
                                          2888. PRM$FCTLOC[I] = PRM$FCTLOC[I] - NPRU;
                                          2889. PRM$ASTLOC[I] = PRM$ASTLOC[I] - NPRU;
                                          2890. END
                                          2891.  
                                          2892. END
                                          2893.  
                                          2894. #
                                          2895. * TRANSFER CATALOG FILE TO TEMPORARY FILE, REMOVING SUBCATALOG.
                                          2896. #
                                          2897.  
                                          2898. READ(TFET[0],RCL);
                                          2899. READW(TFET[0],WBUF,WBUFL,STAT);
                                          2900. IF STAT EQ CIOERR
                                          2901. THEN # IF *CIO* ERROR #
                                          2902. BEGIN
                                          2903. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[0]);
                                          2904. RETURN;
                                          2905. END
                                          2906.  
                                          2907. IF STAT NQ 0
                                          2908. THEN # IF TRANSFER NOT COMPLETE #
                                          2909. BEGIN
                                          2910. CMA$RTN[0] = "CRMVSC.";
                                          2911. MESSAGE(CMAMSG,UDFL1);
                                          2912. ABORT;
                                          2913. END
                                          2914.  
                                          2915. FASTFOR I = 0 STEP 1 UNTIL MAXSM
                                          2916. DO # UPDATE CATALOG PREAMBLE #
                                          2917. BEGIN
                                          2918. WBUF$W[I*3+1] = PRM$SCW1[I];
                                          2919. WBUF$W[I*3+2] = PRM$SCW2[I];
                                          2920. WBUF$W[I*3+3] = PRM$SCW3[I];
                                          2921. END
                                          2922.  
                                          2923. P<PREAMBLE> = LOC(WBUF[0]); # CLEAR SECOND WORD OF ENTRY #
                                          2924. PRM$SCW1[SMID] = 0;
                                          2925. PRM$SCW2[SMID ] = 0;
                                          2926. PRM$SCW3[SMID] = 0;
                                          2927. WRITEW(TFET[1],WBUF,WBUFL,STAT);
                                          2928. FASTFOR I = 2 STEP 1 WHILE STAT EQ 0
                                          2929. DO
                                          2930. BEGIN # TRANSFER CATALOG #
                                          2931. IF I EQ RMV # IF AT SUBCATALOG TO BE REMOVED #
                                          2932. THEN
                                          2933. BEGIN # SUBCATALOG TO BE REMOVED #
                                          2934. FASTFOR J = 1 STEP 1 UNTIL NPRU
                                          2935. DO
                                          2936. BEGIN # SKIP SUBCATALOG #
                                          2937. READW(TFET[0],WBUF,WBUFL,STAT);
                                          2938. IF STAT EQ CIOERR
                                          2939. THEN # IF *CIO* ERROR #
                                          2940. BEGIN
                                          2941. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[0]);
                                          2942. RETURN;
                                          2943. END
                                          2944.  
                                          2945. IF STAT NQ 0
                                          2946. THEN # IF *EOR*, *EOF* OR *EOI* #
                                          2947. BEGIN
                                          2948. TEST I; # EXIT TRANSFER CATALOG LOOP #
                                          2949. END
                                          2950.  
                                          2951. END # SKIP SUBCATALOG #
                                          2952.  
                                          2953. END # SUBCATALOG TO BE REMOVED #
                                          2954.  
                                          2955. READW(TFET[0],WBUF,WBUFL,STAT);
                                          2956. IF STAT EQ CIOERR
                                          2957. THEN # IF *CIO* ERROR #
                                          2958. BEGIN
                                          2959. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[0]);
                                          2960. RETURN;
                                          2961. END
                                          2962.  
                                          2963. IF STAT NQ 0 # IF *EOR*, *EOF*, OR *EOI* #
                                          2964. THEN
                                          2965. BEGIN
                                          2966. TEST I; # EXIT LOOP #
                                          2967. END
                                          2968.  
                                          2969. WRITEW(TFET[1],WBUF,WBUFL,STAT);
                                          2970. IF STAT NQ 0
                                          2971. THEN # IF *CIO* ERROR #
                                          2972. BEGIN
                                          2973. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[1]);
                                          2974. RETURN;
                                          2975. END
                                          2976.  
                                          2977. END # TRANSFER CATALOG #
                                          2978.  
                                          2979. WRITEF(TFET[1],RCL);
                                          2980. IF FET$AT[0] NQ 0
                                          2981. THEN
                                          2982. BEGIN
                                          2983. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,TFET[1]);
                                          2984. RETURN;
                                          2985. END
                                          2986.  
                                          2987. #
                                          2988. * REPLACE MSF CATALOG WITH NEW CATALOG (*TSFMCAT*).
                                          2989. #
                                          2990.  
                                          2991. REPLCAT(ORD,ERRSTAT);
                                          2992. RETURN;
                                          2993. END # CRMVSC #
                                          2994.  
                                          2995. TERM
                                          2996. PROC CWTAST((FAMNM),(SUBF),(SMID ),(BADDR),(QRADDR),ERRSTAT);
                                          2997. # TITLE CWTAST - WRITE AVAILABLE STREAM TABLE. #
                                          2998. BEGIN # CWTAST #
                                          2999.  
                                          3000. #
                                          3001. ** CWTAST - WRITE AVAILABLE STREAM TABLE.
                                          3002. *
                                          3003. * *CWTAST* WRITES THE ENTIRE ALLOCATION SUMMARY TABLE FROM THE
                                          3004. * CALLERS BUFFER TO THE CATALOG FILE. THE FREE AU COUNT
                                          3005. * IN THE CATALOG PREAMBLE IS UPDATED. THE CATALOG MUST BE
                                          3006. * OPEN IN MODIFY MODE.
                                          3007. *
                                          3008. * CWTAST - IS CALLED BY ADDCAR,ADDCUBE,ADDCSU,ALLOCAT,
                                          3009. * DESTAGR,OPENCAT,PURGCHN,PURGFCT,RLSUNS,RMVCAR,
                                          3010. * RMVCUBE,STAGER,UPDCAT.
                                          3011. *
                                          3012. * PROC CWTAST((FAMNM),(SUBF),(SMID ),(BADDR),(QRADDR),ERRSTAT)
                                          3013. *
                                          3014. * ENTRY (FAMNM) - FAMILY NAME, LEFT JUSTIFIED, ZERO FILLED,
                                          3015. * 7 CHARACTER MAXIMUM.
                                          3016. * (SUBF) - SUBFAMILY DESIGNATOR.
                                          3017. * (SMID ) - NUMERIC SM IDENTIFIER.
                                          3018. * (BADDR) - ADDRESS OF BUFFER CONTAINING *AST*.
                                          3019. * (QRADDR) - *HLRQ* ENTRY ADDRESS, ELSE ZERO.
                                          3020. *
                                          3021. * EXIT THE *AST* HAS BEEN WRITTEN FROM THE BUFFER AT THE
                                          3022. * ADDRESS SPECIFIED BY (BADDR) TO THE CATALOG.
                                          3023. * (ERRSTAT) - ERROR STATUS.
                                          3024. * (VALUES DEFINED IN *COMBCMS*)
                                          3025. * = NO ERRORS.
                                          3026. * = CATALOG FILE INTERLOCKED.
                                          3027. * = CATALOG NOT OPEN.
                                          3028. * = CATALOG NOT OPEN IN MODIFY MODE.
                                          3029. * = NO SUCH SUBCATALOG.
                                          3030. * = *CIO* ERROR.
                                          3031. *
                                          3032. * NOTES THE LENGTH OF THE *AST* MUST NOT BE CHANGED
                                          3033. * BY THE CALLER. THE CALLERS BUFFER SIZE SHOULD
                                          3034. * BE THE LENGTH OF THE *AST* ROUNDED UP TO A PRU
                                          3035. * MULTIPLE OR LARGER.
                                          3036. #
                                          3037.  
                                          3038. ITEM FAMNM C(7); # FAMILY NAME #
                                          3039. ITEM SUBF U; # SUBFAMILY DESIGNATOR #
                                          3040. ITEM SMID U; # SM IDENTIFIER #
                                          3041. ITEM BADDR U; # *AST* BUFFER ADDRESS #
                                          3042. ITEM QRADDR U; # *HLRQ* ENTRY ADDRESS #
                                          3043. ITEM ERRSTAT I; # ERROR STATUS #
                                          3044.  
                                          3045. #
                                          3046. **** PROC CWTAST - XREF LIST BEGIN.
                                          3047. #
                                          3048.  
                                          3049. XREF
                                          3050. BEGIN
                                          3051. PROC CPIOERR; # PROCESS MSF CATALOG I/O ERROR #
                                          3052. PROC OCTSRCH; # SEARCH OPEN CATALOG TABLE #
                                          3053. PROC REWRITE; # REWRITE DATA FROM I/O BUFFER #
                                          3054. PROC ZSETFET; # INITIALIZES A FET #
                                          3055. PROC RPHR; # RANDOM READ #
                                          3056. PROC WPHR; # RANDOM WRITE #
                                          3057. END
                                          3058.  
                                          3059. #
                                          3060. **** PROC CWTAST - XREF LIST END.
                                          3061. #
                                          3062.  
                                          3063. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          3064. *CALL COMBFAS
                                          3065. *CALL COMBCMD
                                          3066. *CALL COMBCMS
                                          3067. *CALL COMBFET
                                          3068. *CALL COMBMCT
                                          3069. *CALL COMXMSC
                                          3070. *CALL COMSPFM
                                          3071.  
                                          3072. ITEM COUNT I; # FREE STREAM COUNT #
                                          3073. ITEM I I; # LOOP COUNTER #
                                          3074. ITEM LENGTH I; # *AST* LENGTH #
                                          3075. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          3076. CONTROL EJECT;
                                          3077.  
                                          3078. OCTSRCH(FAMNM,SUBF,ORD,QRADDR,ERRSTAT); # GET *OCT* ORDINAL #
                                          3079. IF ERRSTAT NQ CMASTAT"NOERR"
                                          3080. THEN
                                          3081. BEGIN
                                          3082. RETURN; # RETURN ERROR STATUS #
                                          3083. END
                                          3084.  
                                          3085. IF OCT$ATTM[ORD] NQ "M"
                                          3086. THEN # IF NOT OPEN IN MODIFY MODE #
                                          3087. BEGIN
                                          3088. ERRSTAT = CMASTAT"MODERR";
                                          3089. RETURN; # RETURN ERROR STATUS #
                                          3090. END
                                          3091.  
                                          3092. P<PREAMBLE> = OCT$PRMA[ORD];
                                          3093. IF PRM$SCW1[SMID ] EQ 0
                                          3094. THEN # IF NO SUCH SUBCATALOG #
                                          3095. BEGIN
                                          3096. ERRSTAT = CMASTAT"NOSUBCAT";
                                          3097. RETURN;
                                          3098. END
                                          3099.  
                                          3100.  
                                          3101. COUNT = 0;
                                          3102. P<AST> = BADDR;
                                          3103.  
                                          3104.  
                                          3105. #
                                          3106. * WRITE ENTIRE *AST* FROM CALLERS BUFFER TO CATALOG FILE.
                                          3107. #
                                          3108.  
                                          3109. LENGTH = ABUFLEN;
                                          3110. ZSETFET(TFETADR,OCT$LFN[ORD],BADDR,LENGTH,RFETL);
                                          3111. FET$EP[0] = TRUE;
                                          3112. FET$IN[0] = FET$FRST[0] + LENGTH - 1;
                                          3113. FET$R[0] = TRUE;
                                          3114. FET$RR[0] = PRM$ASTLOC[SMID ];
                                          3115. REWRITE(FETSET[0],RCL);
                                          3116. IF FET$AT[0] NQ 0
                                          3117. THEN
                                          3118. BEGIN
                                          3119. CPIOERR(FAMNM,SUBF,QRADDR,ERRSTAT,FETSET[0]);
                                          3120. RETURN;
                                          3121. END
                                          3122.  
                                          3123.  
                                          3124. #
                                          3125. * WRITE UPDATED PREAMBLE TO CATALOG FILE.
                                          3126. #
                                          3127.  
                                          3128. ZSETFET(TFETADR,OCT$LFN[ORD],TBUFADR,2*PRULEN,RFETL);
                                          3129. FET$EP[0] = TRUE;
                                          3130. FET$R[0] = TRUE;
                                          3131. FET$RR[0] = 1;
                                          3132. RPHR(FETSET[0],RCL);
                                          3133. IF FET$AT[0] NQ 0
                                          3134. THEN # READ ERROR #
                                          3135. BEGIN
                                          3136. ERRSTAT = CMASTAT"CIOERR";
                                          3137. FET$AT[0] = 0;
                                          3138. END
                                          3139.  
                                          3140. P<PREAMBLE> = OCT$PRMA[ORD];
                                          3141. FASTFOR I = 0 STEP 1 UNTIL MAXSM
                                          3142. DO # TRANSFER PREAMBLE TO TBUF #
                                          3143. BEGIN
                                          3144. TBUF$W[I + 1] = PRM$SCW1[I];
                                          3145. TBUF$W1[I + 1] = PRM$SCW2[I];
                                          3146. TBUF$W2[I + 1] = PRM$SCW3[I];
                                          3147. END
                                          3148.  
                                          3149. FET$RR[0] = 1;
                                          3150. FET$W[0] = TRUE;
                                          3151. WPHR(FETSET[0],RCL);
                                          3152. IF FET$AT[0] NQ 0
                                          3153. THEN
                                          3154. BEGIN
                                          3155. ERRSTAT = CMASTAT"CIOERR";
                                          3156. FET$AT[0] = 0;
                                          3157. END
                                          3158.  
                                          3159. RETURN;
                                          3160. END # CWTAST #
                                          3161.  
                                          3162. TERM
                                          3163. PROC OCTSRCH((FAM),(SUB),ORD,(QRADR),ERRSTAT);
                                          3164. # TITLE OCTSRCH - OPEN CATALOG TABLE SEARCH. #
                                          3165. BEGIN # OCTSRCH #
                                          3166.  
                                          3167. #
                                          3168. ** OCTSRCH - OPEN CATALOG TABLE SEARCH.
                                          3169. *
                                          3170. * *OCTSRCH* SEARCHES THE OPEN CATALOG TABLE TO GET THE ORDINAL
                                          3171. * OF THE ENTRY WITH THE SPECIFIED FAMILY NAME AND SUBFAMILY
                                          3172. * DESIGNATOR.
                                          3173. *
                                          3174. * OCTSRCH - IS CALLED BY CADDSC,CBUFMAN,CCLOSE,CEXTSC,CFLUSH,
                                          3175. * CGETPD,CPUTPD,CRDAST,CRMVSC,CSELSC,CWTAST,PURGCHN.*
                                          3176. *
                                          3177. * PROC OCTSRCH((FAM),(SUB),ORD,(QRADR),ERRSTAT)
                                          3178. *
                                          3179. * ENTRY (FAM) - FAMILY NAME.
                                          3180. * (SUB) - SUBFAMILY DESIGNATOR.
                                          3181. * (QRADR) - ADDRESS OF *HLRQ* ENTRY, ELSE ZERO.
                                          3182. *
                                          3183. * EXIT (ORD) - THE ORDINAL OF THE DESIRED ENTRY, IF NO
                                          3184. * ERRORS.
                                          3185. * (ERRSTAT) - ERROR STATUS.
                                          3186. * (VALUES DEFINED IN *COMBCMS*)
                                          3187. * = NO ERRORS.
                                          3188. * = CATALOG FILE INTERLOCKED.
                                          3189. * = CATALOG NOT OPEN.
                                          3190. * IF THE CATALOG IS INTERLOCKED AND (QRADR) IS NON-ZERO,
                                          3191. * THE CATALOG ACCESS REQUEST IS ADDED TO THE END OF A
                                          3192. * WAITING-FOR-INTERLOCK CHAIN.
                                          3193. *
                                          3194. * NOTES CATALOG ACCESS REQUESTS FROM *MSSEXEC* PASS THE
                                          3195. * ADDRESS OF THE *HLRQ* ENTRY ASSOCIATED WITH THE
                                          3196. * REQUEST, SO THAT THE REQUEST CAN BE QUEUED IF THE
                                          3197. * CATALOG IS INTERLOCKED. REQUESTS FROM MSS UTILITIES
                                          3198. * SET (QRADR) EQUAL TO ZERO AND MUST BE RETRIED IF THE
                                          3199. * CATALOG IS INTERLOCKED.
                                          3200. #
                                          3201.  
                                          3202. ITEM FAM C(7); # FAMILY NAME #
                                          3203. ITEM SUB U; # SUBFAMILY DESIGNATOR #
                                          3204. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          3205. ITEM QRADR U; # *HLRQ* ENTRY ADDRESS #
                                          3206. ITEM ERRSTAT I; # ERROR STATUS #
                                          3207.  
                                          3208. #
                                          3209. **** PROC OCTSRCH - XREF LIST BEGIN.
                                          3210. #
                                          3211.  
                                          3212. XREF
                                          3213. BEGIN
                                          3214. PROC ADD$LNK; # ADD ENTRY TO END OF CHAIN #
                                          3215. END
                                          3216.  
                                          3217. #
                                          3218. **** PROC OCTSRCH - XREF LIST END.
                                          3219. #
                                          3220.  
                                          3221. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          3222. *CALL COMBFAS
                                          3223. *CALL COMBCMD
                                          3224. *CALL COMBCMS
                                          3225. *CALL COMXHLR
                                          3226.  
                                          3227. ITEM I I; # LOOP COUNTER #
                                          3228. CONTROL EJECT;
                                          3229.  
                                          3230. #
                                          3231. * SEARCH THE *OCT* FOR THE REQUESTED ENTRY.
                                          3232. #
                                          3233.  
                                          3234. ERRSTAT = CMASTAT"NOERR";
                                          3235. ORD = 0;
                                          3236. FASTFOR I = 1 STEP 1 WHILE ORD EQ 0 AND I LQ OCTLEN
                                          3237. DO
                                          3238. BEGIN # SEARCH FOR ENTRY #
                                          3239. IF OCT$SUBF[I] EQ SUB ##
                                          3240. AND OCT$FAM[I] EQ FAM
                                          3241. THEN
                                          3242. BEGIN # REQUESTED ENTRY FOUND #
                                          3243. ORD = I;
                                          3244. IF OCT$INTLK[I]
                                          3245. THEN # IF CATALOG INTERLOCKED #
                                          3246. BEGIN
                                          3247. ERRSTAT = CMASTAT"INTLK";
                                          3248. IF QRADR NQ 0
                                          3249. THEN
                                          3250. BEGIN # ADD REQUEST TO WAITING-FOR-INTERLOCK CHAIN #
                                          3251. IF OCT$LINK[I] EQ 0
                                          3252. THEN # IF EMPTY CHAIN #
                                          3253. BEGIN
                                          3254. OCT$LINK[I] = QRADR;
                                          3255. END
                                          3256.  
                                          3257. ELSE
                                          3258. BEGIN
                                          3259. P<HLRQ> = OCT$LINK[I];
                                          3260. REPEAT WHILE HLR$LNK1[0] NQ 0
                                          3261. DO # SEARCH FOR END OF CHAIN #
                                          3262. BEGIN
                                          3263. P<HLRQ> = HLR$LNK1[0];
                                          3264. END
                                          3265.  
                                          3266. HLR$LNK1[0] = QRADR;
                                          3267. END
                                          3268.  
                                          3269. END # ADD REQUEST TO WAITING-FOR-INTERLOCK CHAIN #
                                          3270.  
                                          3271. END
                                          3272.  
                                          3273. END # REQUESTED ENTRY FOUND #
                                          3274.  
                                          3275. END # SEARCH FOR ENTRY #
                                          3276.  
                                          3277. IF ORD EQ 0
                                          3278. THEN # IF CATALOG NOT OPEN #
                                          3279. BEGIN
                                          3280. ERRSTAT = CMASTAT"NOTOPEN";
                                          3281. END
                                          3282.  
                                          3283. RETURN;
                                          3284. END # OCTSRCH #
                                          3285.  
                                          3286. TERM
                                          3287. PROC REPLCAT((ORD),ERRSTAT);
                                          3288. # TITLE REPLCAT - REPLACES THE MSF CATALOG. #
                                          3289.  
                                          3290. BEGIN # REPLCAT #
                                          3291.  
                                          3292. #
                                          3293. ** REPLCAT - REPLACES THE MSF CATALOG.
                                          3294. *
                                          3295. * *REPLCAT* REPLACES THE MSF CATALOG WITH THE TEMPORARY CATALOG
                                          3296. * (*TSFMCAT*) CREATED BY *CADDSC*, *CEXTSC* OR *CRMVSC*. THE
                                          3297. * OLD CATALOG IS PURGED. THE TEMPORARY CATALOG IS REATTACHED
                                          3298. * IN MODIFY MODE AND THE TEMPORARY CATALOG FILE NAME IS CHANGED
                                          3299. * TO THE ACTUAL CATALOG FILE NAME.
                                          3300. *
                                          3301. * REPLCAT - IS CALLED BY CADDSC,CEXTSC,CRMVSC.
                                          3302. *
                                          3303. *
                                          3304. * PROC REPLCAT((ORD),ERRSTAT)
                                          3305. *
                                          3306. * ENTRY (ORD) = ORDINAL OF *OCT* ENTRY FOR CATALOG.
                                          3307. * TFETADR = ADDRESS OF FET FOR MSF CATALOG.
                                          3308. * TFETADR+RFETL = ADDRESS OF FET FOR TEMPORARY CATALOG.
                                          3309. *
                                          3310. * THE MSF CATALOG IS ATTACHED IN MODIFY MODE AND
                                          3311. * THE NEWLY CREATED CATALOG, *TSFMCAT*, IS ATTACHED
                                          3312. * IN WRITE MODE.
                                          3313. *
                                          3314. * EXIT (ERRSTAT) - ERROR STATUS.
                                          3315. * (VALUES DEFINED IN *COMBCMS*)
                                          3316. * = NO ERRORS.
                                          3317. * = TEMPORARY FILE ATTACH ERROR.
                                          3318. * = TEMPORARY FILE PURGE ERROR.
                                          3319. * = TEMPORARY FILE RENAME ERROR.
                                          3320. * THE MSF CATALOG IS REPLACED WITH *TSFMCAT*.
                                          3321. *
                                          3322. * MESSAGES * MSF CATALOG REPLACE ERROR.
                                          3323. * SFMCATN FOR FAMILY FFFFFFF CLOSED.*
                                          3324. *
                                          3325. * * DEVICE UNAVAILABLE ON MSF CATALOG ACCESS.
                                          3326. * SFMCATN FOR FAMILY FFFFFFF CLOSED.*
                                          3327. *
                                          3328. * NOTES IF AN ERROR IDLE STATUS IS RETURNED ON A *PFM*
                                          3329. * REQUEST, *REPLCAT* WILL RESTORE THE MSF CATALOG
                                          3330. * TO ITS PRIOR STATE (BEFORE CURRENT UPDATE). IF
                                          3331. * SOME OTHER ERROR IS RETURNED, ANALYST INTERVENTION
                                          3332. * MAY BE REQUIRED TO RESTORE THE CATALOG. IN EITHER
                                          3333. * CASE THE CATALOG WILL BE CLOSED.
                                          3334. #
                                          3335.  
                                          3336. ITEM ORD I; # ORDINAL OF *OCT* ENTRY #
                                          3337. ITEM ERRSTAT I; # ERROR STATUS #
                                          3338.  
                                          3339. #
                                          3340. **** PROC REPLCAT - XREF LIST BEGIN.
                                          3341. #
                                          3342.  
                                          3343. XREF
                                          3344. BEGIN
                                          3345. PROC BZFILL; # BLANK OR ZERO FILL WORD #
                                          3346. PROC MESSAGE; # ISSUE MESSAGE #
                                          3347. PROC PFD; # PERMANENT FILE REQUEST DELAYS #
                                          3348. PROC READ; # READ FILE TO *CIO* BUFFER #
                                          3349. PROC RENAME; # RENAME LOCAL FILE #
                                          3350. PROC RETERN; # RETURN A FILE #
                                          3351. PROC REWIND; # REWIND A FILE #
                                          3352. PROC RMVBLNK; # REMOVE MULTIPLE BLANKS #
                                          3353. PROC WRITE; # WRITE DATA FROM *CIO* BUFFER #
                                          3354. PROC WRITEF; # WRITE END OF FILE #
                                          3355. FUNC XCDD C(10); # CONVERT DECIMAL TO DISPLAY #
                                          3356. PROC ZFILL; # ZERO FILL BUFFER #
                                          3357. END
                                          3358.  
                                          3359. #
                                          3360. **** PROC REPLCAT - XREF LIST END.
                                          3361. #
                                          3362.  
                                          3363. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
                                          3364. *CALL COMBFAS
                                          3365. *CALL COMBBZF
                                          3366. *CALL COMBCMD
                                          3367. *CALL COMBCMS
                                          3368. *CALL COMBFET
                                          3369. *CALL COMBPFS
                                          3370. *CALL COMXMSC
                                          3371. *CALL COMSPFM
                                          3372.  
                                          3373. ITEM CATPFN C(7); # MSF CATALOG PFN #
                                          3374. ITEM DEV$NA B; # DEVICE NOT AVAILABLE FLAG #
                                          3375. ITEM DIS$SUBF C(10); # SUBFAMILY (DISPLAY CODE) #
                                          3376. ITEM FAMILY C(7); # FAMILY NAME #
                                          3377. CONTROL EJECT;
                                          3378.  
                                          3379. P<FETSET> = TFETADR;
                                          3380. DEV$NA = FALSE;
                                          3381.  
                                          3382. #
                                          3383. * PURGE OLD CATALOG FILE.
                                          3384. #
                                          3385.  
                                          3386. CATPFN = SFMCAT; # BUILD CATALOG PFN #
                                          3387. DIS$SUBF = XCDD(OCT$SUBF[ORD]);
                                          3388. C<6,1>CATPFN = C<9,1>DIS$SUBF;
                                          3389. PFD("PURGE",CATPFN,"RC",PFSTAT,"UP",0,0);
                                          3390. IF PFSTAT NQ 0
                                          3391. THEN
                                          3392. BEGIN
                                          3393. DEV$NA = PFSTAT EQ PFN;
                                          3394. ERRSTAT = CMASTAT"TPRGERR";
                                          3395. PFD("PURGE",TSFMCAT,"RC",PFSTAT,"UP",0,"SR","IE",0);
                                          3396. GOTO RETNCAT;
                                          3397. END
                                          3398.  
                                          3399. #
                                          3400. * REATTACH CATALOG IN MODIFY MODE.
                                          3401. #
                                          3402.  
                                          3403. PFD("ATTACH",TSFMCAT,0,"M","M","RC",PFSTAT,"NA",0,"UP",0,0);
                                          3404. IF PFSTAT NQ 0
                                          3405. THEN
                                          3406. BEGIN # ATTACH ERROR #
                                          3407. ERRSTAT = CMASTAT"TATTERR";
                                          3408. IF PFSTAT EQ PFN
                                          3409. THEN
                                          3410. BEGIN
                                          3411. GOTO RESTCAT;
                                          3412. END
                                          3413.  
                                          3414. ELSE
                                          3415. BEGIN
                                          3416. GOTO RETNCAT;
                                          3417. END
                                          3418.  
                                          3419. END # ATTACH ERROR #
                                          3420.  
                                          3421. #
                                          3422. * CHANGE TEMPORARY FILE NAME TO ACTUAL CATALOG NAME.
                                          3423. #
                                          3424.  
                                          3425. PFD("CHANGE",CATPFN,TSFMCAT,"RC",PFSTAT,"UP",0,0);
                                          3426. IF PFSTAT NQ 0
                                          3427. THEN
                                          3428. BEGIN # CHANGE ERROR #
                                          3429. ERRSTAT = CMASTAT"TRNMERR";
                                          3430. IF PFSTAT EQ PFN
                                          3431. THEN
                                          3432. BEGIN
                                          3433. GOTO RESTCAT;
                                          3434. END
                                          3435.  
                                          3436. ELSE
                                          3437. BEGIN
                                          3438. GOTO RETNCAT;
                                          3439. END
                                          3440.  
                                          3441. END # CHANGE ERROR #
                                          3442.  
                                          3443. RETERN(FETSET[0],RCL);
                                          3444. RENAME(FETSET[1],OCT$LFN[ORD]);
                                          3445. RETURN;
                                          3446.  
                                          3447. RESTCAT: # RESTORE ORIGINAL CATALOG #
                                          3448. PFD("ATTACH",TSFMCAT,0,"M","W","RC",PFSTAT,"NA",0, ##
                                          3449. "UP",0,"SR","IE",0);
                                          3450. FET$IN[0] = FET$FRST[0]; # RESET FET POINTERS #
                                          3451. FET$OUT[0] = FET$FRST[0];
                                          3452. FET$IN[1] = FET$FRST[1];
                                          3453. FET$OUT[1] = FET$FRST[1];
                                          3454. REWIND(FETSET[0],NRCL);
                                          3455. REPEAT WHILE NOT FET$EOI[0]
                                          3456. DO
                                          3457. BEGIN
                                          3458. READ(FETSET[0],RCL);
                                          3459. FET$IN[1] = FET$IN[0];
                                          3460. WRITE(FETSET[1],RCL);
                                          3461. FET$OUT[0] = FET$OUT[1];
                                          3462. END
                                          3463.  
                                          3464. WRITEF(FETSET[1],RCL);
                                          3465. PFD("CHANGE",CATPFN,TSFMCAT,"RC",PFSTAT,"UP",0,"SR","IE",0);
                                          3466. DEV$NA = TRUE;
                                          3467.  
                                          3468. RETNCAT: # RETURN LOCAL CATALOGS #
                                          3469. RETERN(FETSET[0],RCL);
                                          3470. RETERN(FETSET[1],RCL);
                                          3471.  
                                          3472. IF DEV$NA # ISSUE ERROR MESSAGE #
                                          3473. THEN
                                          3474. BEGIN
                                          3475. CMSGLINE[0] = CMSG1;
                                          3476. END
                                          3477.  
                                          3478. ELSE
                                          3479. BEGIN
                                          3480. CMSGLINE[0] = CMSG2;
                                          3481. END
                                          3482.  
                                          3483. MESSAGE(CMSGAREA,UDFL1); # ISSUE ERROR MESSAGE #
                                          3484. CMSGLINE[0] = CMSGCLOSE;
                                          3485. FAMILY = OCT$FAM[ORD];
                                          3486. BZFILL(FAMILY,TYPFILL"BFILL",7);
                                          3487. CMSGCFAM[0] = FAMILY;
                                          3488. CMSGCSUBF[0] = C<9,1>DIS$SUBF;
                                          3489. RMVBLNK(CMSGAREA,48);
                                          3490. MESSAGE(CMSGAREA,UDFL1);
                                          3491.  
                                          3492. ZFILL(OCT[ORD],OCTENTL);
                                          3493. RETURN;
                                          3494.  
                                          3495. END # REPLCAT #
                                          3496.  
                                          3497. TERM