3)
1)
REQTYPE),(REQCODE),RESPCODE)
  • [00876] MVCALL - ISSUES TYPE 1 OR 2 UCP REQUEST TO EXEC.
  • [00881] MVCALL - ISSUES A TYPE 1 OR 2 UCP REQUEST TO EXEC.
  • [00911] PROC ABORT
  • [00912] PROC CALLSS
  • [00913] PROC MESSAGE
  • [00914] PROC RESTPFP
  • [00990] PROC MVCKSF((FN),(UI),PO)
    • [00991] MVCKSF - CHECK IF SPECIAL FILE.
    • [00996] MVCKSF - CHECK IF SPECIAL FILE.
    • [01068] PROC MVDIR
    • [01069] MVDIR - PROCESS DIRECTIVES .
    • [01097] PROC BZFILL
    • [01098] PROC MESSAGE
    • [01099] PROC READ
    • [01100] PROC READC
    • [01101] PROC RPEJECT
    • [01102] PROC RPLINE
    • [01103] PROC RPSPACE
    • [01105] PROC XARG
    • [01107] PROC ZFILL
    • [01108] PROC ZSETFET
    • [01109] FUNC XCDD C(10)
    • [01110] FUNC XDXB I
    • [01617] PROC MVDOIT
    • [01618] MVDOIT - PERFORM SELECTED PROCESSING.
    • [01623] MVDOIT - PERFORM SELECTED PROCESSING.
    • [01655] PROC BZFILL
    • [01656] PROC CALPFU
    • [01657] PROC DROPDS
    • [01658] PROC DROPIDS
    • [01659] PROC MESSAGE
    • [01660] PROC MVERRP
    • [01661] PROC RECALL
    • [01662] PROC RETERN
    • [01663] PROC SETAF
    • [01664] PROC UATTACH
    • [01665] PROC UGET
    • [01666] PROC ZFILL
    • [01856] PROC MVERRP
    • [01857] MVERRP - PROCESS ERRORS.
    • [01862] MVERRP - *SSMOVE* ERROR PROCESSOR.
    • [01877] PROC WRITEW
    • [01902] PROC MVHEAD((FETP
    2)
    ABNDN
    3)

    SSMOVE

    Table Of Contents

    • [00001] PRGM SSMOVE
    • [00002] SSMOVE - INITIALIZES *SSMOVE* UTILITY.
    • [00007] INITIALIZES *SSMOVE* UTILITY.
    • [00124] PROC ABORT
    • [00125] PROC BZFILL
    • [00126] PROC GETSPS
    • [00127] PROC MESSAGE
    • [00128] PROC MVABDS
    • [00129] PROC MVCALL
    • [00130] PROC MVINIT
    • [00132] PROC MVPASS3
    • [00134] PROC MVPASS4
    • [00135] PROC MVPFRD
    • [00136] PROC RESTPFP
    • [00138] PROC RETERN
    • [00139] PROC RPCLOSE
    • [00140] PROC ZSETFET
    • [00308] PROC GETPFC(PEO,FLAG)
    • [00309] GETPFC - GET NEXT PFC ENTRY.
    • [00314] GETPFC - GET NEXT PFC ENTRY.
    • [00344] PROC MESSAGE
    • [00345] PROC RDPFC
    • [00346] PROC RESTPFP
    • [00448] PROC MVABDS
    • [00449] MVABDS - PROCESS DESTAGE ABANDONMENT.
    • [00454] MVABDS - PROCESS DESTAGE ABANDONMENT INFORMATION.
    • [00477] PROC BZFILL
    • [00478] PROC MESSAGE
    • [00479] PROC MVRPTDS
    • [00480] PROC PF
    • [00481] PROC READ
    • [00482] PROC READW
    • [00483] PROC RESTPFP
    • [00484] PROC RPEJECT
    • [00485] PROC RPLINE
    • [00486] PROC RPSPACE
    • [00487] PROC ZFILL
    • [00488] PROC ZSETFET
    • [00489] FUNC XCDD C(10)
    • [00490] FUNC XCOD C(10)
    • [00809] PROC MVALCS(CS,VCS,NBS,KEY,FLAG)
    • [00810] MVALCS - ANALYZES CHARACTER STRING.
    • [00815] MVALCS - ANALYZES CHARACTER STRING.
    • [00875] PROC MVCALL1)
    • [01903] MVHEAD - PRINTS HEADER ON *SSMOVE* REPORT FILE.
    • [01908] MVHEAD - PRINTS HEADER ON *SSMOVE* REPORT FILE.
    • [01929] PROC BZFILL
    • [01930] PROC RPLINEX
    • [01971] PROC MVINDEV
    • [01972] MVINDEV - INITIALIZE *DEVSTAT* ARRAY.
    • [01976] MVINDEV - INITIALIZE *DEVSTAT* ARRAY.
    • [02007] PROC GETMST
    • [02009] PROC MESSAGE
    • [02010] PROC RESTPFP
    • [02012] PROC ZFILL
    • [02117] PROC MVINIT
    • [02118] MVINIT - DECODES *SSMOVE* CONTROL STATEMENT.
    • [02123] MVINIT - DECODES *SSMOVE* CONTROL STATEMENT.
    • [02149] PROC BZFILL
    • [02150] PROC GETFAM
    • [02151] PROC GETPFP
    • [02152] PROC MESSAGE
    • [02153] PROC MVALCS
    • [02154] PROC MVDIR
    • [02155] PROC MVHEAD
    • [02156] PROC MVINDEV
    • [02158] PROC MVTAB
    • [02160] PROC PDATE
    • [02161] PROC PF
    • [02162] PROC RESTPFP
    • [02163] PROC RPOPEN
    • [02164] PROC SETPFP
    • [02165] PROC XARG
    • [02167] FUNC MVRELAG U
    • [02168] FUNC XDXB I
    • [02392] PROC MVPASS3
    • [02393] MVPASS3 - FINAL SELECTION OF FILES TO BE RELEASED.
    • [02399] MVPASS3 - FINAL SELECTION OF FILES TO BE RELEASED.
    • [02445] PROC CLOSEM
    • [02446] PROC FILESQ
    • [02448] PROC OPENM
    • [02449] PROC READ
    • [02450] PROC RETERN
    • [02451] PROC READW
    • [02452] PROC REWIND
    • [02453] PROC SM5END
    • [02454] PROC SM5FROM
    • [02455] PROC SM5KEY
    • [02456] PROC SM5SORT
    • [02457] PROC SM5TO
    • [02458] PROC WRITER
    • [02459] PROC WRITEW
    • [02460] PROC ZSETFET
    • [02679] PROC MVPASS4
    • [02680] MVPASS4 - SETS UP THE COMMUNICATION FILE.
    • [02685] MVPASS4 - SETS UP THE COMMUNICATION FILE.
    • [02720] PROC BZFILL
    • [02721] PROC MVDOIT
    • [02723] PROC MVPRNDT
    • [02724] PROC MVRPTDS
    • [02725] PROC READ
    • [02727] PROC READW
    • [02729] PROC RETERN
    • [02730] PROC REWIND
    • [02731] PROC RPEJECT
    • [02732] PROC RPLINE
    • [02733] PROC WRITER
    • [02734] PROC WRITEW
    • [02735] PROC ZFILL
    • [02736] PROC ZSETFET
    • [02737] FUNC XCDD C(10)
    • [02739] FUNC XCOD C(10)
    • [03082] PROC MVPFRD
    • [03083] MVPFRD - READ PFC.
    • [03088] MVPFRD - READ PFC.
    • [03121] PROC BZFILL
    • [03122] PROC GETDI
    • [03123] PROC GETPFC
    • [03124] PROC MESSAGE
    • [03125] PROC MVCKSF
    • [03126] PROC MVVALDS
    • [03127] PROC MVVALRL
    • [03128] PROC RETERN
    • [03129] PROC REWIND
    • [03130] PROC UATTACH
    • [03131] PROC WRITER
    • [03132] PROC WRITEW
    • [03133] PROC XWOD
    • [03134] PROC ZFILL
    • [03135] PROC ZSETFET
    • [03671] PROC MVPRNDT(PDATE,ACC$CT,DVAL,RVAL)
    • [03672] MVPRNDT - PRINT DATE AND ACCESS COUNTS.
    • [03677] MVPRNDT - PRINT DATE AND ACCESS COUNTS.
    • [03702] PROC RPLINE
    • [03703] FUNC XCDD C(10)
    • [03764] FUNC MVRELAG(RELDATE) U
    • [03765] MVRELAG - CALCULATE RELATIVE AGE.
    • [03770] MVRELAG - CALCULATE RELATIVE AGE.
    • [03836] PROC MVRPTDS2)
    • [03837] MVRPTDS - REPORT DEVICE STATUS.
    • [03842] MVRPTDS - REPORT DEVICE STATUS.
    • [03864] PROC MESSAGE
    • [03865] PROC RPEJECT
    • [03866] PROC RPLINE
    • [03867] PROC RPSPACE
    • [03868] FUNC XCDD C(10)
    • [03869] FUNC XCOD C(10)
    • [04137] PROC MVVALDS(DVAL,PO)
    • [04138] MVVALDS - CALCULATE DESTAGE VALUE.
    • [04143] MVVALDS - CALCULATE DESTAGE VALUE.
    • [04161] FUNC MVRELAG U
    • [04216] PROC MVVALRL(RVAL,PO)
    • [04217] MVVALRL - CALCULATE RELEASE VALUE.
    • [04221] MVVALRL - CALCULATE RELEASE VALUE.
    • [04239] FUNC MVRELAG U
    </WRAP> === Source Code ===
    SSMOVE.txt
    1. PRGM SSMOVE;
    2. # TITLE SSMOVE - INITIALIZES *SSMOVE* UTILITY. #
    3.  
    4. BEGIN # SSMOVE #
    5.  
    6. #
    7. *** SSMOVE - INITIALIZES *SSMOVE* UTILITY.
    8. *
    9. * THIS PRGM INITIALIZES THE *SSMOVE* UTILITY BY CRACKING
    10. * THE CONTROL CARD AND SYNTAX CHECKING THE PARAMETERS.
    11. *
    12. * SSMOVE,I,L,FM,LO,DN,NW,UI,PX,SB.
    13. *
    14. * PRGM SSMOVE.
    15. *
    16. * ENTRY. INPUTS TO *SSMOVE* ARE
    17. *
    18. * I INPUT DIRECTIVES ON FILE *INPUT*.
    19. * I = FLNM INPUT DIRECTIVES ON FILE *FLNM*.
    20. * I = 0 NO INPUT DIRECTIVES. DEFAULT PARAMETERS
    21. * WILL BE USED.
    22. * I OMITTED SAME AS *I*.
    23. *
    24. * L LISTABLE OUTPUT IS ON FILE *OUTPUT*.
    25. * L = LFN LISTABLE OUTPUT IS ON FILE *LFN*.
    26. * L = 0 NO OUTPUT FILE GENERATED.
    27. * L OMITTED SAME AS *L*.
    28. *
    29. *
    30. * NW NO WAIT - DO NOT WAIT FOR EXEC TO PROCESS
    31. * THE *SSMOVE* REQUEST FILE.
    32. * NW OMITTED WAIT FOR COMPLETION OF *SSMOVE* REQUEST
    33. * PROCESSING BY EXEC.
    34. *
    35. * FM USE DEFAULT FAMILY.
    36. * FM = FAMILY FAMILY TO BE PROCESSED.
    37. * FM OMITTED SAME AS *FM*.
    38. *
    39. * LO INDIVIDUAL FILES ARE NOT TO BE LISTED IN
    40. * THE REPORT FILE.
    41. * LO = F ALL FILES SELECTED FOR STAGING, DESTAGING,
    42. * OR RELEASING ARE LISTED IN THE REPORT FILE.
    43. * LO = P LIST ONLY FILES ACTUALLY PROCESSED IN
    44. * REPORT FILE (PER *PX* PARAMETER).
    45. * LO OMITTED SAME AS *LO*.
    46. *
    47. * DN FILES FROM ALL DEVICES IN A SPECIFIED
    48. * FAMILY ARE ELIGIBLE FOR DESTAGE AND
    49. * RELEASE.
    50. * DN = DEVICE DEVICE NUMBER OF THE ONLY DISK FROM
    51. * WHICH FILES ARE ELIGIBLE FOR DESTAGE AND
    52. * RELEASE.
    53. * DN OMITTED SAME AS *DN*.
    54. *
    55. * LB = N LARGE FILE BOUNDARY, USED WHEN
    56. * SORTING FILES FOR DESTAGING. ALL FILES
    57. * SMALLER THAN *N* PRU-S ARE CONSIDERED
    58. * SMALL FILES.
    59. * LB DEFAULT LARGE FILE BOUNDARY IS USED.
    60. * LB OMITTED SAME AS *LB*.
    61. *
    62. * UI ALL USER INDICES ARE PROCESSED.
    63. * UI = N RESTRICT PROCESSING TO FILES HAVING
    64. * USER INDEX *N*.
    65. * UI OMITTED SAME AS *UI*.
    66. *
    67. * PX ALL SELECTED PROCESSING WILL BE DONE.
    68. * PX = XXX *XXX* IS A CHARACTER STRING IDENTIFYING
    69. * WHICH TYPES OF PROCESSING ARE TO BE
    70. * EXCLUDED. EACH CHARACTER OF *XXX* CAN BE
    71. * ONE OF THE LETTERS *ABDFIS*.
    72. * *I* INHIBITS PROCESSING OF INDIRECT ACCESS
    73. * FILES.
    74. * *D* INHIBITS PROCESSING OF DIRECT ACCESS
    75. * FILES.
    76. * *A* CONTROLS RELEASING OF DISK SPACE
    77. * (ARCHIVING).
    78. * *B* CONTROLS DESTAGING A FILE FROM DISK TO
    79. * M860 (BACK-UP).
    80. * *S* CONTROLS STAGING A FILE TO DISK.
    81. * *F* CONTROLS FREEING A FILE FROM M860 BY
    82. * CLEARING ITS ASA VALUE FROM THE FILES
    83. * *PFC* ENTRY.
    84. * (E.G. PX = ABFS REPORTS THE RESULTS OF A
    85. * *SSMOVE* RUN WITHOUT ACTUALLY PERFORMING
    86. * THE SELECTED ACTIONS.)
    87. * PX OMITTED SAME AS *PX*.
    88. *
    89. * EXIT. *SSMOVE* PROCESSED OR AN ERROR CONDITION
    90. * ENCOUNTERED.
    91. *
    92. * MESSAGES. SSMOVE - MUST BE SYSTEM ORIGIN.
    93. * SSMOVE COMPLETE.
    94. * SSMOVE ABNORMAL, SSMOVE.
    95. * UNABLE TO CONNECT WITH EXEC.
    96. *
    97. * NOTES. PRGM *SSMOVE* INITIALIZES *SSMOVE* UTILITY BY
    98. * CRACKING AND SYNTAX CHECKING THE CONTROL CARD
    99. * PARAMETERS. ANY ERROR IN THE CONTROL CARD OR
    100. * IN *SSMOVE* PROCESSING CAUSES THE UTILITY TO
    101. * ABORT. PRGM *SSMOVE* IS THE MAIN MODULE FROM
    102. * WHICH ALL THE OTHER ROUTINES ARE CALLED. THE LIVE
    103. * PFC IS READ AND THE ENTRIES FOR THE FILES CANDIDATE
    104. * FOR *DESTAGE AND RELEASE* OR *DESTAGE ONLY* ARE
    105. * WRITTEN TO TEMPORARY FILES. THE FILES CANDIDATE
    106. * FOR *RELEASE ONLY* ARE RELEASED DIRECTLY. THE
    107. * TEMPORARY FILES ARE THEN USED TO GENERATE THE
    108. * COMMUNICATION FILE FOR EXEC. IF THE *REPORT
    109. * ONLY* OPTION HAS NOT BEEN SELECTED, THE COMM-
    110. * UNICATION FILE IS SENT TO EXEC VIA A UCP TYPE 2
    111. * REQUEST. A SUMMARY OF ALL THE FILES SELECTED
    112. * FOR *RELEASE ONLY*, *DESTAGE AND RELEASE* AND
    113. * FOR *DESTAGE ONLY* IS WRITTEN TO THE REPORT FILE.
    114. *
    115. * COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
    116. #
    117.  
    118. #
    119. **** PRGM SSMOVE - XREF LIST BEGIN.
    120. #
    121.  
    122. XREF
    123. BEGIN
    124. PROC ABORT; # CALLS *ABORT* MACRO #
    125. PROC BZFILL; # BLANK/ZERO FILL CHARACTER ITEM #
    126. PROC GETSPS; # GET SYSTEM ORIGIN STATUS #
    127. PROC MESSAGE; # DISPLAYS A MESSAGE IN DAYFILE #
    128. PROC MVABDS; # PROCESS DESTAGE ABANDONMENT #
    129. PROC MVCALL; # ISSUES TYPE 1, 2 UCP REQUEST #
    130. PROC MVINIT; # DECODES *SSMOVE* CONTROL
    131.   STATEMENT #
    132. PROC MVPASS3; # SETS UP "DESTAGE AND RELEASE"
    133.   AND "DESTAGE" TEMP FILES #
    134. PROC MVPASS4; # SETS UP COMMUNICATION FILE #
    135. PROC MVPFRD; # READS PFC #
    136. PROC RESTPFP; # RESTORE USER-S *PFP* AND ABORT
    137.   OR RETURN #
    138. PROC RETERN; # RETURN A FILE #
    139. PROC RPCLOSE; # CLOSE REPORT FILE #
    140. PROC ZSETFET; # INITIALIZE A FET #
    141. END
    142.  
    143. #
    144. **** PRGM SSMOVE - XREF LIST END.
    145. #
    146.  
    147. #
    148. * DAYFILE MESSAGES.
    149. #
    150.  
    151. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    152. DEF RSLEN #1#; # RETURN STATUS WORD LENGTH L #
    153. DEF MSG1 #" SSMOVE - MUST BE SYSTEM ORIGIN."#;
    154. DEF MSG2 #" SSMOVE COMPLETE."#;
    155. DEF MSG3 #" UNABLE TO CONNECT WITH EXEC."#;
    156. DEF PROCNAME #"SSMOVE"#; # PROC NAME #
    157.  
    158. CONTROL PRESET;
    159. *CALL,COMBFAS
    160. *CALL,COMBBZF
    161. *CALL,COMBCPR
    162. *CALL,COMBUCR
    163. *CALL,COMTMOV
    164. *CALL,COMTMVP
    165. *CALL,COMTOUT
    166.  
    167. ITEM RESPCODE I; # RESPONSE FROM EXEC #
    168.  
    169. ARRAY CALL$SS [0:0] P(CPRLEN);; # CALLSS PARAMETER BLOCK #
    170.  
    171. ARRAY SPSSTAT[0:0] S(RSLEN);
    172. BEGIN
    173. ITEM SPS$STATUS U(00,48,12); # RETURN STATUS #
    174. END
    175.  
    176. CONTROL EJECT;
    177.  
    178. REQID$MV = REQNAME"RQIMOVE"; # SET UP REQUESTOR ID #
    179.  
    180. #
    181. * CHECK FOR SYSTEM ORIGIN PRIVILEGES.
    182. #
    183.  
    184. GETSPS(SPSSTAT); # GET SYSTEM ORIGIN STATUS #
    185. IF SPS$STATUS NQ 0
    186. THEN
    187. BEGIN
    188. MVMSG$LN[0] = MSG1;
    189. MESSAGE(MVMSG[0],SYSUDF1);
    190. ABORT;
    191. END
    192.  
    193. #
    194. * INITIALIZE *SSMOVE* BY DECODING RUN-TIME PARAMETERS AND
    195. * BY DECODING RUN-TIME DIRECTIVES.
    196. *
    197. * WRITE THE FIRST TWO SECTIONS OF THE *SSMOVE* REPORT
    198. * TO THE REPORT FILE - DIRECTIVES, AND RUN-TIME WEIGHTS.
    199. #
    200.  
    201. MVINIT;
    202.  
    203. #
    204. * READ THE PFC AND GENERATE TEMPORARY DECISION FILE.
    205. #
    206.  
    207. MVPFRD;
    208.  
    209. #
    210. * GENERATE *DESTAGE AND RELEASE* AND *DESTAGE* TEMP FILES
    211. * AND RELEASE THE FILES CANDIDATE FOR RELEASE ONLY.
    212. #
    213.  
    214. MVPASS3;
    215.  
    216. #
    217. * GENERATE COMMUNICATION FILE.
    218. * THE REPORT PRODUCED BY THIS STEP IS A LISTING OF THE FILES
    219. * SELECTED FOR PROCESSING AND THE EXPECTED STATUS OF EACH
    220. * DEVICE AND SUBFAMILY UPON COMPLETION OF THE SELECTED.
    221. * PROCESSING.
    222. #
    223.  
    224. MVPASS4;
    225.  
    226. #
    227. * IF *REPORT ONLY* OPTION IS NOT SELECTED-
    228. * AND COMMUNICATION FILE NOT EMPTY-
    229. * 1. CONNECT WITH EXEC.
    230. * 2. INFORM EXEC THAT COMMUNICATION FILE IS READY.
    231. * 3. DISCONNECT.
    232. #
    233.  
    234. IF NOT (PX$A[0] AND PX$B[0] AND PX$S[0] AND PX$F[0]) ##
    235. AND NFILES NQ 0
    236. THEN
    237. BEGIN # SEND COMMUNICATION FILE TO EXEC #
    238. P<CPR> = LOC(CALL$SS[0]);
    239. MVCALL(TYP"TYP1",REQTYP1"CONNECT",RESPCODE);
    240. IF RESPCODE NQ RESPTYP1"OK1"
    241. THEN # CONNECT NOT DONE #
    242. BEGIN
    243. MVMSG$LN[0] = MSG3;
    244. MESSAGE(MVMSG[0],SYSUDF1);
    245. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    246. END
    247.  
    248. MVCALL(TYP"TYP2",REQTYP2"FILE$READY",RESPCODE);
    249.  
    250. IF RESPCODE NQ RESPTYP2"OK2"
    251. THEN # ABNORMAL TERMINATION #
    252. BEGIN
    253. MVMSG$PROC[0] = PROCNAME;
    254. MESSAGE(MVMSG[0],SYSUDF1);
    255. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    256. END
    257.  
    258. MVCALL(TYP"TYP1",REQTYP1"DISCONNECT",RESPCODE);
    259. IF RESPCODE NQ RESPTYP1"OK1"
    260. THEN # ABNORMAL TERMINATION #
    261. BEGIN
    262. MVMSG$PROC[0] = PROCNAME;
    263. MESSAGE(MVMSG[0],SYSUDF1);
    264. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    265. END
    266.  
    267. #
    268. * PRODUCE REPORT OF ANY DESTAGES WHICH WERE ABANDONED.
    269. #
    270.  
    271. IF NOT MVARG$NW[0]
    272. THEN
    273. BEGIN
    274. MVABDS;
    275. END
    276.  
    277. END # SEND COMMUNICATION FILE TO EXEC #
    278.  
    279. #
    280. * CLOSE REPORT FILE.
    281. #
    282.  
    283. RPCLOSE(OUT$FETP);
    284.  
    285. #
    286. * RETURN *MVOCOM* FILE AND *CATS* FILE.
    287. #
    288.  
    289. RETERN(MV$FET[FILEMO],RCL);
    290. FETP = LOC(MV$FET[FILEMO]);
    291. BUFP = LOC(MV$BUF[FILEMO]);
    292. COMNAME = CATS;
    293. BZFILL(COMNAME,TYPFILL"ZFILL",7);
    294. ZSETFET(FETP,COMNAME,BUFP,MVBUFL,SFETL);
    295. RETERN(MV$FET[FILEMO],RCL);
    296.  
    297. #
    298. * ISSUE FINAL DAYFILE MESSAGE.
    299. #
    300.  
    301. MVMSG$LN[0] = MSG2; # STOP WITH DAYFILE MESSAGE #
    302. MESSAGE(MVMSG[0],SYSUDF1);
    303. RESTPFP(PFP$END); # RESTORE USER-S *PFP* #
    304.  
    305. END # SSMOVE #
    306.  
    307. TERM
    308. PROC GETPFC(PEO,FLAG);
    309. # TITLE GETPFC - GET NEXT PFC ENTRY. #
    310.  
    311. BEGIN # GETPFC #
    312.  
    313. #
    314. ** GETPFC - GET NEXT PFC ENTRY.
    315. *
    316. * PROC GETPFC(PEO,FLAG).
    317. *
    318. * ENTRY. (PEO) = ORDINAL OF PREVIOUS PFC ENTRY.
    319. *
    320. * EXIT. (PEO) = ORDINAL OF CURRENT PFC ENTRY.
    321. * P<CNTRWORD> = FWA OF CONTROL WORD.
    322. * P<PFC> = FWA OF CURRENT PFC ENTRY.
    323. * (FLAG) = ERROR STATUS.
    324. * 0, MORE PFC ENTRIES TO GO.
    325. * 1, END OF PFC.
    326. *
    327. * MESSAGES. NO DEVICES IN THE FAMILY.
    328. * SSMOVE ABNORMAL, GETPFC.
    329. *
    330. * NOTES. A CATALOG SECTOR IS READ IN ALONG WITH THE CONTROL
    331. * WORD. THE ORDINAL OF THE NON ZERO PFC ENTRY IN THE
    332. * SECTOR IS RETURNED TO THE CALLING PROCEDURE.
    333. #
    334.  
    335. ITEM PEO I; # PFC ENTRY ORDINAL #
    336. ITEM FLAG I; # ERROR STATUS #
    337.  
    338. #
    339. **** PROC GETPFC - XREF LIST BEGIN.
    340. #
    341.  
    342. XREF
    343. BEGIN
    344. PROC MESSAGE; # DISPLAYS MESSAGE IN DAYFILE #
    345. PROC RDPFC; # READ *PFC* ENTRY #
    346. PROC RESTPFP; # RESTORE USER-S *PFP* AND ABORT
    347.   OR RETURN #
    348. END
    349.  
    350. #
    351. **** PROC GETPFC - XREF LIST END.
    352. #
    353.  
    354. DEF MSF$NODEV #"NO DEVICES IN THE FAMILY."#; # MESSAGE TEST #
    355. DEF PROCNAME #"GETPFC."#; # PROC NAME #
    356.  
    357. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    358. *CALL,COMBFAS
    359. *CALL COMBSIT
    360. *CALL,COMTCTW
    361. *CALL,COMSPFM
    362. *CALL,COMTMOV
    363. *CALL,COMTMVP
    364.  
    365. ITEM FIRST B = TRUE; # FIRST CALL TO PROCEDURE #
    366. ITEM I I; # LOOP INDUCTION VARIABLE #
    367. ITEM LIMIT I; # LIMIT ON PFC ORDINAL #
    368. ITEM WRDCNT I; # WORD COUNT #
    369.  
    370. CONTROL EJECT;
    371.  
    372. SLOWFOR DUMMY = DUMMY
    373. DO
    374. BEGIN # GET NON ZERO PFC ENTRY #
    375. IF PEO GQ LIMIT OR FIRST
    376. THEN
    377. BEGIN # READ NEXT SECTOR #
    378. RDPFC(MVARG$FM[0],0,PFC$SEC[0],WRDCNT,FLAG);
    379. IF FLAG NQ OK
    380. THEN
    381. BEGIN # PROCESS ERROR STATUS #
    382. IF FLAG EQ 1
    383. THEN # END OF PFC #
    384. BEGIN
    385. RETURN;
    386. END
    387.  
    388. IF FLAG EQ 2
    389. THEN # NO DEVICES IN THE FAMILY #
    390. BEGIN
    391. MVMSG$LN[0] = MSF$NODEV;
    392. MESSAGE(MVMSG[0],UDFL1);
    393. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    394. END
    395.  
    396. IF FLAG EQ 3 OR FLAG EQ 4
    397. THEN # IGNORE BAD SECTOR OR ERROR IDLE
    398.   OR PF UTILITY ACTIVE ON DEVICE #
    399. BEGIN
    400. TEST DUMMY;
    401. END
    402.  
    403. MVMSG$PROC[0] = PROCNAME; # ABNORMAL TERMINATION #
    404. MESSAGE(MVMSG[0],UDFL1);
    405. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    406. END # PROCESS ERROR STATUS #
    407.  
    408. IF FIRST
    409. THEN
    410. BEGIN
    411. FIRST = FALSE;
    412. END
    413.  
    414. P<CNTRWORD> = LOC(PFC$SEC[0]) + WRDCNT;
    415.  
    416. #
    417. * CALCULATE LIMIT ON PFC ENTRY ORDINAL.
    418. #
    419.  
    420. LIMIT = WRDCNT/PFCENTL;
    421. LIMIT = LIMIT - 1;
    422. PEO = -1;
    423. END # READ NEXT SECTOR #
    424.  
    425. #
    426. * SEARCH FOR NON ZERO PFC ENTRY.
    427. #
    428.  
    429. PEO = PEO + 1;
    430. SLOWFOR I = PEO STEP 1 WHILE I LQ LIMIT
    431. DO
    432. BEGIN
    433. PEO = I;
    434. P<PFC> = LOC(PFC$SEC[0]) + PEO*PFCENTL;
    435. IF PFC$UI[0] NQ 0
    436. THEN
    437. BEGIN
    438. RETURN;
    439. END
    440.  
    441. END
    442.  
    443. END # GET NON ZERO PFC ENTRY #
    444.  
    445. END # GETPFC #
    446.  
    447. TERM
    448. PROC MVABDS;
    449. # TITLE MVABDS - PROCESS DESTAGE ABANDONMENT. #
    450.  
    451. BEGIN # MVABDS #
    452.  
    453. #
    454. ** MVABDS - PROCESS DESTAGE ABANDONMENT INFORMATION.
    455. *
    456. * PROC MVABDS.
    457. *
    458. * MESSAGES 1) UNABLE TO ATTACH COMMUNICATION FILE.
    459. * 2) UNABLE TO READ COMMUNICATION FILE.
    460. *
    461. * NOTES PROC *MVABDS* PRODUCES A REPORT PAGE LISTING EACH
    462. * DESTAGE ABANDONMENT CODE, THE REASON FOR ABANDONMENT,
    463. * AND THE NUMBER OF FILES ABANDONED FOR THAT REASON.
    464. * IF *LO=F* IS SPECIFIED EACH ABANDONED FILE AND THE
    465. * CORRESPONDING ABANDONMENT CODE IS LISTED. *MVRPTDS*
    466. * IS CALLED TO REPRODUCE THE DEVICE STATUS REPORT AND
    467. * THE SUBFAMILY REPORT REFLECTING ONLY THE DESTAGES
    468. * WHICH ACTUALLY OCCURRED.
    469. #
    470.  
    471. #
    472. **** PROC MVABDS - XREF LIST BEGIN.
    473. #
    474.  
    475. XREF
    476. BEGIN
    477. PROC BZFILL; # BLANK/ZERO FILL CHARACTER ITEM #
    478. PROC MESSAGE; # ISSUE MESSAGE TO DAYFILE #
    479. PROC MVRPTDS; # REPORT DEVICE STATUS #
    480. PROC PF; # *PFM* REQUEST INTERFACE #
    481. PROC READ; # INITIATE INPUT TO A BUFFER #
    482. PROC READW; # READ DATA TO WORKING BUFFER #
    483. PROC RESTPFP; # RESTORE USER-S FAMILY AND UI. #
    484. PROC RPEJECT; # PAGE EJECTS REPORT FILE #
    485. PROC RPLINE; # WRITE LINE TO REPORT FILE #
    486. PROC RPSPACE; # PUTS BLANK LINE ON REPORT FILE #
    487. PROC ZFILL; # ZERO FILL ARRAY #
    488. PROC ZSETFET; # INITIALIZE A FET #
    489. FUNC XCDD C(10); # CONVERT DECIMAL TO DISPLAY #
    490. FUNC XCOD C(10); # BINARY TO DECIMAL DISPLAY #
    491. END
    492.  
    493. #
    494. **** PROC MVABDS - XREF LIST END.
    495. #
    496.  
    497. DEF MSG1 #" UNABLE TO ATTACH COMMUNICATION FILE."#;
    498. DEF MSG2 #" UNABLE TO READ COMMUNICATION FILE."#;
    499. DEF MSG3 #"NO SPACE"#;
    500. DEF MSG4 #"NO STORAGE MODULE AVAILABLE"#;
    501. DEF MSG5 #"NO CARTRIDGE OR GROUP AVAILABLE"#;
    502. DEF MSG6 #"FILE ALREADY DESTAGED"#;
    503. DEF MSG7 #"FILE BUSY / PFM PROBLEM"#;
    504. DEF MSG8 #"CATALOG ACCESS ERROR"#;
    505. DEF MSG9 #"OVERFLOW NOT LEGAL"#;
    506. DEF MSG10 #"GROUP FULL"#;
    507. DEF MSG11 #"DISK READ ERROR"#;
    508. DEF MSG12 #"CARTRIDGE LOST"#;
    509. DEF MS613 #"CLOSED DESTAGE"#;
    510. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    511. *CALL COMBFAS
    512. *CALL COMBBZF
    513. *CALL COMBFET
    514. *CALL COMBTDM
    515. *CALL COMTMOV
    516. *CALL COMTOUT
    517. *CALL COMXMFD
    518.  
    519. ITEM ABR S:ABANDON; # ABANDONMENT CODE #
    520. ITEM ABNDN B=TRUE; # PRODUCE ABANDONMENT REPORT #
    521. ITEM IX I; # FILE TYPE INDEX #
    522. ITEM J I; # FET ADDRESS #
    523. ITEM STAT I; # STATUS #
    524. ITEM SUBFAM I; # SUBFAMILY INDEX #
    525. ITEM TMPC C(10); # TEMPORARY CHARACTER #
    526.  
    527. ARRAY ABNDNF [1:11] S(1);
    528. BEGIN
    529. ITEM ABND$NF I(00,00,60); # FILE COUNT #
    530. END
    531.  
    532. CONTROL EJECT;
    533.  
    534. #
    535. * ATTACH COMMUNICATION FILE.
    536. #
    537.  
    538. COMNAME = MVOCOM;
    539. BZFILL(COMNAME,TYPFILL"ZFILL",7);
    540.  
    541. PF("ATTACH",COMNAME,0,"M","W","RC",STAT,"NA",0,0);
    542.  
    543. IF STAT NQ OK
    544. THEN
    545. BEGIN
    546. MVMSG$LN[0] = MSG1;
    547. MESSAGE(MVMSG[0],UDFL1);
    548. RESTPFP(PFP$ABORT);
    549. END
    550.  
    551. #
    552. * DETERMINE WHETHER TO LIST EACH FILE.
    553. #
    554.  
    555. IF LO$F[0] OR LO$P[0]
    556. THEN
    557. BEGIN
    558. LISTFETP = OUT$FETP;
    559. END
    560.  
    561. #
    562. * CLEAR DESTAGE INFORMATION FROM SUBFAMILY STATUS ARRAY.
    563. #
    564.  
    565. SLOWFOR IX = IXDA STEP 1 UNTIL IXIA
    566. DO
    567. BEGIN
    568. SLOWFOR SUBFAM = 0 STEP 1 UNTIL MAXSF
    569. DO
    570. BEGIN
    571. SFDS$NF[IX,SUBFAM] = 0;
    572. SFDS$PRU[IX,SUBFAM] = 0;
    573. END
    574.  
    575. END
    576.  
    577. #
    578. * READ PREAMBLE OF COMMUNICATION FILE.
    579. #
    580.  
    581. J = LOC(MCF$FET[0]);
    582. ZSETFET(J,COMNAME,LOC(MCF$BUF[0]),MCFBUFL,SFETL);
    583. FET$EP[0] = TRUE;
    584.  
    585. READ(MCF$FET[0],NRCL);
    586. READW(MCF$FET[0],MCF$PRM[0],MVPRML,STAT);
    587.  
    588. IF STAT NQ OK
    589. THEN
    590. BEGIN
    591. MVMSG$LN[0] = MSG2;
    592. MESSAGE(MVMSG[0],UDFL1);
    593. RESTPFP(PFP$ABORT);
    594. END
    595.  
    596. CONTROL EJECT;
    597.  
    598. #
    599. * WRITE HEADER TO REPORT FILE.
    600. #
    601.  
    602. RPEJECT(OUT$FETP);
    603. RPLINE(OUT$FETP,"DESTAGE ABANDONMENT REPORT",5,26,0);
    604. RPSPACE(OUT$FETP,SP"SPACE",1);
    605. RPLINE(LISTFETP,"FILENAME UI CODE",9,30,0);
    606. RPSPACE(LISTFETP,SP"SPACE",1);
    607.  
    608. #
    609. * PROCESS EACH *TDAM* ENTRY.
    610. #
    611.  
    612. REPEAT WHILE STAT EQ 0
    613. DO
    614. BEGIN # PROCESS EACH *TDAM* #
    615.  
    616. READW(MCF$FET[0],MCF$REQ[0],TDAMLEN,STAT);
    617.  
    618. IF STAT EQ CIOERR
    619. THEN
    620. BEGIN
    621. MVMSG$LN[0] = MSG2;
    622. MESSAGE(MVMSG[0],UDFL1);
    623. RESTPFP(PFP$ABORT);
    624. END
    625.  
    626. IF STAT NQ OK
    627. THEN
    628. BEGIN
    629. TEST DUMMY;
    630. END
    631.  
    632. P<TDAM> = LOC(MCF$REQ[0]);
    633. DNX = DN$TO$DNX[TDAMDN[0]];
    634. SFX = TDAMSBF[0];
    635.  
    636. #
    637. * CHECK FOR VALID ABANDONMENT CODE.
    638. #
    639.  
    640. IF TDAMABR[0] LQ ABANDON"OK" ##
    641. OR TDAMABR[0] GQ ABANDON"ENDAB"
    642. THEN # INVALID ABANDON CODE #
    643. BEGIN
    644. TEST DUMMY;
    645. END
    646.  
    647. #
    648. * DETERMINE FILE TYPE.
    649. #
    650.  
    651. IF TDAMIA[0]
    652. THEN
    653. BEGIN
    654. FTYPE = IXIA;
    655. END
    656.  
    657. ELSE
    658. BEGIN
    659. FTYPE = IXDA;
    660. END
    661.  
    662. #
    663. * UPDATE COUNTS FOR *MVRPTDS* REPORT.
    664. #
    665.  
    666. IF TDAMFC[0] EQ TDAMFCODE"DESTRLS"
    667. THEN # FILE WAS NOT RELEASED #
    668. BEGIN
    669. DEV$RELF[FTYPE,DNX] = DEV$RELF[FTYPE,DNX] - 1;
    670. DEV$TRPRU[FTYPE,DNX] = DEV$TRPRU[FTYPE,DNX] + TDAMFLN[0];
    671. IF FTYPE EQ IXIA
    672. THEN
    673. BEGIN
    674. DEV$RELP[FTYPE,DNX] = DEV$RELP[FTYPE,DNX] - TDAMFLN[0];
    675. END
    676.  
    677. ELSE
    678. BEGIN
    679. PRUTRK = DEV$SECTR[IXDA,DNX];
    680. TRUPRU = (((TDAMFLN[0]+1) / PRUTRK) + 1) * PRUTRK;
    681. DEV$RELP[FTYPE,DNX] = DEV$RELP[FTYPE,DNX] - TRUPRU;
    682. END
    683.  
    684. END
    685.  
    686. SFDS$NF[FTYPE,SFX] = SFDS$NF[FTYPE,SFX] + 1;
    687. SFDS$PRU[FTYPE,SFX] = SFDS$PRU[FTYPE,SFX] + TDAMFLN[0];
    688. SFRL$NF[FTYPE,SFX] = SFRL$NF[FTYPE,SFX] - 1;
    689. SFRL$PRU[FTYPE,SFX] = SFRL$PRU[FTYPE,SFX] - TDAMFLN[0];
    690. SFDM$NF[FTYPE,SFX] = SFDM$NF[FTYPE,SFX] - 1;
    691. SFDM$PRU[FTYPE,SFX] = SFDM$PRU[FTYPE,SFX] - TDAMFLN[0];
    692.  
    693. #
    694. * INCREMENT FILE COUNT.
    695. #
    696.  
    697. ABR = TDAMABR[0];
    698. ABND$NF[ABR] = ABND$NF[ABR] + 1;
    699.  
    700. #
    701. * WRITE EACH FILE TO REPORT FILE.
    702. #
    703.  
    704. TMPC = TDAMPFN[0];
    705. BZFILL(TMPC,TYPFILL"BFILL",7);
    706. RPLINE(LISTFETP,TMPC,10,7,1);
    707. TMPC = XCOD(TDAMUI[0]);
    708. RPLINE(LISTFETP,TMPC,20,10,1);
    709. CHR$10[0] = XCDD(TDAMABR[0]);
    710. RPLINE(LISTFETP,CHR$R2[0],37,2,0);
    711.  
    712. END # PROCESS EACH *TDAM* #
    713.  
    714. #
    715. * LIST CODE, NUMBER OF FILES, AND EXPLANATION.
    716. #
    717.  
    718. RPSPACE(OUT$FETP,SP"SPACE",2);
    719. RPLINE(OUT$FETP,"CODE FILES REASON",9,29,0);
    720. RPSPACE(OUT$FETP,SP"SPACE",1);
    721.  
    722. ABR = ABANDON"NOSPACE";
    723. CHR$10[0] = XCDD(ABR);
    724. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    725. CHR$10[0] = XCDD(ABND$NF[ABR]);
    726. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    727. RPLINE(OUT$FETP,MSG3,30,8,0);
    728.  
    729. ABR = ABANDON"NOSM";
    730. CHR$10[0] = XCDD(ABR);
    731. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    732. CHR$10[0] = XCDD(ABND$NF[ABR]);
    733. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    734. RPLINE(OUT$FETP,MSG4,30,27,0);
    735.  
    736. ABR = ABANDON"NOCARGP";
    737. CHR$10[0] = XCDD(ABR);
    738. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    739. CHR$10[0] = XCDD(ABND$NF[ABR]);
    740. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    741. RPLINE(OUT$FETP,MSG5,30,31,0);
    742.  
    743. ABR = ABANDON"NEWASA";
    744. CHR$10[0] = XCDD(ABR);
    745. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    746. CHR$10[0] = XCDD(ABND$NF[ABR]);
    747. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    748. RPLINE(OUT$FETP,MSG6,30,21,0);
    749.  
    750. ABR = ABANDON"PFMERR";
    751. CHR$10[0] = XCDD(ABR);
    752. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    753. CHR$10[0] = XCDD(ABND$NF[ABR]);
    754. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    755. RPLINE(OUT$FETP,MSG7,30,23,0);
    756.  
    757. ABR = ABANDON"CATIOERR";
    758. CHR$10[0] = XCDD(ABR);
    759. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    760. CHR$10[0] = XCDD(ABND$NF[ABR]);
    761. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    762. RPLINE(OUT$FETP,MSG8,30,20,0);
    763.  
    764. ABR = ABANDON"NOOVERF";
    765. CHR$10[0] = XCDD(ABR);
    766. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    767. CHR$10[0] = XCDD(ABND$NF[ABR]);
    768. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    769. RPLINE(OUT$FETP,MSG9,30,18,0);
    770.  
    771. ABR = ABANDON"GRFULL";
    772. CHR$10[0] = XCDD(ABR);
    773. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    774. CHR$10[0] = XCDD(ABND$NF[ABR]);
    775. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    776. RPLINE(OUT$FETP,MSG10,30,10,0);
    777.  
    778. ABR = ABANDON"DSKRDERR";
    779. CHR$10[0] = XCDD(ABR);
    780. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    781. CHR$10[0] = XCDD(ABND$NF[ABR]);
    782. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    783. RPLINE(OUT$FETP,MSG11,30,15,0);
    784.  
    785. ABR = ABANDON"LOST";
    786. CHR$10[0] = XCDD(ABR);
    787. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    788. CHR$10[0] = XCDD(ABND$NF[ABR]);
    789. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    790. RPLINE(OUT$FETP,MSG12,30,14,0);
    791.  
    792. ABR = ABANDON"CLOSEDS";
    793. CHR$10[0] = XCDD(ABR);
    794. RPLINE(OUT$FETP,CHR$R2[0],11,2,1);
    795. CHR$10[0] = XCDD(ABND$NF[ABR]);
    796. RPLINE(OUT$FETP,CHR$R8[0],17,8,1);
    797. RPLINE(OUT$FETP,MS613,30,14,0);
    798.  
    799. #
    800. * GENERATE AN UPDATED *DEVICE REPORT* AND *SUBFAMILY REPORT*.
    801. #
    802.  
    803. MVRPTDS(ABNDN);
    804.  
    805.  
    806. END # MVABDS #
    807.  
    808. TERM
    809. PROC MVALCS(CS,VCS,NBS,KEY,FLAG);
    810. # TITLE MVALCS - ANALYZES CHARACTER STRING. #
    811.  
    812. BEGIN # MVALCS #
    813.  
    814. #
    815. ** MVALCS - ANALYZES CHARACTER STRING.
    816. *
    817. * THIS PROCEDURE ANALYZES AN INPUT CHARACTER STRING (CS)
    818. * TO VERIFY THAT EACH CHARACTER IS IN THE STRING
    819. * SPECIFIED BY *VCS*. EACH VALID CHARACTER RESULTS IN THE
    820. * CORRESPONDING BIT IN *NBS* BEING SET TO 1 (TRUE). THESE BITS
    821. * IN *NBS* MAY THEN BE TESTED AS BOOLEAN ITEMS TO DETERMINE
    822. * IF THE ASSOCIATED CHARACTER WAS SUPPLIED OR NOT.
    823. *
    824. * PROC MVALCS(CS,VCS,NBS,KEY,FLAG).
    825. *
    826. #
    827.  
    828. ITEM CS C(10); # INPUT CHARACTER STRING #
    829. ITEM VCS C(10); # VALID CHARACTERS #
    830. ITEM NBS I; # OUTPUT BIT STRING #
    831. ITEM KEY C(2); # OPTION BEING TESTED #
    832. ITEM FLAG I; # NON-ZERO FOR ERRORS #
    833.  
    834.  
    835. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    836.  
    837. *CALL,COMBFAS
    838. *CALL COMBSIT
    839.  
    840.  
    841. ITEM C C(1); # CHARACTER BEING ANALYZED #
    842. ITEM I I; # LOOP INDEX #
    843. ITEM J I; # LOOP INDEX #
    844.  
    845. CONTROL EJECT;
    846.  
    847. NBS = 0;
    848. FLAG = 0;
    849. SLOWFOR I = 0 STEP 1 UNTIL 9
    850. DO
    851. BEGIN # CS LOOP #
    852. C = C<I,1>CS;
    853. IF C EQ " " OR C EQ 0
    854. THEN
    855. RETURN;
    856. SLOWFOR J = 0 STEP 1 UNTIL 9
    857. DO
    858. BEGIN # SEARCH FOR MATCH #
    859. IF C<J,1>VCS EQ C
    860. THEN
    861. BEGIN
    862. B<J,1>NBS = 1;
    863. TEST I;
    864. END
    865.  
    866. END # SEARCH FOR MATCH #
    867.  
    868. FLAG = I+1;
    869. RETURN;
    870. END # CS LOOP #
    871.  
    872. END # MVALCS #
    873.  
    874. TERM
    875. PROC MVCALL((REQTYPE),(REQCODE),RESPCODE);
    876. # TITLE MVCALL - ISSUES TYPE 1 OR 2 UCP REQUEST TO EXEC. #
    877.  
    878. BEGIN # MVCALL #
    879.  
    880. #
    881. ** MVCALL - ISSUES A TYPE 1 OR 2 UCP REQUEST TO EXEC.
    882. *
    883. * PROC MVCALL((REQTYPE),(REQCODE),RESPCODE).
    884. *
    885. * ENTRY. (REQTYPE) = REQUEST TYPE.
    886. * (REQCODE) = REQUEST CODE.
    887. * (MVARG$FM) = FAMILY NAME.
    888. * (REQID$MV) = REQUESTOR ID.
    889. * (SSID$MV) = SUBSYSTEM ID.
    890. * P<CPR> = FWA OF CALLSS PARAMETER BLOCK.
    891. *
    892. * EXIT. (RESPCODE) = RESPONSE FROM EXEC.
    893. *
    894. * MESSAGES. SSMOVE ABNORMAL, MVCALL.
    895. *
    896. * NOTES. THE CALLSS PARAMETER REQUEST BLOCK IS SET
    897. * UP FOR A TYPE 1 OR TYPE 2 UCP REQUEST AND
    898. * THE REQUEST IS ISSUED TO EXEC.
    899. #
    900.  
    901. ITEM REQTYPE I; # REQUEST TYPE #
    902. ITEM REQCODE I; # REQUEST CODE #
    903. ITEM RESPCODE I; # RESPONSE FROM EXEC #
    904.  
    905. #
    906. **** PROC MVCALL - XREF LIST BEGIN.
    907. #
    908.  
    909. XREF
    910. BEGIN
    911. PROC ABORT; # STOPS PROCESSING #
    912. PROC CALLSS; # ISSUES A UCP/SCP REQUEST #
    913. PROC MESSAGE; # DISPLAYS MESSAGE IN DAYFILE #
    914. PROC RESTPFP; # RESTORE USER-S *PFP* AND ABORT
    915.   OR RETURN #
    916. END
    917.  
    918. #
    919. **** PROC MVCALL - XREF LIST END.
    920. #
    921.  
    922. DEF PROCNAME #"MVCALL."#; # PROC NAME #
    923. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    924. *CALL,COMBFAS
    925. *CALL,COMBCPR
    926. *CALL,COMTMOV
    927. *CALL,COMTMVP
    928.  
    929. ITEM I I; # LOOP INDUCTION VARIABLE #
    930.  
    931. CONTROL EJECT;
    932.  
    933. #
    934. * ZERO FILL CALLSS PARAMETER BLOCK.
    935. #
    936.  
    937. FASTFOR I = 0 STEP 1 UNTIL CPRLEN-1
    938. DO
    939. BEGIN
    940. CPR1[I] = 0;
    941. END
    942.  
    943. CPR$RQT[0] = REQTYPE; # SET UP PARAMETER BLOCK #
    944. CPR$RQC[0] = REQCODE;
    945. CPR$RQI[0] = REQID$MV;
    946. CPR$SSPFLG[0] = TRUE;
    947. CPR$FAM[0] = MVARG$FM[0];
    948.  
    949. IF REQTYPE EQ TYP"TYP1"
    950. THEN # TYPE 1 REQUEST #
    951. BEGIN
    952. CPR$WC[0] = TYP1$WC;
    953. END
    954.  
    955. ELSE
    956. BEGIN # TYPE 2 OR ILLEGAL REQUEST #
    957. IF REQTYPE EQ TYP"TYP2"
    958. THEN # TYPE 2 REQUEST #
    959. BEGIN
    960. CPR$WC[0] = TYP2$WC;
    961. CPR$NW[0] = MVARG$NW[0];
    962. END
    963.  
    964. ELSE # ILLEGAL REQUEST TYPE #
    965. BEGIN
    966. MVMSG$PROC[0] = PROCNAME;
    967. MESSAGE(MVMSG[0],SYSUDF1);
    968. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    969. END
    970.  
    971. END # TYPE 2 OR ILLEGAL REQUEST #
    972.  
    973. CALLSS(SSID$MV,CPR[0],RCL);
    974. IF REQTYPE EQ TYP"TYP2"
    975. THEN
    976. BEGIN
    977. RESPCODE = CPR$RQR[0]; # RETURN RESPONSE FROM EXEC #
    978. END
    979.  
    980. ELSE
    981. BEGIN
    982. RESPCODE = CPR$ES[0]; # RETURN RESPONSE FROM SYSTEM #
    983. END
    984.  
    985. RETURN;
    986.  
    987. END # MVCALL #
    988.  
    989. TERM
    990. PROC MVCKSF((FN),(UI),PO);
    991. # TITLE MVCKSF - CHECK IF SPECIAL FILE. #
    992.  
    993. BEGIN # MVCKSF #
    994.  
    995. #
    996. ** MVCKSF - CHECK IF SPECIAL FILE.
    997. *
    998. * THIS PROCEDURE DETERMINES WHETHER THE FILE SPECIFIED BY
    999. * THE *FN* AND *UI* PARAMETERS WAS SPECIFIED VIA THE
    1000. * *SF,FN=...* DIRECTIVE.
    1001. *
    1002. * PROC MVCKSF( (FN), (UI), PO).
    1003. *
    1004. * ENTRY. (FN) = NAME OF A PERMANENT FILE
    1005. * (UI) = USER INDEX OF THIS FILE
    1006. *
    1007. * EXIT. (PO) = 0, IF THE FILE WAS NOT SPECIFIED BY A
    1008. * *SF,FN=...* DIRECTIVE.
    1009. * = Q, IF IT WAS SPECIFIED BY THE DIRECTIVE
    1010. * *SF,FN,...PO=Q.*.
    1011. #
    1012.  
    1013. ITEM FN C(7); # FILE NAME #
    1014. ITEM UI I; # USER INDEX #
    1015. ITEM PO C(1); # PROCESSING OPTION #
    1016.  
    1017. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    1018. *CALL,COMBFAS
    1019. *CALL,COMTMOV
    1020.  
    1021. ITEM I I; # LOOP INDEX #
    1022.  
    1023. ARRAY CKSFILES [0:0] S(3); # CHECK FOR SPECIAL FILES #
    1024. BEGIN
    1025. ITEM CK$WRD1 U(00,00,60); # WORD 1 #
    1026. ITEM CK$FN C(00,00,07); # FILE NAME #
    1027. ITEM CK$WRD2 U(01,00,60); # WORD 2 #
    1028. ITEM CK$FNC C(01,00,07); # SELECTED FILE NAME #
    1029. ITEM CK$WRD3 U(02,00,60); # WORD 3 #
    1030. ITEM CK$MASK U(02,00,42); # MASK FOR FILE NAME #
    1031. END
    1032.  
    1033. CONTROL EJECT;
    1034. PO = 0;
    1035.  
    1036. SLOWFOR I = 1 STEP 1 UNTIL IDXFN
    1037. DO
    1038. BEGIN # SEARCH FOR FILE MATCH #
    1039. IF UI LS SF$UI[I]
    1040. THEN # NO MATCH #
    1041. BEGIN
    1042. RETURN;
    1043. END
    1044.  
    1045. IF UI GR SF$UI[I]
    1046. THEN
    1047. BEGIN
    1048. TEST I;
    1049. END
    1050.  
    1051. CK$FN[0] = FN;
    1052. CK$FNC[0] = SF$FNC[I];
    1053. CK$MASK[0] = SF$MASK[I];
    1054. IF ( (CK$FN[0] LXR CK$FNC[0]) # COMPARE FILE NAMES #
    1055. LAN CK$WRD3[0] ) # EXCLUDE WILD-CARD CHARACTERS #
    1056. EQ 0
    1057. THEN # FOUND A MATCH #
    1058. BEGIN
    1059. PO = SF$PO[I];
    1060. RETURN;
    1061. END
    1062.  
    1063. END # SEARCH FOR FILE MATCH #
    1064.  
    1065. END # MVCKSF #
    1066.  
    1067. TERM
    1068. PROC MVDIR;
    1069. # TITLE MVDIR - PROCESS DIRECTIVES . #
    1070.  
    1071. BEGIN # MVDIR #
    1072.  
    1073. #
    1074. ** THIS PROCEDURE PROCESSES THE DIRECTIVES.
    1075. *
    1076. * PROC MVDIR.
    1077. *
    1078. * MESSAGES. DIRECTIVE ERROR - REPORT ONLY.
    1079. *
    1080. * NOTES. THIS PROCEDURE READS EACH DIRECTIVE AND CHECKS
    1081. * THAT IT IS VALID. IF IT IS NOT A VALID DIRECTIVE
    1082. * A MESSAGE IS ISSUED TO THE DAYFILE AND THE REPORT
    1083. * FILE. *SSMOVE* THEN CONTINUES IN REPORT ONLY
    1084. * MODE. FOR THE *FR*,*WM*,*WA*,*PR*,*BR*,
    1085. * AND *SM* DIRECTIVES THE DEFAULT VALUES ARE REPLACED
    1086. * WITH THE SPECIFIED VALUES. THE DIRECTIVES AND
    1087. * RUN-TIME PARAMETER VALUES ARE WRITTEN TO THE REPORT
    1088. * FILE.
    1089. #
    1090.  
    1091. #
    1092. **** PROC MVDIR - XREF LIST BEGIN.
    1093. #
    1094.  
    1095. XREF
    1096. BEGIN
    1097. PROC BZFILL; # BLANK/ZERO FILL CHARACTER ITEM #
    1098. PROC MESSAGE; # DISPLAYS A MESSAGE IN DAYFILE #
    1099. PROC READ; # INITIATE INPUT TO A BUFFER #
    1100. PROC READC; # COPY LINE TO WORKING BUFFER #
    1101. PROC RPEJECT; # PAGE EJECT #
    1102. PROC RPLINE; # WRITE LINE TO REPORT FILE #
    1103. PROC RPSPACE; # WRITE BLANK LINE TO REPORT FILE
    1104.   #
    1105. PROC XARG; # DECODE PARAMETERS PER *ARG*
    1106.   TABLE #
    1107. PROC ZFILL; # ZERO OUT AN ARRAY #
    1108. PROC ZSETFET; # INITIALIZE A FET #
    1109. FUNC XCDD C(10); # CONVERT BINARY TO DECIMAL #
    1110. FUNC XDXB I; # CONVERT DISPLAY TO BINARY #
    1111. END
    1112.  
    1113. #
    1114. **** PROC MVDIR - XREF LIST END.
    1115. #
    1116.  
    1117. DEF MSK77 #O"77"#; # MASK #
    1118. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    1119.  
    1120. CONTROL PRESET;
    1121. *CALL,COMBFAS
    1122. *CALL COMBSIT
    1123. *CALL,COMBBZF
    1124. *CALL,COMSPFM
    1125. *CALL,COMTMOV
    1126. *CALL,COMTMVD
    1127. *CALL,COMTMVP
    1128. *CALL,COMTOUT
    1129.  
    1130. ITEM ARGLIST I; # ARGUMENT LIST ADDRESS #
    1131. ITEM COL I; # COLUMN NUMBER #
    1132. ITEM DIRLINE C(90); # DIRECTIVE TEXT LINE #
    1133. ITEM DIRNUM I; # DIRECTIVE NUMBER #
    1134. ITEM EOR B; # END-OF-RECORD FLAG #
    1135. ITEM FATALERR B; # FATAL ERROR, IF TRUE #
    1136. ITEM FOUND B; # LOOP EXIT CONTROL #
    1137. ITEM I I; # LOOP INDEX #
    1138. ITEM J I; # LOOP INDEX #
    1139. ITEM K I; # LOOP INDEX #
    1140. ITEM KEY C(2); # DIRECTIVE KEYWORD #
    1141. ITEM KEYOK B; # CONTROL VARIABLE #
    1142. ITEM L I; # LOOP INDEX #
    1143. ITEM LFN C(7); # FILE NAME #
    1144. ITEM MASK I; # MASK FOR SPECIAL FILE NAMES #
    1145. ITEM MAXARG I; # MAXIMUM NUMBER OF ARGUMENTS #
    1146. ITEM STAT I; # STATUS OF PROCEDURE CALL #
    1147. ITEM TMPI I; # TEMPORARY INTEGER #
    1148.  
    1149.  
    1150. ARRAY SFDEF [1:SFMX] S(1);
    1151. BEGIN
    1152. ITEM SFD$I I(00,00,60); # DEFAULT VALUES FOR *SF*
    1153.   DIRECTIVE #
    1154. END
    1155.  
    1156. BASED
    1157. ARRAY PARM [1:2,1:2,1:1] S(1);
    1158. BEGIN
    1159. ITEM PARM$V U(00,00,60); # PARAMETER VALUE #
    1160. END
    1161.  
    1162. BASED
    1163. ARRAY XXARG[1:1] S(1);
    1164. BEGIN
    1165. ITEM XX$KEY C(00,00,02); # PARAMETER KEY #
    1166. ITEM XX$C2 C(00,06,01); # SECOND CHARACTER OF KEY #
    1167. END
    1168.  
    1169. BASED
    1170. ARRAY SFPARM [1:1] S(1);
    1171. BEGIN
    1172. ITEM SF$C C(00,00,10); # *SF* PARAMETER (CHARACTER) #
    1173. ITEM SF$I I(00,00,60); # *SF* PARAMETER (INTEGER) #
    1174. END
    1175.  
    1176. ARRAY SFTMP [0:0] S(1);
    1177. BEGIN
    1178. ITEM SFT$VAL U(00,00,60); # ENTIRE WORD #
    1179. ITEM SFT$UI U(00,00,18); # USER INDEX #
    1180. ITEM SFT$FNC C(00,18,07); # FILE NAME #
    1181. ITEM SFT$FNI I(00,18,42); # FILE NAME #
    1182. END
    1183.  
    1184. BASED
    1185. ARRAY ZR [0:0];; # ARRAY TO BE ZEROED #
    1186.  
    1187.  
    1188. ITEM ADDR U; # PARAMETER LIST ADDRESS #
    1189.  
    1190.  
    1191. ARRAY LU [1:2] P(2);
    1192. BEGIN
    1193. ITEM LL I(00,00,60); # LOWER LIMIT #
    1194. ITEM UL I(01,00,60); # UPPER LIMIT #
    1195. END
    1196.  
    1197. BASED
    1198. ARRAY TQ[1:1] S(1);
    1199. BEGIN
    1200. ITEM TQ$VAL I(00,00,60); # DIRECTIVE PARAMETERS #
    1201. END
    1202.  
    1203. BASED
    1204. ARRAY KWTEXT[1:1] S(2);
    1205. BEGIN
    1206. ITEM KW$TEXT C(00,00,20); # TEXT FOR DIRECTIVE KEYWORD #
    1207. END
    1208.  
    1209.  
    1210.  
    1211. CONTROL EJECT;
    1212. P<TQ> = ARG$TAB[0];
    1213.  
    1214. #
    1215. * INITIALIZE TO READ THE DIRECTIVE FILE.
    1216. #
    1217.  
    1218. IF MVARG$I[0] NQ 0
    1219. THEN
    1220. BEGIN
    1221. IDXFN = 0;
    1222. LFN = MVARG$I[0];
    1223. FETP = LOC(MV$FET[FILEMI]);
    1224. BUFP = LOC(MV$BUF[FILEMI]);
    1225. ZSETFET(FETP,LFN,BUFP,MVBUFL,SFETL);
    1226. READ(MV$FET[FILEMI],NRCL);
    1227. EOR = FALSE;
    1228. END
    1229.  
    1230. ELSE # NO DIRECTIVE FILE #
    1231. BEGIN
    1232. EOR = TRUE;
    1233. END
    1234.  
    1235. #
    1236. * READ AND PROCESS EACH DIRECTIVE. ISSUE A NON-FATAL
    1237. * ERROR MESSAGE FOR ANY DIRECTIVE ERRORS.
    1238. #
    1239.  
    1240. FOR DIRNUM = 1 STEP 1 WHILE NOT EOR
    1241. DO
    1242. BEGIN # PROCESS NEXT DIRECTIVE #
    1243. DIRLINE = " "; # ERASE PREVIOUS DIRECTIVE #
    1244. READC(MV$FET[FILEMI],DIRLINE,9,STAT);
    1245. BZFILL(DIRLINE,TYPFILL"BFILL",90);
    1246. C<89,1>DIRLINE = "."; # FORCE DIRECTIVE TERMINATOR #
    1247. IF STAT NQ 0
    1248. THEN
    1249. BEGIN
    1250. EOR = TRUE;
    1251. TEST DIRNUM;
    1252. END
    1253.  
    1254. CHR$10[0] = XCDD(DIRNUM);
    1255. RPLINE(OUT$FETP,CHR$R3[0],3,3,1); # PRINT DIRECTIVE NUMBER #
    1256. RPLINE(OUT$FETP,DIRLINE,8,80,0); # PRINT DIRECTIVE #
    1257.  
    1258. IF C<0,1>DIRLINE EQ "*"
    1259. THEN # FOUND COMMENT #
    1260. BEGIN
    1261. TEST DIRNUM;
    1262. END
    1263.  
    1264.  
    1265. #
    1266. * VERIFY DIRECTIVE KEYWORD IS OK.
    1267. * LOCATE *ARGLIST* FOR THIS DIRECTIVE.
    1268. #
    1269.  
    1270. KEY = C<0,2>DIRLINE;
    1271. KEYOK = FALSE;
    1272. FOR I = 1 STEP 1 WHILE (NOT KEYOK) AND (I LQ NUMDIR)
    1273. DO
    1274. BEGIN
    1275. IF ARG$KEY[I] NQ KEY
    1276. THEN
    1277. BEGIN
    1278. TEST I;
    1279. END
    1280.  
    1281. KEYOK = TRUE;
    1282. MAXARG = ARG$MX[I];
    1283. ADDR = ARG$VAL[I];
    1284. ARGLIST = ARG$TAB[I];
    1285. END
    1286.  
    1287. #
    1288. * IF A DIRECTIVE ERROR OR DIRECTIVE PARAMETER ERROR EXISTS
    1289. * IGNORE THIS DIRECTIVE.
    1290. #
    1291.  
    1292. IF NOT KEYOK
    1293. THEN # DIRECTIVE ERROR #
    1294. BEGIN
    1295. RPLINE(OUT$FETP,"** UNRECOGNIZED DIRECTIVE - IGNORED.",8,36
    1296. ,0);
    1297. RPSPACE(OUT$FETP,SP"SPACE",1);
    1298. FATALERR = TRUE;
    1299. TEST DIRNUM;
    1300. END
    1301.  
    1302. #
    1303. * CRACK PARAMETERS FOR THE DIRECTIVE AND SAVE THEM APPROPRIATELY.
    1304. #
    1305.  
    1306. P<ZR> = ARG$TAB[0];
    1307. ZFILL(ZR[0],ARG$MX[0]);
    1308. XARG(ARGLIST,DIRLINE,STAT);
    1309. IF STAT NQ 0
    1310. THEN # DIRECTIVE PARAMETER ERROR #
    1311. BEGIN
    1312. RPLINE(OUT$FETP,"PARAM ERROR - DIRECTIVE IGNORED",12,31,0);
    1313. RPSPACE(OUT$FETP,SP"SPACE",1);
    1314. FATALERR = TRUE;
    1315. TEST DIRNUM;
    1316. END
    1317.  
    1318. CONTROL EJECT;
    1319.  
    1320. #
    1321. ** PROCESS THE *PR*, *BR*, *FR*, *WA*, *WM*, *SM* DIRECTIVES
    1322. * BY REPLACING DEFAULT VALUES WITH SPECIFIED VALUES.
    1323. #
    1324.  
    1325. IF KEY NQ "SF"
    1326. THEN
    1327. BEGIN
    1328. FOR I = 1 STEP 1 UNTIL 2
    1329. DO
    1330. BEGIN # ESTABLISH LIMITS PER *TQ* #
    1331. LL[I] = 1;
    1332. UL[I] = 2;
    1333. IF TQ$VAL[2*I-1] NQ TQ$VAL[2*I]
    1334. THEN
    1335. BEGIN # NOT 1,2 #
    1336. IF TQ$VAL[2*I-1] NQ 0
    1337. THEN
    1338. BEGIN
    1339. LL[I] = 2;
    1340. END
    1341.  
    1342. ELSE
    1343. BEGIN
    1344. UL[I] = 1;
    1345. END
    1346.  
    1347. END # NOT 1,2 #
    1348.  
    1349. END # ESTABLISH LIMITS PER *TQ* #
    1350.  
    1351. STAT = 0;
    1352. P<PARM> = ADDR;
    1353. FOR I = 1 STEP 1 UNTIL MAXARG
    1354. DO
    1355. BEGIN
    1356. IF TQ$VAL[I+5] EQ 0
    1357. THEN
    1358. BEGIN
    1359. TEST I;
    1360. END
    1361.  
    1362. STAT = XDXB(TQ$VAL[I+5],1,TMPI);
    1363. IF STAT NQ 0
    1364. THEN
    1365. BEGIN
    1366. RPLINE(OUT$FETP,"INCORRECT VALUE - DIRECTIVE IGNORED."
    1367. ,8,35,0);
    1368. FATALERR = TRUE;
    1369. TEST I;
    1370. END
    1371.  
    1372. FOR J = LL[1] STEP 1 UNTIL UL[1]
    1373. DO
    1374. BEGIN # J #
    1375. FOR K = LL[2] STEP 1 UNTIL UL[2]
    1376. DO
    1377. BEGIN # K #
    1378. PARM$V[J,K,I] = TMPI;
    1379. END
    1380.  
    1381. END # J #
    1382.  
    1383. END # I #
    1384.  
    1385. TEST DIRNUM;
    1386. END
    1387.  
    1388. #
    1389. ** PROCESS THE *SF* DIRECTIVE WITHOUT THE *FN* PARAMETER
    1390. * BY SAVING THE OTHER PARAMETERS AS DEFAULTS FOR USE WHEN
    1391. * THE *FN* PARAMETER IS PROVIDED.
    1392. #
    1393.  
    1394. P<SFPARM> = ARG$VAL[0];
    1395. IF SF$I[SFFN] EQ 0
    1396. THEN
    1397. BEGIN # ESTABLISH *SF* DEFAULTS #
    1398. FOR I = 1 STEP 1 UNTIL SFMX
    1399. DO
    1400. BEGIN
    1401. IF SF$I[I] NQ 0
    1402. THEN
    1403. BEGIN
    1404. SFD$I[I] = SF$I[I];
    1405. END
    1406.  
    1407. END
    1408.  
    1409. TEST DIRNUM;
    1410. END # ESTABLISH *SF* DEFAULTS #
    1411.  
    1412. #
    1413. ** PROCESS THE *SF* DIRECTIVE HAVING THE *FN* PARAMETER AS FOLLOWS..
    1414. * 1) SUBSTITUTE THE DEFAULT PARAMETERS FOR ANY MISSING
    1415. * PARAMETER. DECLARE AN ERROR IF EITHER THE *UI* OR
    1416. * *PO* PARAMETER IS MISSING.
    1417. *
    1418. * 2) IGNORE DIRECTIVE IF THE *UI* OR *PO* PARAMETER IS INVALID.
    1419. *
    1420. * 3) SAVE THE *FN*, *UI*, *PO* VALUES AND THE FILE MASK IN THE
    1421. * ARRAY OF SELECTED FILES.
    1422. #
    1423.  
    1424. KEYOK = TRUE;
    1425. FOR I = SFUI STEP 1 UNTIL SFPO
    1426. DO
    1427. BEGIN # STEP 1 #
    1428. IF SF$I[I] EQ 0
    1429. THEN
    1430. BEGIN
    1431. SF$I[I] = SFD$I[I];
    1432. END
    1433.  
    1434. IF SF$I[I] EQ 0
    1435. THEN
    1436. BEGIN
    1437. KEYOK = FALSE;
    1438. END
    1439.  
    1440. END # STEP 1 #
    1441.  
    1442. STAT = XDXB(SF$C[SFUI],0,TMPI);
    1443. KEYOK = KEYOK AND (STAT EQ 0) AND ##
    1444. (TMPI GR 0) AND (TMPI LQ SYS$UI);
    1445. SFT$UI[0] = TMPI;
    1446. KEY = C<0,1>SF$C[SFPO];
    1447. IF KEY NQ "A" AND KEY NQ "B" AND KEY NQ "S" ##
    1448. AND KEY NQ "F" AND KEY NQ "X"
    1449. THEN
    1450. BEGIN
    1451. KEYOK = FALSE;
    1452. END
    1453.  
    1454. IF NOT KEYOK
    1455. THEN
    1456. BEGIN
    1457. RPLINE(OUT$FETP,"*PO* OR *UI* PARAMETER MISSING OR INVALID"
    1458. ,8,41,0);
    1459. FATALERR = TRUE;
    1460. TEST DIRNUM;
    1461. END
    1462.  
    1463. IF IDXFN EQ MXSPF
    1464. THEN
    1465. BEGIN
    1466. RPLINE(OUT$FETP,"TOO MANY FILES SPECIFIED - EXCESS IGNORED."
    1467. ,8,42,0);
    1468. RPSPACE(OUT$FETP,SP"SPACE",1);
    1469. END
    1470.  
    1471. IDXFN = IDXFN+1;
    1472. IF IDXFN GR MXSPF
    1473. THEN
    1474. BEGIN
    1475. TEST DIRNUM;
    1476. END
    1477.  
    1478. SFT$FNC[0] = SF$C[SFFN];
    1479. MASK = -1;
    1480. FOR I = 0 STEP 1 UNTIL 6
    1481. DO
    1482. BEGIN # FIND ASTERISKS IN FILE NAME #
    1483. IF C<I,1>SFT$FNC[0] NQ "*"
    1484. THEN
    1485. BEGIN
    1486. TEST I;
    1487. END
    1488.  
    1489. C<I,1>SFT$FNC[0] = MSK77;
    1490. C<I,1>MASK = 0;
    1491. END # FIND ASTERISKS #
    1492.  
    1493. #
    1494. * INSERT THE FILE PARAMETERS AND MASK INTO THE ARRAY
    1495. * SUCH THAT THE USER INDEX AND FILE NAME ARE IN ASCENDING ORDER.
    1496. #
    1497.  
    1498. FOUND = FALSE;
    1499. SLOWFOR I = IDXFN STEP -1 WHILE (NOT FOUND)
    1500. DO
    1501. BEGIN
    1502. IF (SFT$VAL[0] LS SF$W1[I-1]) AND (I GR 1)
    1503. THEN
    1504. BEGIN
    1505. SF$W1[I] = SF$W1[I-1];
    1506. SF$W2[I] = SF$W2[I-1];
    1507. TEST I;
    1508. END
    1509.  
    1510. ELSE
    1511. BEGIN
    1512. FOUND = TRUE;
    1513. SF$W1[I] = SFT$VAL[0];
    1514. SF$PO[I] = KEY;
    1515. SF$MASK[I] = B<0,42>MASK;
    1516. END
    1517.  
    1518. END
    1519.  
    1520. TEST DIRNUM;
    1521. END # DIRECTIVE PROCESSING #
    1522.  
    1523. #
    1524. * IF A FATAL DIRECTIVE ERROR OR DIRECTIVE PARAMETER ERROR
    1525. * HAS OCCURRED THEN ISSUE A DAYFILE MESSAGE AND CONTINUE
    1526. * IN REPORT ONLY MODE.
    1527. #
    1528.  
    1529. IF FATALERR
    1530. THEN
    1531. BEGIN
    1532. MVMSG$LN[0] = " DIRECTIVE ERROR - REPORT ONLY.";
    1533. MESSAGE(MVMSG[0],UDFL1);
    1534. PX$A[0] = TRUE;
    1535. PX$B[0] = TRUE;
    1536. PX$F[0] = TRUE;
    1537. PX$S[0] = TRUE;
    1538. END
    1539.  
    1540. #
    1541. * WRITE RESULTANT VALUES OF RUN-TIME PARAMETERS.
    1542. #
    1543.  
    1544.  
    1545. #
    1546. * WRITE HEADER.
    1547. #
    1548.  
    1549. RPEJECT(OUT$FETP);
    1550.  
    1551. RPLINE(OUT$FETP, ##
    1552. "RUN-TIME PARAMETER VALUES ", ##
    1553. 17,27,0);
    1554.  
    1555. RPSPACE(OUT$FETP,SP"SPACE",1);
    1556.  
    1557. RPLINE(OUT$FETP, ##
    1558. " * D E S T A G E * * R E L E A S E *", ##
    1559. 15,42,0);
    1560.  
    1561. RPLINE(OUT$FETP, ##
    1562. " DIRECT INDIRECT DIRECT INDIRECT", ##
    1563. 15,42,0);
    1564.  
    1565.  
    1566. #
    1567. * WRITE PARAMETER VALUES
    1568. #
    1569.  
    1570. FOR I = 2 STEP 1 UNTIL NUMDIR
    1571. DO
    1572. BEGIN # I #
    1573. RPSPACE(OUT$FETP,SP"SPACE",2);
    1574. P<KWTEXT> = ARG$TEXT[I];
    1575. RPLINE(OUT$FETP,KWTEXT[1],3,20,0);
    1576.  
    1577. KEY = ARG$KEY[I];
    1578. P<XXARG> = ARG$TAB[I]+5;
    1579. P<PARM> = ARG$VAL[I];
    1580. RPSPACE(OUT$FETP,SP"SPACE",1);
    1581. RPLINE(OUT$FETP,KEY,8,2,1); # PRINT DIRECTIVE KEY #
    1582.  
    1583. FOR J = 1 STEP 1 UNTIL ARG$MX[I]
    1584. DO
    1585. BEGIN # J #
    1586. KEY = XX$KEY[J];
    1587. IF XX$C2[J] EQ 0
    1588. THEN # SPACE FILL KEY #
    1589. BEGIN
    1590. C<1,1>KEY = " ";
    1591. END
    1592.  
    1593. COL = 16; # STARTING COLUMN FOR PARAMETER
    1594.   VALUES #
    1595. FOR K = 1 STEP 1 UNTIL 2
    1596. DO
    1597. BEGIN # K #
    1598. FOR L = 1 STEP 1 UNTIL 2
    1599. DO
    1600. BEGIN # L #
    1601. TMPI = PARM$V[L,K,J];
    1602. CHR$10[0] = XCDD(TMPI); # CONVERT VALUE TO DECIMAL #
    1603. RPLINE(OUT$FETP,CHR$R8[0],COL,8,1); # PRINT VALUE #
    1604. COL = COL + 11; # MOVE TO NEXT COLUMN #
    1605. END # L #
    1606.  
    1607. END # K #
    1608.  
    1609. RPLINE(OUT$FETP,KEY,12,2,0); # PRINT PARAM KEY AND VALUES #
    1610. END # J #
    1611.  
    1612. END # I #
    1613.  
    1614. END # MVDIR #
    1615.  
    1616. TERM
    1617. PROC MVDOIT;
    1618. # TITLE MVDOIT - PERFORM SELECTED PROCESSING. #
    1619.  
    1620. BEGIN # MVDOIT #
    1621.  
    1622. #
    1623. ** MVDOIT - PERFORM SELECTED PROCESSING.
    1624. *
    1625. * THIS PROCEDURE ISSUES THE CALLS TO STAGE A FILE, CLEAR
    1626. * AN *ASA*, AND DROP DISK SPACE.
    1627. *
    1628. * PROC MVDOIT.
    1629. *
    1630. * ENTRY. PROCESSING ACTION FLAGS ARE SET IN ARRAY
    1631. * *EXT$TDAM*.
    1632. *
    1633. * EXIT. SELECTED PROCESSING OCCURS OR ERRORS ARE
    1634. * PROCESSED.
    1635. *
    1636. * NOTES. 1) IF THE FILE IS TO BE STAGED, A CALL IS MADE TO
    1637. * *CALPFU* TO STAGE THE FILE.
    1638. *
    1639. * 2) IF THE FILE-S *ASA* IS TO BE CLEARED, A CALL IS
    1640. * MADE TO *SETAF* TO CLEAR THE *ASA* IN THE FILE-S
    1641. * *PFC* ENTRY.
    1642. *
    1643. * 3) IF THE FILE IS TO BE RELEASED *DROPDS* (FOR
    1644. * DIRECT ACCESS FILES) OR *DROPIDS* ( FOR
    1645. * INDIRECT ACCESS FILES) IS CALLED TO RELEASE
    1646. * THE DISK SPACE FOR THE FILE.
    1647. #
    1648.  
    1649. #
    1650. **** PROC MVDOIT - XREF LIST BEGIN.
    1651. #
    1652.  
    1653. XREF
    1654. BEGIN
    1655. PROC BZFILL; # BLANK/ZERO FILL CHARACTER ITEM #
    1656. PROC CALPFU; # CALL *PFU* TO STAGE FILE #
    1657. PROC DROPDS; # DROP DIRECT FILE DISK SPACE #
    1658. PROC DROPIDS; # DROP INDIRECT FILE DISK SPACE #
    1659. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
    1660. PROC MVERRP; # PROCESS *SSMOVE* ERRORS #
    1661. PROC RECALL; # RECALL #
    1662. PROC RETERN; # RETURN FILE #
    1663. PROC SETAF; # SET ALTERNATE STORAGE ADDRESS #
    1664. PROC UATTACH; # UTILITY ATTACH #
    1665. PROC UGET; # UTILITY GET #
    1666. PROC ZFILL; # ZERO FILL ARRAY #
    1667. END
    1668.  
    1669. #
    1670. **** PROC MVDOIT - XREF LIST END.
    1671. #
    1672.  
    1673. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    1674.  
    1675. *CALL COMBFAS
    1676. *CALL COMBBZF
    1677. *CALL COMBTDM
    1678. *CALL COMSPFM
    1679. *CALL COMTMOV
    1680.  
    1681. DEF ZEROASA #0#; # ZERO *ASA* #
    1682.  
    1683. ITEM CTSR U; # STAGE REQUEST #
    1684. ITEM FAMILY C(10); # FAMILY NAME #
    1685. ITEM FILENAME C(10); # FILE NAME #
    1686. ITEM FLAG I; # ERROR FLAG #
    1687. ITEM I I; # LOOP VARIABLE #
    1688. ITEM J I; # LOOP VARIABLE #
    1689. ITEM LFN C(10); # LOCAL FILE NAME #
    1690. ITEM MORE B; # ISSUE STAGE REQUEST AGAIN #
    1691. ITEM UFLAG I; # UTILITY ERROR FLAG #
    1692.  
    1693. ARRAY DOIT$PFC[0:0]S(PFCENTL);; # PFC INFORMATION FOR *PFU* #
    1694.  
    1695. ARRAY STG$REQ [0:0] S(5); # STAGE REQUEST INFORMATION #
    1696. BEGIN
    1697. ITEM STG$FAM C(00,00,07); # FAMILY NAME #
    1698. ITEM STG$DN U(01,54,06); # DEVICE NUMBER #
    1699. ITEM STG$TN U(02,48,12); # TRACK NUMBER #
    1700. ITEM STG$SN U(03,48,12); # SECTOR NUMBER #
    1701. ITEM STG$PEO U(04,58,02); # PFC ENTRY ORDINAL #
    1702. END
    1703.  
    1704. ARRAY SG$CW [0:0] S(1); # STAGE REQUEST CONTROL WORD #
    1705. BEGIN
    1706. ITEM SG$WORD U(00,00,60); # STAGE CONTROL WORD #
    1707. ITEM SG$PE U(00,00,18); # PFC ENTRY IMAGE #
    1708. ITEM SG$REQ U(00,18,18); # INFORMATION LIST #
    1709. ITEM SG$STAT U(00,36,24); # STATUS #
    1710. ITEM SG$ERR U(00,36,12); # ERROR STATUS #
    1711. ITEM SG$COMP U(00,59,01); # REQUEST COMPLETE #
    1712. END
    1713.  
    1714. ARRAY ERRMSG [0:0] P(3);; # *PFM* ERROR MESSAGE #
    1715.  
    1716. CONTROL EJECT;
    1717.  
    1718. #
    1719. * IF THE FILE IS TO BE STAGED, SET UP THE STAGE REQUEST
    1720. * ARRAYS. CALL *CALPFU* TO STAGE THE FILE.
    1721. #
    1722.  
    1723. P<TDAM> = LOC(MV$WBUF[0]);
    1724. P<PFC> = LOC(DOIT$PFC[0]);
    1725. ZFILL(SG$CW,1);
    1726. MORE = TRUE;
    1727.  
    1728. IF EXT$STG[0]
    1729. THEN
    1730. BEGIN # STAGE FILE #
    1731. IF EXT$CLR[0]
    1732. THEN # HAVE *STAGER* CLEAR *ASA* #
    1733. BEGIN
    1734. TDAMFFF[0] = TRUE;
    1735. END
    1736.  
    1737. STG$FAM[0] = TDAMFAM[0];
    1738. STG$DN[0] = TDAMDN[0];
    1739. STG$TN[0] = TDAMTRACK[0];
    1740. STG$SN[0] = TDAMSECTOR[0];
    1741. STG$PEO[0] = TDAMPEO[0];
    1742. SG$WORD = 1;
    1743. PFC$AFFRE[0] = TDAMFFF[0];
    1744. PFC$AA[0] = TDAMASA[0];
    1745. PFC$AT[0] = TDAMAT[0];
    1746. PFC$FN[0] = TDAMPFN[0];
    1747. PFC$UI[0] = TDAMUI[0];
    1748. PFC$CD[0] = TDAMCDT[0];
    1749. PFC$DA[0] = NOT TDAMIA[0];
    1750.  
    1751. IF PFC$DA[0]
    1752. THEN
    1753. BEGIN
    1754. PFC$LF[0] = TDAMFLN[0] + 1;
    1755. END
    1756.  
    1757. ELSE
    1758. BEGIN
    1759. PFC$LF[0] = TDAMFLN[0];
    1760. END
    1761.  
    1762. SG$PE[0] = LOC(PFC[0]);
    1763. SG$REQ[0] = LOC(STG$REQ[0]);
    1764. MVDOIT1:
    1765.  
    1766. REPEAT WHILE SG$COMP EQ 0
    1767. DO
    1768. BEGIN
    1769. RECALL; # WAIT FOR REQUEST TO COMPLETE #
    1770. END
    1771.  
    1772. CALPFU(SG$CW,CTSR);
    1773. IF SG$ERR[0] EQ 0
    1774. THEN
    1775. BEGIN
    1776. GOTO MVDOIT2;
    1777. END
    1778.  
    1779. ELSE
    1780. BEGIN
    1781. SG$STAT[0] = 1;
    1782. GOTO MVDOIT1;
    1783. END
    1784.  
    1785. END # STAGE FILE #
    1786.  
    1787. MVDOIT2:
    1788.  
    1789. #
    1790. * CLEAR THE *ASA* BY "SETTING" THE *AFOBS* FLAG.
    1791. #
    1792.  
    1793. IF EXT$CLR[0] AND NOT EXT$STG[0]
    1794. THEN
    1795. BEGIN
    1796. FILENAME = TDAMPFN[0];
    1797. BZFILL(FILENAME,TYPFILL"ZFILL",10);
    1798.  
    1799. LFN = MVULFN;
    1800. BZFILL(LFN,TYPFILL"ZFILL",10);
    1801.  
    1802. FAMILY = TDAMFAM[0];
    1803. BZFILL(FAMILY,TYPFILL"ZFILL",10);
    1804.  
    1805. SETAF(LFN,FLAG,6,TDAMUI[0],FAMILY,TDAMPFID[0],
    1806. TDAMASI[0],TDAMCDT[0],AFOBS,LOC(ERRMSG));
    1807.  
    1808. RETERN(MVULFN,RCL);
    1809. END # CLEAR ASA #
    1810.  
    1811. #
    1812. * IF THE FILE IS TO BE RELEASED FROM DISK,
    1813. * CALL *DROPDS* FOR DIRECT ACCESS FILES OR *DROPIDS* FOR
    1814. * INDIRECT ACCESS FILES TO RELEASE THE DISK SPACE FOR THE FILE.
    1815. #
    1816.  
    1817. IF EXT$REL[0]
    1818. THEN
    1819. BEGIN # RELEASE DISK SPACE #
    1820. FILENAME = TDAMPFN[0];
    1821. BZFILL(FILENAME,TYPFILL"ZFILL",10);
    1822. FAMILY = TDAMFAM[0];
    1823. BZFILL(FAMILY,TYPFILL"ZFILL",10);
    1824.  
    1825. IF NOT TDAMIA[0]
    1826. THEN # RELEASE DIRECT FILE DISK SPACE #
    1827. BEGIN
    1828. DROPDS(FILENAME,FLAG,6,TDAMUI[0],FAMILY,TDAMPFID[0], ##
    1829. TDAMASI[0],TDAMCDT[0],LOC(ERRMSG));
    1830. END
    1831.  
    1832. ELSE # RELEASE INDIRECT FILE DISK SPACE
    1833.   #
    1834. BEGIN
    1835. DROPIDS(FILENAME,FLAG,6,TDAMUI[0],FAMILY,TDAMPFID[0],
    1836. TDAMASI[0],TDAMCDT[0],LOC(ERRMSG));
    1837. END
    1838.  
    1839. END # RELEASE DISK SPACE #
    1840.  
    1841. #
    1842. * IF *SETAF*, *DROPDS*, OR *DROPIDS* RETURNED A NON-ZERO
    1843. * STATUS, CALL PROCEDURE *MVERRP* TO WRITE THE TDAM TO THE
    1844. * LOCAL PROBLEM FILE.
    1845. #
    1846.  
    1847. IF FLAG NQ 0
    1848. THEN
    1849. BEGIN
    1850. MVERRP;
    1851. END
    1852.  
    1853. END # MVDOIT #
    1854.  
    1855. TERM
    1856. PROC MVERRP;
    1857. # TITLE MVERRP - PROCESS ERRORS. #
    1858.  
    1859. BEGIN # MVERRP #
    1860.  
    1861. #
    1862. ** MVERRP - *SSMOVE* ERROR PROCESSOR.
    1863. *
    1864. * THIS PROCEDURE PROCESSES ANY ERRORS RESULTING FROM A
    1865. * CLEAR ASA, OR RELEASE REQUEST BY WRITING THE TDAM TO A FILE
    1866. * OF PROBLEMS.
    1867. *
    1868. * PROC MVERRP.
    1869. #
    1870.  
    1871. #
    1872. **** PROC MVERRP - XREF LIST BEGIN.
    1873. #
    1874.  
    1875. XREF
    1876. BEGIN
    1877. PROC WRITEW; # WRITE RECORD TO FILE BUFFER #
    1878. END
    1879.  
    1880. #
    1881. **** PROC MVERRP - XREF LIST END.
    1882. #
    1883.  
    1884. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    1885.  
    1886. *CALL COMBFAS
    1887. *CALL COMBTDM
    1888. *CALL COMTMOV
    1889.  
    1890. ITEM FLAG I; # ERROR FLAG #
    1891.  
    1892. CONTROL EJECT;
    1893.  
    1894. P<TDAM> = LOC(MV$WBUF[0]);
    1895. WRITEW(MV$FET[FILEAUX],MV$WBUF[0],TDAMLEN,FLAG);
    1896.  
    1897. RETURN;
    1898.  
    1899. END # MVERRP #
    1900.  
    1901. TERM
    1902. PROC MVHEAD((FETP));
    1903. # TITLE MVHEAD - PRINTS HEADER ON *SSMOVE* REPORT FILE. #
    1904.  
    1905. BEGIN # MVHEAD #
    1906.  
    1907. #
    1908. ** MVHEAD - PRINTS HEADER ON *SSMOVE* REPORT FILE.
    1909. *
    1910. * PROC MVHEAD((FETP)).
    1911. *
    1912. * ENTRY. (FETP) = FWA OF FET.
    1913. *
    1914. * EXIT. HEADER PRINTED.
    1915. *
    1916. * NOTES. REPORT FORMATTER IS USED TO PRINT THE HEADER LINE.
    1917. * THE CONTROL CARD IMAGE IS WRITTEN TO THE
    1918. * REPORT FILE ON THE FIRST EXECUTION OF THE PROC.
    1919. #
    1920.  
    1921. ITEM FETP I; # FWA OF FET #
    1922.  
    1923. #
    1924. **** PROC MVHEAD - XREF LIST BEGIN.
    1925. #
    1926.  
    1927. XREF
    1928. BEGIN
    1929. PROC BZFILL; # BLANK OR ZERO FILLS A BUFFER #
    1930. PROC RPLINEX; # WRITES A REPORT LINE #
    1931. END
    1932.  
    1933. #
    1934. **** PROC MVHEAD - XREF LIST END.
    1935. #
    1936.  
    1937. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    1938. *CALL,COMBFAS
    1939. *CALL COMBSIT
    1940. *CALL,COMBBZF
    1941.  
    1942. ITEM FIRST B = TRUE; # FIRST EXECUTION OF PROC #
    1943.  
    1944. BASED
    1945. ARRAY RA [0:0];; # TO ACCESS RA AREA #
    1946.  
    1947. CONTROL EJECT;
    1948.  
    1949. #
    1950. * PRINT THE HEADER.
    1951. #
    1952.  
    1953. RPLINEX(FETP,"SSMOVE REPORT.",2,14,0);
    1954. RPLINEX(FETP," ",1,1,0);
    1955.  
    1956. IF FIRST
    1957. THEN # WRITE CONTROL CARD IMAGE #
    1958. BEGIN
    1959. FIRST = FALSE;
    1960. P<RA> = 0;
    1961. BZFILL(RA[O"70"],TYPFILL"BFILL",80);
    1962. RPLINEX(FETP,RA[O"70"],2,80,0);
    1963. RPLINEX(FETP," ",1,1,0);
    1964. END
    1965.  
    1966. RETURN;
    1967.  
    1968. END # MVHEAD #
    1969.  
    1970. TERM
    1971. PROC MVINDEV;
    1972. # TITLE MVINDEV - INITIALIZE *DEVSTAT* ARRAY. #
    1973. BEGIN # MVINDEV #
    1974.  
    1975. #
    1976. ** MVINDEV - INITIALIZE *DEVSTAT* ARRAY.
    1977. *
    1978. * *MVINDEV* INITIALIZES TABLE ENTRIES FOR EACH PERMANENT FILE
    1979. * DEVICE BELONGING TO THE FAMILY BEING ANALYZED.
    1980. *
    1981. * ARRAYS *DNTODNX*, *SFSTAT* AND *DEVSTAT* ARE ALL ZEROED.
    1982. *
    1983. * ARRAY *DNTODNX* IS INITIALIZED SO THAT *DNX = DN$TO$DNX[DN]*
    1984. * CAN BE USED TO DETERMINE THE INDEX FOR A DEVICE GIVEN ITS
    1985. * DEVICE NUMBER.
    1986. *
    1987. * ARRAY *DEVSTAT* IS INITIALIZED TO CONTAIN INFORMATION
    1988. * OBTAINED FROM THE *EST* AND *MST* ENTRIES FOR EACH DEVICE.
    1989. *
    1990. * PROC MVINDEV.
    1991. *
    1992. * ENTRY. MVARG$FM[0] IDENTIFIES THE FAMILY TO BE ANALYZED
    1993. * BY THIS *SSMOVE* RUN.
    1994. *
    1995. * EXIT. ARRAYS *DNTODNX, *SFSTAT* AND *DEVSTAT* ARE
    1996. * INITIALIZED.
    1997. *
    1998. * MESSAGES. *MAXDEV* TOO SMALL.
    1999. #
    2000.  
    2001. #
    2002. **** PROC MVINDEV - XREF LIST BEGIN.
    2003. #
    2004.  
    2005. XREF
    2006. BEGIN
    2007. PROC GETMST; # GETS DATA FROM *EST* AND *MST*
    2008.   ENTRIES #
    2009. PROC MESSAGE; # DISPLAYS MESSAGE IN DAYFILE #
    2010. PROC RESTPFP; # RESTORE USER-S *PFP* AND ABORT
    2011.   OR RETURN #
    2012. PROC ZFILL; # ZERO FILL ARRAY #
    2013. END
    2014.  
    2015. #
    2016. **** PROC MVINDEV - XREF LIST END.
    2017. #
    2018.  
    2019. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    2020. *CALL,COMBFAS
    2021. *CALL,COMTMOV
    2022. *CALL,COMTMVP
    2023.  
    2024. ITEM DEVERR B; # INVALID DEVICE SPECIFIED #
    2025. ITEM DN I; # DEVICE NUMBER #
    2026. ITEM ESTX I; # INDEX TO NEXT *EST* ENTRY #
    2027. ITEM FAM C(7); # FAMILY FROM *MST* #
    2028. ITEM MASKP I; # PRIMARY MASK FROM *MST* #
    2029. ITEM MASKS I; # SECONDARY MASK FROM *MST* #
    2030. ITEM NUM I; # NUMBER OF DRIVES FOR THIS DEVICE
    2031.   #
    2032. ITEM SECT I; # PRUS PER TRACK #
    2033. ITEM STAT I; # STATUS FROM *GETMST* #
    2034. ITEM TPRU I; # TOTAL PRU FOR A DEVICE #
    2035. ITEM TYPE C(2); # DEVICE TYPE #
    2036.  
    2037. CONTROL EJECT;
    2038.  
    2039. #
    2040. * INITIALIZE THE VARIOUS ARRAYS TO ZERO.
    2041. #
    2042.  
    2043. ZFILL(DEVSTAT,8*MAXDEV);
    2044. ZFILL(SF$STAT,10*MAXSF);
    2045. ZFILL(DNTODNX,64);
    2046.  
    2047. DNX = 1;
    2048. DEVERR = TRUE;
    2049.  
    2050. #
    2051. * LOOK AT EACH *EST* AND CORRESPONDING *MST* ENTRY TO
    2052. * FIND DEVICES BELONGING TO THE FAMILY BEING ANALYZED.
    2053. #
    2054.  
    2055. SLOWFOR ESTX = 1 STEP 1 WHILE STAT GQ 0
    2056. DO
    2057. BEGIN # ANALYZE EACH *EST* AND *MST* ENTRY #
    2058. GETMST(ESTX,STAT,TYPE,FAM,DN,NUM,TPRU,SECT,MASKP,MASKS);
    2059.  
    2060. IF STAT NQ 0 OR ##
    2061. FAM NQ MVARG$FM[0]
    2062. THEN
    2063. BEGIN
    2064. TEST ESTX;
    2065. END
    2066.  
    2067. IF DNX GR MAXDEV
    2068. THEN
    2069. BEGIN
    2070. MESSAGE(" *MAXDEV* TOO SMALL ");
    2071. TEST ESTX;
    2072. END
    2073.  
    2074. IF MVARG$DN[0] NQ 0 ##
    2075. AND MVARG$DN[0] EQ DN
    2076. THEN # SPECIFIED DEVICE FOUND #
    2077. BEGIN
    2078. DEVERR = FALSE;
    2079. END
    2080.  
    2081. #
    2082. * FOR EACH DEVICE, ESTABLISH THE INDEX (*DN$TO$DNX[DN]*) FOR
    2083. * THE DISKS DEVICE NUMBER FIELD IN THE CORRESPONDING *DEVSTAT*
    2084. * ENTRY.
    2085. #
    2086.  
    2087. DN$TO$DNX[DN] = DNX;
    2088. DEV$EO[IXIA,DNX] = ESTX;
    2089. DEV$TPRU[IXIA,DNX] = TPRU;
    2090. DEV$TYPE[IXIA,DNX] = TYPE;
    2091. DEV$NUM[IXIA,DNX] = NUM;
    2092. DEV$MAST[IXIA,DNX] = MASKP NQ 0;
    2093. DEV$SEC[IXIA,DNX] = MASKS NQ 0;
    2094. DEV$DN[IXIA,DNX] = DN;
    2095. DEV$SECTR[IXDA,DNX] = SECT;
    2096. DEV$EXIST[IXIA,DNX] = TRUE;
    2097. DNX = DNX+1;
    2098. TEST ESTX;
    2099. END # ANALYZE EACH *EST* AND *MST* ENTRY #
    2100.  
    2101. #
    2102. * ABORT WITH MESSAGE IF INVALID DEVICE SPECIFIED.
    2103. #
    2104.  
    2105. IF MVARG$DN[0] NQ 0 ##
    2106. AND DEVERR
    2107. THEN
    2108. BEGIN
    2109. MVMSG$LN[0] = " INVALID DEVICE SPECIFIED.";
    2110. MESSAGE(MVMSG[0],SYSUDF1);
    2111. RESTPFP(PFP$ABORT);
    2112. END
    2113.  
    2114. END # MVINDEV #
    2115.  
    2116. TERM
    2117. PROC MVINIT;
    2118. # TITLE MVINIT - DECODES *SSMOVE* CONTROL STATEMENT. #
    2119.  
    2120. BEGIN # MVINIT #
    2121.  
    2122. #
    2123. ** MVINIT - DECODES *SSMOVE* CONTROL STATEMENT.
    2124. *
    2125. * *MVINIT* DECODES THE PARAMETERS ON THE *SSMOVE* CONTROL
    2126. * STATEMENT. INVALID PARAMETERS ARE REPORTED VIA DAYFILE MESSAGES.
    2127. * PROCEDURE *MVDIR* IS CALLED TO PROCESS THE DIRECTIVE FILE.
    2128. *
    2129. * PROC MVINIT.
    2130. *
    2131. * ENTRY. CONTROL CARD IMAGE IN RA+70B.
    2132. *
    2133. * EXIT. PARAMETERS IN THE *MVARG* ARRAY.
    2134. * THE *OPTLO* AND *OPTPX* ARRAYS ARE UPDATED
    2135. * TO REFLECT ANY RUN-TIME PARAMETERS.
    2136. *
    2137. * MESSAGES. 1) SSMOVE - PARAMETER ERROR.
    2138. * 2) COMMUNICATION FILE BUSY.
    2139. * 3) UNABLE TO DEFINE COMMUNICATION FILE.
    2140. * 4) FAMILY NOT FOUND.
    2141. #
    2142.  
    2143. #
    2144. **** PROC MVINIT - XREF LIST BEGIN.
    2145. #
    2146.  
    2147. XREF
    2148. BEGIN
    2149. PROC BZFILL; # BLANK/ZERO FILL CHARACTER ITEM #
    2150. PROC GETFAM; # GET DEFAULT FAMILY #
    2151. PROC GETPFP; # GET USER-S FAMILY AND UI. #
    2152. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
    2153. PROC MVALCS; # ANALYZE CHARACTER STRING #
    2154. PROC MVDIR; # PROCESS DIRECTIVES #
    2155. PROC MVHEAD; # WRITES HEADER ON OUTPUT FILE #
    2156. PROC MVINDEV; # INITIALIZE DEVICE STATUS ARRAYS
    2157.   #
    2158. PROC MVTAB; # PROVIDES ADDRESS OF PARAMETER
    2159.   DECODING TABLE #
    2160. PROC PDATE; # GET CURRENT DATE/TIME #
    2161. PROC PF; # *PFM* REQUEST INTERFACE #
    2162. PROC RESTPFP; # RESTORE USER-S FAMILY AND UI. #
    2163. PROC RPOPEN; # OPENS OUTPUT FILE #
    2164. PROC SETPFP; # SET FAMILY/USER INDEX #
    2165. PROC XARG; # DECODES PARAMETERS PER DECODING
    2166.   TABLE #
    2167. FUNC MVRELAG U; # CALCULATE RELATIVE AGE #
    2168. FUNC XDXB I; # CONVERTS DISPLAY TO BINARY #
    2169. END
    2170.  
    2171. #
    2172. **** PROC MVINIT - XREF LIST END.
    2173. #
    2174.  
    2175. DEF MSG1 #" SSMOVE - PARAMETER ERROR."#;
    2176. DEF MSG2 #" COMMUNICATION FILE BUSY."#;
    2177. DEF MSG3 #" UNABLE TO DEFINE COMMUNICATION FILE."#;
    2178. DEF MSG4 #" FAMILY NOT FOUND."#;
    2179.  
    2180. DEF PROCNAME #"SSMOVE."#; # PROCEDURE NAME #
    2181.  
    2182. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    2183. *CALL,COMBFAS
    2184. *CALL COMBSIT
    2185. *CALL,COMBBZF
    2186. *CALL,COMBPFP
    2187. *CALL,COMBTDM
    2188. *CALL,COMSPFM
    2189. *CALL,COMTMOV
    2190. *CALL,COMTMVP
    2191. *CALL,COMTOUT
    2192.  
    2193.  
    2194. ITEM ARGLIST I; # ADDRESS OF ARGUMENT TABLE #
    2195. ITEM CCOK B=TRUE; # CONTROL CARD STATUS #
    2196. ITEM DEFORD I; # ORDINAL OF DEFAULT FAMILY #
    2197. ITEM LINK I; # ORDINAL OF LINK DEVICE #
    2198. ITEM NUM I; # NUMBER OF FAMILIES #
    2199. ITEM STAT I; # ERROR STATUS #
    2200. ITEM TMPI I; # TEMPORARY INTEGER #
    2201. CONTROL EJECT;
    2202.  
    2203. #
    2204. * SAVE ORIGINAL FAMILY AND USER INDEX FOR RESTORING.
    2205. #
    2206.  
    2207. GETPFP(PFP[0]);
    2208. USER$FAM[0] = PFP$FAM[0];
    2209. USER$UI[0] = PFP$UI[0];
    2210.  
    2211. #
    2212. * CRACK PARAMETERS ON *SSMOVE* PROGRAM CALL.
    2213. #
    2214.  
    2215. MVTAB(ARGLIST);
    2216. XARG(ARGLIST,0,STAT);
    2217. CCOK = STAT EQ 0;
    2218.  
    2219. MVALCS(MVARG$LO[0],VCSLO,LOOPT[0],"LO",STAT);
    2220. CCOK = CCOK AND (STAT EQ 0);
    2221.  
    2222. MVALCS(MVARG$PX[0],VCSPX,PXOPT[0],"PX",STAT);
    2223. CCOK = CCOK AND (STAT EQ 0);
    2224.  
    2225. #
    2226. * CRACK NW, UI, DN, LB AND SET UP REPORT FILE.
    2227. #
    2228.  
    2229. IF MVARG$ZNW[0] NQ 0
    2230. THEN
    2231. BEGIN
    2232. MVARG$ZNW[0] = 0;
    2233. MVARG$NW[0] = TRUE;
    2234. END
    2235.  
    2236. ELSE
    2237. BEGIN
    2238. MVARG$NW[0] = FALSE;
    2239. END
    2240.  
    2241. IF MVARG$ZUI[0] NQ 0
    2242. THEN
    2243. BEGIN
    2244. STAT = XDXB(MVARG$UI[0],0,TMPI);
    2245. MVARG$ZUI[0] = TMPI;
    2246. CCOK = CCOK AND (STAT EQ 0) ##
    2247. AND (TMPI GR 0) AND (TMPI LQ SYS$UI);
    2248. END
    2249.  
    2250. IF MVARG$DN[0] NQ 0
    2251. THEN
    2252. BEGIN
    2253. STAT = XDXB(MVARG$DN[0],0,TMPI);
    2254. MVARG$DN[0] = TMPI;
    2255. CCOK = CCOK AND (STAT EQ 0);
    2256. END
    2257.  
    2258. IF MVARG$LB[0] EQ LBNS
    2259. THEN # *LB* NOT SPECIFIED #
    2260. BEGIN
    2261. MVARG$LB[0] = DEFLB;
    2262. END
    2263.  
    2264. ELSE
    2265. BEGIN
    2266. STAT = XDXB(MVARG$LB[0],1,TMPI);
    2267. MVARG$LB[0] = TMPI;
    2268. IF STAT NQ 0
    2269. THEN
    2270. BEGIN
    2271. CCOK = FALSE;
    2272. MVARG$LB[0] = DEFLB;
    2273. END
    2274.  
    2275. END
    2276.  
    2277. IF MVARG$L[0] EQ 0
    2278. THEN
    2279. BEGIN
    2280. OUT$FETP = 0;
    2281. END
    2282.  
    2283. ELSE
    2284. BEGIN
    2285. OUT$FETP = LOC(OUT$FET[0]);
    2286. END
    2287.  
    2288. IF NOT CCOK
    2289. THEN
    2290. BEGIN
    2291. MVMSG$LN[0] = MSG1;
    2292. MESSAGE(MVMSG[0],SYSUDF1);
    2293. RESTPFP(PFP$ABORT);
    2294. END
    2295.  
    2296. RPOPEN(MVARG$L[0],OUT$FETP,MVHEAD); # OPEN REPORT FILE #
    2297.  
    2298. #
    2299. * GET DEFAULT FAMILY AND SUBSYSTEM ID.
    2300. #
    2301.  
    2302. SSID$MV = ATAS;
    2303. GETFAM(FAMT,NUM,LINK,DEFORD,SSID$MV);
    2304.  
    2305. IF MVARG$FM[0] EQ 0
    2306. THEN # FAMILY NOT SPECIFIED #
    2307. BEGIN
    2308. MVARG$FM[0] = FAM$NAME[DEFORD];
    2309. END
    2310.  
    2311. PFP$WRD0[0] = 0; # SET FAMILY AND USER INDEX #
    2312. PFP$FAM[0] = MVARG$FM[0];
    2313. PFP$UI[0] = DEF$UI;
    2314. PFP$FG1[0] = TRUE;
    2315. PFP$FG4[0] = TRUE;
    2316. SETPFP(PFP[0]);
    2317. IF PFP$STAT[0] NQ 0
    2318. THEN # FAMILY NOT FOUND #
    2319. BEGIN
    2320. MVMSG$LN[0] = MSG4;
    2321. MESSAGE(MVMSG[0],SYSUDF1);
    2322. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    2323. END
    2324.  
    2325. #
    2326. * CALL PROCEDURE *MVDIR* TO PROCESS DIRECTIVES.
    2327. #
    2328.  
    2329. MVDIR;
    2330.  
    2331. #
    2332. * CALL *MVINDEV* TO INITIALIZE DEVICE STATUS ARRAYS.
    2333. #
    2334.  
    2335. MVINDEV;
    2336.  
    2337. #
    2338. * ATTACH COMMUNICATION FILE.
    2339. #
    2340.  
    2341. COMNAME = MVOCOM; # ZERO FILL FILE NAME #
    2342. NFILES = 0;
    2343. BZFILL(COMNAME,TYPFILL"ZFILL",7);
    2344. IF NOT (PX$A[0] AND PX$B[0] AND PX$S[0] AND PX$F[0])
    2345. THEN
    2346. BEGIN
    2347. PF("ATTACH",COMNAME,0,"M","W","RC",STAT,"NA",0,0);
    2348. IF STAT NQ OK
    2349. THEN
    2350. BEGIN # PROCESS ATTACH ERROR FLAG #
    2351. IF STAT EQ FBS
    2352. THEN # COMMUNICATION FILE BUSY #
    2353. BEGIN
    2354. MVMSG$LN[0] = MSG2; # ABORT WITH DAYFILE MESSAGE #
    2355. MESSAGE(MVMSG[0],SYSUDF1);
    2356. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    2357. END
    2358.  
    2359. IF STAT EQ FNF
    2360. THEN # FILE DOES NOT EXIST #
    2361. BEGIN
    2362. PF("DEFINE",COMNAME,0,"BR","N","RC",STAT,0);
    2363. IF STAT NQ OK
    2364. THEN # PROCESS DEFINE ERROR #
    2365. BEGIN
    2366. MVMSG$LN[0] = MSG3; # ABORT WITH DAYFILE MESSAGE #
    2367. MESSAGE(MVMSG[0],SYSUDF1);
    2368. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    2369. END
    2370.  
    2371. END
    2372.  
    2373. ELSE # ABNORMAL TERMINATION #
    2374. BEGIN
    2375. MVMSG$PROC[0] = PROCNAME;
    2376. MESSAGE(MVMSG[0],SYSUDF1);
    2377. RESTPFP(PFP$ABORT); # RESTORE USER-S *PFP* AND ABORT #
    2378. END
    2379.  
    2380. END # PROCESS ATTACH ERROR FLAG #
    2381.  
    2382. END
    2383.  
    2384. PDATE(CURDT$MV); # GET CURRENT DATE AND TIME #
    2385. TMPI = B<24,18>CURDT$MV;
    2386. CURAGE = MVRELAG(TMPI); # ESTABLISH AGE OF TODAY #
    2387. CURTIME = B<42,18>CURDT$MV; # ESTABLISH CURRENT TIME #
    2388.  
    2389. END # MVINIT #
    2390.  
    2391. TERM
    2392. PROC MVPASS3;
    2393. # TITLE MVPASS3 - FINAL SELECTION OF FILES TO BE RELEASED. #
    2394.  
    2395. BEGIN # MVPASS3 #
    2396. CONTROL FTNCALL;
    2397.  
    2398. #
    2399. ** MVPASS3 - FINAL SELECTION OF FILES TO BE RELEASED.
    2400. *
    2401. * THIS PROCEDURE DOES THE FINAL SELECTION OF THE FILES TO BE
    2402. * RELEASED FROM DISK AND PRODUCES A PASS 3 OUTPUT FILE FOR
    2403. * USE IN DOING OR DIRECTING *SSEXEC* TO DO THE SELECTED ACTIONS.
    2404. * THIS PASS 3 OUTPUT FILE IS SORTED SUCH THAT FILES TO BE
    2405. * DESTAGED ARE ORDERED BY SUBFAMILY AND THEN BY SIZE (SMALL,
    2406. * THEN LARGE).
    2407. *
    2408. * PROC MVPASS3.
    2409. *
    2410. * ENTRY. 1) THE PASS 1 OUTPUT FILE IS AVAILABLE ON DISK.
    2411. *
    2412. * 2) THE AMOUNT OF DISK SPACE NEEDED PER DEVICE AND
    2413. * FILE TYPE IS IN THE *DEV$NEED* FIELD OF *DEV$STAT*.
    2414. *
    2415. * EXIT. 1) THE PASS 3 OUTPUT FILE CONTAINS ALL FILES TO BE
    2416. * DESTAGED, RELEASED, STAGED, OR FREED. FILES TO BE
    2417. * DESTAGED ARE SORTED BY SUBFAMILY AND THEN FILE SIZE.
    2418. *
    2419. * 2) THE NUMBER OF FILES AND AMOUNT OF MSAS SPACE NEEDED
    2420. * IS PROVIDED IN THE *SFDS$NF* AND *SFDS$PRU* FIELDS
    2421. * OF THE ARRAY *SF$STAT*.
    2422. *
    2423. * NOTES. THE PROCESSING LOGIC FOR THIS ROUTINE IS AS FOLLOWS..
    2424. *
    2425. * 1) SORT THE ENTRIES OF THE PASS 1 OUTPUT FILE BY
    2426. * RELEASE VALUE.
    2427. *
    2428. * 2) DETERMINE WHICH OF THE FILES CONDITIONALLY SELECTED
    2429. * TO BE RELEASED WILL ACTUALLY BE RELEASED. SELECT
    2430. * THOSE HAVING THE LARGEST RELEASE VALUE UNTIL THE
    2431. * NEEDED AMOUNT OF SPACE FOR EACH FILE TYPE ON EACH
    2432. * DEVICE IS OBTAINED.
    2433. *
    2434. * 3) WRITE THE ENTRY FOR ALL FILES THUS SELECTED TO THE
    2435. * PASS 3 OUTPUT FILE. ALSO, COPY THE ENTRIES FOR ALL
    2436. * FILES PREVIOUSLY SELECTED FOR PROCESSING.
    2437. #
    2438.  
    2439. #
    2440. **** PROC MVPASS3 - XREF LIST BEGIN.
    2441. #
    2442.  
    2443. XREF
    2444. BEGIN
    2445. PROC CLOSEM; # CLOSE FILE #
    2446. PROC FILESQ; # ESTABLISH SEQUENTIAL FILE
    2447.   ORGANIZATION #
    2448. PROC OPENM; # OPEN FILE #
    2449. PROC READ; # INITIATE FILE INPUT #
    2450. PROC RETERN; # RETURN FILE #
    2451. PROC READW; # READ NEXT RECORD #
    2452. PROC REWIND; # REWIND FILE #
    2453. PROC SM5END; # S/M TERMINATION #
    2454. PROC SM5FROM; # S/M INPUT FILE DEFINITION #
    2455. PROC SM5KEY; # S/M KEY DEFINITION #
    2456. PROC SM5SORT; # S/M INITIALIZATION #
    2457. PROC SM5TO; # S/M OUTPUT FILE DEFINITION #
    2458. PROC WRITER; # FLUSH FILE BUFFER #
    2459. PROC WRITEW; # WRITE RECORD #
    2460. PROC ZSETFET; # INITIALIZE FET #
    2461. END
    2462.  
    2463. #
    2464. **** PROC MVPASS3 - XREF LIST END.
    2465. #
    2466.  
    2467. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    2468. DEF SFITL #35#; # *FIT* BUFFER SIZE #
    2469.  
    2470. *CALL,COMBFAS
    2471. *CALL,COMBTDM
    2472. *CALL,COMTMOV
    2473. *CALL,COMTMVP
    2474.  
    2475. ITEM EOTDAM B; # SIGNAL EOF #
    2476. ITEM FLAG I; # STATUS FROM I/O CALLS #
    2477. ITEM IXLN I; # LARGE/SMALL INDEX #
    2478. ITEM NXTDAM I; # LOOP INDEX #
    2479.  
    2480. ARRAY FIT [1:2] S(SFITL);; # USED TO SORT FILES #
    2481. CONTROL EJECT;
    2482. FILESQ(FIT[1],"LFN","SCR1","RT","F","BT","C","FL",90);
    2483. OPENM(FIT[1],"INPUT", "R");
    2484.  
    2485. FILESQ(FIT[2],"LFN","SCR2","RT","F","BT","C","FL",90);
    2486. OPENM(FIT[2],"OUTPUT","R");
    2487.  
    2488. SM5SORT(0); # NO STATISTICS RETURNED #
    2489.  
    2490. SM5FROM("SCR1"); # DEFINE INPUT FILE #
    2491.  
    2492. SM5TO("SCR2"); # DEFINE OUTPUT FILE #
    2493.  
    2494. SM5KEY(61,10,"BINARY","D"); # SORT BY DECREASING RELEASE VALUE
    2495.   #
    2496.  
    2497. SM5END; # INITIATE SORT USING ONE KEY #
    2498.  
    2499. CLOSEM(FIT[1]);
    2500. CLOSEM(FIT[2]);
    2501.  
    2502. RETERN(MV$FET[FILEMO],RCL);
    2503. FETP = LOC(MV$FET[FILEMI]);
    2504. BUFP = LOC(MV$BUF[FILEMI]);
    2505. ZSETFET(FETP,"SCR2",BUFP,MVBUFL,SFETL);
    2506.  
    2507. FETP = LOC(MV$FET[FILEMO]);
    2508. BUFP = LOC(MV$BUF[FILEMO]);
    2509. ZSETFET(FETP,"SCR3",BUFP,MVBUFL,SFETL);
    2510. REWIND(MV$FET[FILEMI],RCL); # REWIND SCR2 #
    2511.  
    2512. READ(MV$FET[FILEMI],NRCL); # PREPARE TO READ SORTED PASS 1
    2513.   OUTPUT FILE #
    2514. EOTDAM = FALSE;
    2515.  
    2516. P<TDAM> = LOC(MV$WBUF[0]);
    2517. P<EXT$TDAM> = LOC(MV$WBUF[0]) + TDAMLEN;
    2518.  
    2519. SLOWFOR NXTDAM = 0 STEP 1 WHILE NOT EOTDAM
    2520. DO
    2521. BEGIN # NEXT TDAM #
    2522. READW(MV$FET[FILEMI],MV$WBUF[0],MVWBUFL,FLAG);
    2523.  
    2524. IF FLAG NQ 0
    2525. THEN
    2526. BEGIN
    2527. EOTDAM = TRUE;
    2528. TEST NXTDAM;
    2529. END
    2530.  
    2531. #
    2532. * INITIALIZE FILE INDICES.
    2533. #
    2534.  
    2535. DNX = EXT$DNX[0];
    2536. FTYPE = EXT$FTYPE[0];
    2537. SFX = TDAMSBF[0];
    2538.  
    2539. #
    2540. * IF THE FILE IS TO BE RELEASED, UPDATE DEVICE STATISTICS
    2541. * AND PROCESSING ACTION FLAGS.
    2542. #
    2543.  
    2544. IF ( EXT$CREL[0] # CANDIDATE TO BE RELEASED #
    2545. AND (DEV$NEED[FTYPE,DNX] GR 0) ) # AND SPACE NEEDED #
    2546.  
    2547. THEN # FILE IS TO BE RELEASED #
    2548. BEGIN
    2549. EXT$REL[0] = TRUE;
    2550. DEV$NEED[FTYPE,DNX] = DEV$NEED[FTYPE,DNX] - TDAMFLN[0];
    2551. DEV$RELF[FTYPE,DNX] = DEV$RELF[FTYPE,DNX] + 1;
    2552. DEV$TRPRU[FTYPE,DNX] = DEV$TRPRU[FTYPE,DNX] - TDAMFLN[0];
    2553. IF FTYPE EQ IXIA
    2554. THEN
    2555. BEGIN
    2556. DEV$RELP[FTYPE,DNX] = DEV$RELP[FTYPE,DNX] + TDAMFLN[0];
    2557. END
    2558.  
    2559. ELSE
    2560. BEGIN
    2561. PRUTRK = DEV$SECTR[IXDA,DNX];
    2562. TRUPRU = (((TDAMFLN[0]+1) / PRUTRK) + 1) * PRUTRK;
    2563. DEV$RELP[FTYPE,DNX] = DEV$RELP[FTYPE,DNX] + TRUPRU;
    2564. END
    2565.  
    2566. END
    2567.  
    2568. #
    2569. * FOR FILES WHICH ARE TO BE DESTAGED, COUNT THE FILES AND
    2570. * ALLOCATION UNIT REQUIREMENTS PER SUBFAMILY AND FILE SIZE.
    2571. #
    2572.  
    2573. IF EXT$DES[0] # DESTAGE SELECTED UNCONDITIONALLY
    2574.   #
    2575. OR (EXT$CDES[0] AND EXT$REL[0])
    2576.  
    2577. THEN # UPDATE DATA NEEDED BY *SSEXEC*
    2578.   TO DESTAGE FILES #
    2579. BEGIN
    2580. IF TDAMFLN[0] LS MVARG$LB[0]
    2581. THEN # SMALL FILE #
    2582. BEGIN
    2583. IXLN = IXSM;
    2584. END
    2585.  
    2586. ELSE # LARGE FILE #
    2587. BEGIN
    2588. IXLN = IXLG;
    2589. END
    2590.  
    2591. EXT$DES[0] = TRUE;
    2592. EXT$IXLN[0] = IXLN;
    2593. SFDS$NF[FTYPE,SFX] = SFDS$NF[FTYPE,SFX] + 1;
    2594. SFDS$PRU[FTYPE,SFX] = SFDS$PRU[FTYPE,SFX] + TDAMFLN[0];
    2595. SFDM$NF[FTYPE,SFX] = SFDM$NF[FTYPE,SFX] + 1;
    2596. SFDM$PRU[FTYPE,SFX] = SFDM$PRU[FTYPE,SFX] + TDAMFLN[0];
    2597. END
    2598.  
    2599. #
    2600. * COUNT THE NUMBER OF AND TOTAL LENGTH OF FILES TO BE STAGED.
    2601. #
    2602.  
    2603. IF EXT$STG[0]
    2604. THEN
    2605. BEGIN
    2606. SFSG$NF[FTYPE,SFX] = SFSG$NF[FTYPE,SFX] + 1;
    2607. SFSG$PRU[FTYPE,SFX] = SFSG$PRU[FTYPE,SFX] + TDAMFLN[0];
    2608. SFRL$NF[FTYPE,SFX] = SFRL$NF[FTYPE,SFX] - 1;
    2609. SFRL$PRU[FTYPE,SFX] = SFRL$PRU[FTYPE,SFX] - TDAMFLN[0];
    2610. END
    2611.  
    2612. IF EXT$CLR[0] OR TDAMFFF[0]
    2613. THEN
    2614. BEGIN
    2615. SFDM$NF[FTYPE,SFX] = SFDM$NF[FTYPE,SFX] - 1;
    2616. SFDM$PRU[FTYPE,SFX] = SFDM$PRU[FTYPE,SFX] - TDAMFLN[0];
    2617. END
    2618.  
    2619. ELSE
    2620. BEGIN
    2621. IF EXT$REL[0]
    2622. THEN
    2623. BEGIN
    2624. SFRL$NF[FTYPE,SFX] = SFRL$NF[FTYPE,SFX] + 1;
    2625. SFRL$PRU[FTYPE,SFX] = SFRL$PRU[FTYPE,SFX] + TDAMFLN[0];
    2626. END
    2627.  
    2628. END
    2629.  
    2630. #
    2631. * FOR FILES SELECTED FOR FURTHER PROCESSING
    2632. * (EXT$STG/REL/DES/CLR BIT SET), WRITE THE FILE-S ENTRY
    2633. * TO THE PASS 3 OUTPUT FILE.
    2634. #
    2635.  
    2636. IF EXT$PA3[0] NQ 0
    2637. THEN
    2638. BEGIN
    2639. WRITEW(MV$FET[FILEMO],MV$WBUF[0],MVWBUFL,FLAG);
    2640. END
    2641.  
    2642. END # NEXT TDAM #
    2643.  
    2644. WRITER(MV$FET[FILEMO],RCL);
    2645.  
    2646. #
    2647. * SORT THE ABOVE FILE BY SUBFAMILY, FILE SIZE (SMALL/LARGE),
    2648. * AND FILE LENGTH SO IT CAN BE PROCESSED BY THE NEXT ROUTINE.
    2649. #
    2650.  
    2651. FILESQ(FIT[1],"LFN","SCR3","RT","F","BT","C","FL",90);
    2652. OPENM(FIT[1],"INPUT","R");
    2653.  
    2654. FILESQ(FIT[2],"LFN","SCR4","RT","F","BT","C","FL",90);
    2655. OPENM(FIT[2],"OUTPUT","R");
    2656.  
    2657. SM5SORT(0); # NO STATISTICS RETURNED #
    2658.  
    2659. SM5FROM("SCR3"); # DEFINE INPUT FILE #
    2660.  
    2661. SM5TO("SCR4"); # DEFINE OUTPUT FILE #
    2662.  
    2663. SM5KEY(178,3,"BINARY_BITS"); # KEY1 = SUBFAMILY #
    2664.  
    2665. SM5KEY(73,1,"BINARY"); # KEY2 = FILE SIZE *IXLN* #
    2666.  
    2667. SM5KEY(302,23,"BINARY_BITS","D"); # KEY3 = FILE LENGTH #
    2668.  
    2669. SM5END; # INITIATE SORTING ON THE THREE
    2670.   KEYS #
    2671.  
    2672. CLOSEM(FIT[1]);
    2673. CLOSEM(FIT[2]);
    2674. RETERN(MV$FET[FILEMI],RCL);
    2675. RETERN(MV$FET[FILEMO],RCL);
    2676. END # MVPASS3 #
    2677.  
    2678. TERM
    2679. PROC MVPASS4;
    2680. # TITLE MVPASS4 - SETS UP THE COMMUNICATION FILE. #
    2681.  
    2682. BEGIN # MVPASS4 #
    2683.  
    2684. #
    2685. ** MVPASS4 - SETS UP THE COMMUNICATION FILE.
    2686. *
    2687. * THIS PROCEDURE READS THE FILE CONTAINING AN ENTRY FOR
    2688. * EACH FILE SELECTED FOR PROCESSING AND EITHER DOES IT DIRECTLY,
    2689. * OR WRITES AN ENTRY ON THE *SSEXEC* COMMUNICATION FILE SO
    2690. * *SSEXEC* CAN DESTAGE THE FILE AND OPTIONALLY RELEASE IT FROM
    2691. * DISK. FILES WHICH ARE PROCESSED DIRECTLY ARE PASSED TO
    2692. * PROCEDURE *MVDOIT* WHICH CALLS *PFM* TO PERFORM THE ACTION.
    2693. * THIS PROCEDURE ALSO WRITES A LINE ON THE OUTPUT FILE FOR EACH
    2694. * FILE SELECTED FOR PROCESSING, IF THE *LO=F* OPTION IS ON.
    2695. *
    2696. * PROC MVPASS4.
    2697. *
    2698. * ENTRY. FILE *SCR4* CONTAINS ENTRIES FOR ALL FILES TO BE
    2699. * PROCESSED. IT IS SORTED BY SUBFAMILY, FILE LENGTH
    2700. * (SHORT/LONG), AND FILE SIZE (BY PRU LENGTH, LARGEST
    2701. * FIRST).
    2702. *
    2703. * EXIT. 1) CALLS TO *MVDOIT* ARE DONE TO CAUSE PROCESSING FOR
    2704. * FILES TO BE STAGED, RELEASED OR FREED FROM A
    2705. * CARTRIDGE.
    2706. *
    2707. * 2) ENTRIES FOR FILES TO BE DESTAGED OR DESTAGED AND
    2708. * RELEASED ARE WRITTEN TO THE COMMUNICATION FILE.
    2709. *
    2710. * 3) THE OUTPUT FILE CONTAINS AN ENTRY FOR EACH FILE
    2711. * SELECTED FOR PROCESSING.
    2712. #
    2713.  
    2714. #
    2715. **** PROC MVPASS4 - XREF LIST BEGIN.
    2716. #
    2717.  
    2718. XREF
    2719. BEGIN
    2720. PROC BZFILL; # BLANK/ZERO FILL CHARACTER ITEM #
    2721. PROC MVDOIT; # PERFORM PROCESSING, EXCEPT
    2722.   DESTAGES #
    2723. PROC MVPRNDT; # PRINT DATE AND ACCESS COUNT #
    2724. PROC MVRPTDS; # REPORT DEVICE STATUS #
    2725. PROC READ; # INITIATE DATA TRANSFER INTO A
    2726.   BUFFER #
    2727. PROC READW; # READ A RECORD INTO WORKING
    2728.   BUFFER #
    2729. PROC RETERN; # RETURN FILE #
    2730. PROC REWIND; # REWIND FILE #
    2731. PROC RPEJECT; # ISSUE PAGE EJECT #
    2732. PROC RPLINE; # WRITE LINE ON OUTPUT FILE #
    2733. PROC WRITER; # FLUSH BUFFER TO FILE #
    2734. PROC WRITEW; # WRITE RECORD TO FILE BUFFER #
    2735. PROC ZFILL; # ZERO FILL ARRAY #
    2736. PROC ZSETFET; # INITIALIZE *FET* #
    2737. FUNC XCDD C(10); # CONVERT BINARY TO DECIMAL
    2738.   DISPLAY #
    2739. FUNC XCOD C(10); # CONVERT BINARY TO OCTAL DISPLAY
    2740.   #
    2741. END
    2742.  
    2743. #
    2744. **** PROC MVPASS4 - XREF LIST END.
    2745. #
    2746.  
    2747.  
    2748. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    2749.  
    2750. *CALL,COMBFAS
    2751. *CALL,COMBBZF
    2752. *CALL,COMBTDM
    2753. *CALL,COMTMOV
    2754. *CALL COMTMVP
    2755. *CALL,COMTOUT
    2756.  
    2757.  
    2758. DEF FILEHDR1 #"NAME TYPE UI LENGTH DATE"#;
    2759. DEF FILEHDR2 #" ACC-CT ACTION(* = NOT DONE PER *PX* OPTION)"
    2760.   #;
    2761. DEF FILEHDR3 #"DES-VAL REL-VAL"#;
    2762. DEF MSGCLR #"CLEAR *ASA* FIELD. "#;
    2763. DEF MSGDES #"DESTAGE FILE. "#;
    2764. DEF MSGDSR #"DESTAGE AND RELEASE. "#;
    2765. DEF MSGREL #"RELEASE FROM DISK. "#;
    2766. DEF MSGSCLR #"STAGE, CLEAR *ASA*. "#;
    2767. DEF MSGSTG #"STAGE FILE TO DISK. "#;
    2768.  
    2769. ITEM EOTDAM B; # SIGNALS END-OF-FILE #
    2770. ITEM FLAG I; # READ STATUS #
    2771. ITEM NXTDAM U; # LOOP INDEX #
    2772. ITEM PREVSF I; # PREVIOUS SUBFAMILY #
    2773. ITEM SKIP B; # CCNTROLS DOING SELECTED ACTION #
    2774. ITEM TMPC C(10); # TEMPORARY CELL #
    2775.  
    2776.  
    2777. ARRAY DTDAM [0:0] S(TDAMLEN);; # DESTAGE HEADER FOR A SUBFAMILY
    2778.   #
    2779. CONTROL EJECT;
    2780. #
    2781. * DETERMINE WHETHER TO LIST EACH FILE FOR PROCESSING.
    2782. #
    2783.  
    2784.  
    2785. IF LO$F[0]
    2786. THEN # FULL LISTING #
    2787. BEGIN
    2788. LISTFETP = OUT$FETP;
    2789. PX$FETP = OUT$FETP;
    2790. END
    2791.  
    2792. ELSE
    2793. BEGIN
    2794. IF LO$P[0]
    2795. THEN # PARTIAL LISTING #
    2796. BEGIN
    2797. LISTFETP = OUT$FETP;
    2798. PX$FETP = 0;
    2799. END
    2800.  
    2801. ELSE
    2802. BEGIN
    2803. LISTFETP = 0;
    2804. PX$FETP = 0;
    2805. END
    2806.  
    2807. END
    2808.  
    2809. #
    2810. * INITIALIZE *FET* FOR THE FILES USED BY THIS PROCEDURE.
    2811. #
    2812.  
    2813. FETP = LOC(MV$FET[FILEMI]);
    2814. BUFP = LOC(MV$BUF[FILEMI]);
    2815. ZSETFET(FETP,SCR4,BUFP,MVBUFL,SFETL);
    2816. REWIND(MV$FET[FILEMI],RCL); # REWIND SCR4 #
    2817. READ(MV$FET[FILEMI],NRCL);
    2818.  
    2819. FETP = LOC(MV$FET[FILEMO]);
    2820. BUFP = LOC(MV$BUF[FILEMO]);
    2821. ZSETFET(FETP,MVOCOM,BUFP,MVBUFL,SFETL);
    2822.  
    2823. FETP = LOC(MV$FET[FILEAUX]);
    2824. BUFP = LOC(MV$BUF[FILEAUX]);
    2825. ZSETFET(FETP,MVLPROB,BUFP,MVBUFL,SFETL);
    2826.  
    2827. #
    2828. * WRITE HEADER TO COMMUNICATION FILE.
    2829. #
    2830.  
    2831. P<MVPREAM> = LOC(MV$WBUF[0]);
    2832. ZFILL(MVPREAM,MVPRML);
    2833. MVPR$FLNM[0] = MVOCOM;
    2834. BZFILL(MVPR$FLNM[0],TYPFILL"BFILL",6);
    2835. MVPR$DT[0] = CURDT$MV;
    2836. MVPR$LB[0] = MVARG$LB[0];
    2837.  
    2838. WRITEW(MV$FET[FILEMO],MVPREAM[0],MVPRML,FLAG);
    2839.  
    2840. PREVSF = 8;
    2841. EOTDAM = FALSE;
    2842. P<TDAM> = LOC(MV$WBUF[0]);
    2843.  
    2844. RPEJECT(LISTFETP);
    2845. RPLINE(LISTFETP,FILEHDR1,2,38,1);
    2846. RPLINE(LISTFETP,FILEHDR2,42,46,1);
    2847. RPLINE(LISTFETP,FILEHDR3,90,17,0);
    2848. RPLINE(LISTFETP," ",1,1,0);
    2849.  
    2850. SLOWFOR NXTDAM = 0 STEP 1 WHILE NOT EOTDAM
    2851. DO
    2852. BEGIN # NEXT TDAM REQUEST #
    2853. READW(MV$FET[FILEMI],MV$WBUF,MVWBUFL,FLAG);
    2854. IF FLAG NQ 0
    2855. THEN
    2856. BEGIN
    2857. EOTDAM = TRUE;
    2858. TEST NXTDAM;
    2859. END
    2860. #
    2861. * SET OUTPUT FILE.
    2862. #
    2863.  
    2864. IF LO$P[0]
    2865. THEN
    2866. BEGIN
    2867. LISTFETP = OUT$FETP;
    2868. END
    2869.  
    2870. #
    2871. * SEND ALL REQUESTS WITH A DESTAGE TO *SSEXEC*.
    2872. * CALL *MVDOIT* TO PERFORM ALL OTHER REQUESTS.
    2873. #
    2874.  
    2875. IF EXT$DES[0]
    2876. THEN # SEND TO *SSEXEC* #
    2877. BEGIN # DESTAGE FILE #
    2878.  
    2879. #
    2880. * WRITE SELECTED PROCESSING MESSAGE TO OUTPUT FILE FOR
    2881. * FILES TO BE DESTAGED OR DESTAGED AND RELEASED.
    2882. #
    2883.  
    2884. IF EXT$REL[0]
    2885. THEN # DESTAGE AND RELEASE #
    2886. BEGIN
    2887. TDAMFC[0] = TDAMFCODE"DESTRLS";
    2888. SKIP = PX$A[0] OR PX$B[0];
    2889. IF SKIP
    2890. THEN
    2891. BEGIN
    2892. LISTFETP = PX$FETP;
    2893. END
    2894.  
    2895. RPLINE(LISTFETP,MSGDSR,54,20,1);
    2896. MVPRNDT(TDAMLAD[0],TDAMACC[0],EXT$DESV[0],EXT$RELV[0]);
    2897. END
    2898.  
    2899. ELSE # DESTAGE ONLY #
    2900. BEGIN
    2901. TDAMFC[0] = TDAMFCODE"DESTAGE";
    2902. SKIP = PX$B[0];
    2903. IF SKIP
    2904. THEN
    2905. BEGIN
    2906. LISTFETP = PX$FETP;
    2907. END
    2908.  
    2909. RPLINE(LISTFETP,MSGDES,54,20,1);
    2910. MVPRNDT(TDAMLMD[0],TDAMACC[0],EXT$DESV[0],EXT$RELV[0]);
    2911. END
    2912.  
    2913. #
    2914. * WRITE OUTPUT LINE IDENTIFYING FILE.
    2915. #
    2916.  
    2917. TMPC = TDAMPFN[0];
    2918. BZFILL(TMPC,TYPFILL"BFILL",7);
    2919. RPLINE(LISTFETP,TMPC,2,7,1); # PFN #
    2920.  
    2921. TMPC = XCOD(TDAMUI[0]);
    2922. RPLINE(LISTFETP,TMPC,11,10,1); # UI #
    2923.  
    2924. TMPC = XCDD(TDAMFLN[0]);
    2925. RPLINE(LISTFETP,TMPC,21,10,1); # LENGTH IN PRU #
    2926.  
    2927. IF EXT$FTYPE[0] EQ IXIA
    2928. THEN
    2929. BEGIN
    2930. TMPC = "IND.";
    2931. END
    2932.  
    2933. ELSE
    2934. BEGIN
    2935. TMPC = "DIR.";
    2936. END
    2937.  
    2938. RPLINE(LISTFETP,TMPC,11,4,1);
    2939.  
    2940. IF SKIP
    2941. THEN
    2942. BEGIN
    2943. TMPC = "*";
    2944. END
    2945.  
    2946. ELSE
    2947. BEGIN
    2948. TMPC = " ";
    2949. WRITEW(MV$FET[FILEMO],MV$WBUF[0], TDAMLEN,FLAG);
    2950. NFILES = NFILES + 1;
    2951. END
    2952.  
    2953. RPLINE(LISTFETP,TMPC,53,1,0);
    2954. TEST NXTDAM;
    2955. END # DESTAGE FILE #
    2956.  
    2957. #
    2958. * ISSUE CORRECT PROCESSING ACTION TEXT TO THE REPORT LINE.
    2959. * CALL *MVDOIT* IF IT IS OK TO PERFORM THE SELECTED ACTION.
    2960. #
    2961.  
    2962. IF EXT$STG[0]
    2963. THEN
    2964. BEGIN
    2965. IF EXT$CLR[0]
    2966. THEN
    2967. BEGIN
    2968. SKIP = PX$F[0] OR PX$S[0];
    2969. IF SKIP
    2970. THEN
    2971. BEGIN
    2972. LISTFETP = PX$FETP;
    2973. END
    2974.  
    2975. RPLINE(LISTFETP,MSGSCLR,54,20,1);
    2976. END
    2977.  
    2978. ELSE # STAGE ONLY #
    2979. BEGIN
    2980. SKIP = PX$S[0];
    2981. IF SKIP
    2982. THEN
    2983. BEGIN
    2984. LISTFETP = PX$FETP;
    2985. END
    2986.  
    2987. RPLINE(LISTFETP,MSGSTG,54,20,1);
    2988. END
    2989.  
    2990. END
    2991.  
    2992. ELSE # NO STAGE INVOLVED #
    2993. BEGIN
    2994. IF EXT$CLR[0]
    2995. THEN # CLEAR ASA DIRECTLY #
    2996. BEGIN
    2997. SKIP = PX$F[0];
    2998. IF SKIP
    2999. THEN
    3000. BEGIN
    3001. LISTFETP = PX$FETP;
    3002. END
    3003.  
    3004. RPLINE(LISTFETP,MSGCLR,54,20,1);
    3005. END
    3006.  
    3007. ELSE # MUST BE RELEASE #
    3008. BEGIN
    3009. SKIP = PX$A[0];
    3010. IF SKIP
    3011. THEN
    3012. BEGIN
    3013. LISTFETP = PX$FETP;
    3014. END
    3015.  
    3016. RPLINE(LISTFETP,MSGREL,54,20,1);
    3017. MVPRNDT(TDAMLAD[0],TDAMACC[0],EXT$DESV[0],EXT$RELV[0]);
    3018. END
    3019.  
    3020. END
    3021.  
    3022. #
    3023. * WRITE OUTPUT LINE IDENTIFYING FILE.
    3024. #
    3025.  
    3026. TMPC = TDAMPFN[0];
    3027. BZFILL(TMPC,TYPFILL"BFILL",7);
    3028. RPLINE(LISTFETP,TMPC,2,7,1); # PFN #
    3029.  
    3030. TMPC = XCOD(TDAMUI[0]);
    3031. RPLINE(LISTFETP,TMPC,11,10,1); # UI #
    3032.  
    3033. TMPC = XCDD(TDAMFLN[0]);
    3034. RPLINE(LISTFETP,TMPC,21,10,1); # LENGTH IN PRU #
    3035.  
    3036. IF EXT$FTYPE[0] EQ IXIA
    3037. THEN
    3038. BEGIN
    3039. TMPC = "IND.";
    3040. END
    3041.  
    3042. ELSE
    3043. BEGIN
    3044. TMPC = "DIR.";
    3045. END
    3046.  
    3047. RPLINE(LISTFETP,TMPC,11,4,1);
    3048.  
    3049. IF SKIP
    3050. THEN
    3051. BEGIN
    3052. TMPC = "*";
    3053. END
    3054.  
    3055. ELSE
    3056. BEGIN
    3057. TMPC = " ";
    3058. MVDOIT;
    3059. END
    3060.  
    3061. RPLINE(LISTFETP,TMPC,53,1,0);
    3062.  
    3063. TEST NXTDAM;
    3064. END # NEXT TDAM REQUEST #
    3065.  
    3066. WRITER(MV$FET[FILEMO],RCL);
    3067. WRITER(MV$FET[FILEAUX],RCL);
    3068. RETERN(MV$FET[FILEMO],RCL);
    3069. RETERN(MV$FET[FILEMI],RCL);
    3070. RETERN(MV$FET[FILEAUX],RCL);
    3071.  
    3072. #
    3073. * ISSUE FIRST CALL TO *MVRPTDS* TO PRODUCE THE REPORT PAGE
    3074. * SUMMARIZING THE STATUS OF EACH DEVICE AND SUBFAMILY.
    3075. #
    3076.  
    3077. MVRPTDS(0);
    3078.  
    3079. END
    3080.  
    3081. TERM
    3082. PROC MVPFRD;
    3083. # TITLE MVPFRD - READ PFC. #
    3084.  
    3085. BEGIN # MVPFRD #
    3086.  
    3087. #
    3088. ** MVPFRD - READ PFC.
    3089. *
    3090. * THIS PROCEDURE READS THE PFC, CREATES THE PASS 1 OUTPUT
    3091. * FILE AND DETERMINES THE AMOUNT OF DISK SPACE TO BE
    3092. * RELEASED ON EACH DEVICE.
    3093. *
    3094. * PROC MVPFRD.
    3095. *
    3096. * EXIT. PASS 1 OUTPUT FILE SET UP.
    3097. *
    3098. * MESSAGES. INCORRECT DEVICE INDEX.
    3099. *
    3100. * NOTES. PERMANENT FILES ARE INCLUDED IN THE PASS 1
    3101. * OUTPUT FILE IF THEY MEET ANY OF THE FOLLOWING..
    3102. *
    3103. * 1) ARE SELECTED BY THE *SF* DIRECTIVE AND
    3104. * THE SPECIFIED PROCESSING IS VALID TO DO.
    3105. *
    3106. * 2) HAVE THE FREE-FILE (AFFRE) FLAG SET IN THE
    3107. * *PFC* ENTRY FOR THE FILE WHEN THE FILE HAS
    3108. * A NON-ZERO *ASA* VALUE.
    3109. *
    3110. * 3) IF THE FILE SATISFIES THE DESTAGE CRITERIA.
    3111. *
    3112. * 4) IF THE FILE IS A CANDIDATE TO BE RELEASED.
    3113. #
    3114.  
    3115. #
    3116. **** PROC MVPFRD - XREF LIST BEGIN.
    3117. #
    3118.  
    3119. XREF
    3120. BEGIN
    3121. PROC BZFILL; # BLANK/ZERO FILL CHARACTER ITEM #
    3122. PROC GETDI; # GET DEVICE INHIBIT DATE/TIME #
    3123. PROC GETPFC; # GET NEXT PFC ENTRY #
    3124. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
    3125. PROC MVCKSF; # SEARCH FOR SELECTED FILES #
    3126. PROC MVVALDS; # CALCULATE DESTAGE VALUE #
    3127. PROC MVVALRL; # CALCULATE RELEASE VALUE #
    3128. PROC RETERN; # RETURNS A FILE #
    3129. PROC REWIND; # REWINDS A FILE #
    3130. PROC UATTACH; # UTILITY ATTACH #
    3131. PROC WRITER; # WRITES EOR ON A FILE #
    3132. PROC WRITEW; # DATA TRANSFER ROUTINE #
    3133. PROC XWOD; # CONVERT OCTAL TO DISPLAY #
    3134. PROC ZFILL; # ZERO FILL ARRAY #
    3135. PROC ZSETFET; # SETS UP A FET #
    3136. END
    3137.  
    3138. #
    3139. **** PROC MVPFRD - XREF LIST END.
    3140. #
    3141.  
    3142. DEF LISTCON #0#; # DO NOT LIST COMDECKS #
    3143. *CALL,COMBFAS
    3144. *CALL COMBSIT
    3145. *CALL,COMBBZF
    3146. *CALL,COMBTDM
    3147. *CALL,COMSPFM
    3148. *CALL,COMTCTW
    3149. *CALL,COMTMOV
    3150. *CALL,COMTMVD
    3151. *CALL,COMTMVP
    3152.  
    3153. ITEM DISKIMAGE B; # TRUE IF DISK IMAGE EXISTS #
    3154. ITEM EOPFC B; # END OF PFC INDICATOR #
    3155. ITEM FAM C(10); # FAMILY NAME #
    3156. ITEM FLAG I; # ERROR STATUS #
    3157. ITEM GOAL I; # DESIRED PRU ON DISK #
    3158. ITEM I I; # LOOP INDUCTION VARIABLE #
    3159. ITEM INHBDT U; # DEVICE INHIBIT DATE/TIME #
    3160. ITEM LFNAME C(10); # LOCAL FILE NAME #
    3161. ITEM MV$DNX I; # SPECIFIED DEVICE INDEX #
    3162. ITEM NOREL B; # LEGALITY OF RELEASING FILE #
    3163. ITEM NUMMSS I; # NUMBER OF MSS IMAGES #
    3164. ITEM NXTPFC I; # FILE COUNTER #
    3165. ITEM PEOCNT I; # PFC ORDINAL #
    3166. ITEM PFNAME C(10); # PERMANENT FILE NAME #
    3167. ITEM PO C(1); # PROCESSING OPTION #
    3168. ITEM RES I; # FILE RESIDENCE CODE #
    3169. ITEM TMPI I; # TEMPORARY #
    3170.  
    3171. ARRAY SCR$FET [0:0] S(SFETL);; # SCRATCH FET #
    3172.  
    3173. ARRAY ERRMSG [0:0] P(3); ; # *PFM* ERROR MESSAGES #
    3174.  
    3175. ARRAY DISASA [0:0] S(2);
    3176. BEGIN
    3177. ITEM DIS$ASA C(00,48,12); # ASA IN DISPLAY CODE #
    3178. END
    3179.  
    3180. ARRAY MSG1 [0:0] S(3); # *PFC* ERROR INFORMATION #
    3181. BEGIN
    3182. ITEM MSG1$SP C(00,00,03) = [" "];
    3183. ITEM MSG1$FN C(00,18,07); # FILE NAME #
    3184. ITEM MSG1$TXT C(01,00,08) = [" ASA = "];
    3185. ITEM MSG1$ASA C(01,48,12); # ALTERNATE STORAGE ADDRESS #
    3186. END
    3187. CONTROL EJECT;
    3188.  
    3189. #
    3190. * SET UP FET FOR PASS 1 OUTPUT FILE.
    3191. #
    3192.  
    3193. FETP = LOC(MV$FET[FILEMO]);
    3194. BUFP = LOC(MV$BUF[FILEMO]);
    3195. ZSETFET(FETP,SCR1,BUFP,MVBUFL,SFETL);
    3196. RETERN(MV$FET[FILEMO],RCL);
    3197.  
    3198. FAM = MVARG$FM[0];
    3199. LFNAME = "SCR"; # LOCAL FILE NAME #
    3200. BZFILL(LFNAME,TYPFILL"ZFILL",10);
    3201. BZFILL(FAM,TYPFILL"ZFILL",10);
    3202.  
    3203. #
    3204. * READ PFC.
    3205. #
    3206.  
    3207. P<TDAM> = LOC(MV$WBUF[0]);
    3208. P<EXT$TDAM> = LOC(MV$WBUF[0]) + TDAMLEN;
    3209. EOPFC = FALSE;
    3210. EXT$PAZ[0] = 0;
    3211.  
    3212. #
    3213. * DETERMINE THE INDEX OF THE SPECIFIED DEVICE.
    3214. #
    3215.  
    3216. IF MVARG$DN[0] EQ 0
    3217. THEN # NO DEVICE SPECIFIED #
    3218. BEGIN
    3219. MV$DNX = 0;
    3220. END
    3221.  
    3222. ELSE
    3223. BEGIN
    3224. MV$DNX = DN$TO$DNX[MVARG$DN[0]];
    3225. END
    3226.  
    3227. #
    3228. * THE MAIN LOGIC OF THIS ROUTINE IS IN THE FOLLOWING LOOP.
    3229. * PROCESSING FOR EACH FILE OCCURS DURING TWO TRIPS THROUGH
    3230. * THIS LOOP. THE TOP OF THE LOOP COMPLETES PROCESSING FOR
    3231. * A FILE. THE BOTTOM OF THE LOOP INITIATES FILE PROCESSING.
    3232. * THE FOLLOWING STEPS COMPRISE THE LOGIC OF THIS MAIN LOOP.
    3233. *
    3234. * 1) (TOP OF THE LOOP).. WRITE THE FILE ENTRY TO THE PASS 1
    3235. * OUTPUT FILE IF ANY PROCESSING ACTION FLAGS WERE SET
    3236. * WHEN THE FILE WAS ANALYZED DURING THE BOTTOM PART
    3237. * OF THE PREVIOUS EXECUTION OF THIS LOOP.
    3238. *
    3239. * 2) GET THE PFC ENTRY FOR THE NEXT FILE TO BE ANALYZED BY
    3240. * THE REST OF THIS LOOP. ESTABLISH THE FILE TYPE, SUBFAMILY
    3241. * AND DEVICE NUMBER INDICES.
    3242. *
    3243. * 3) GET THE FILE LENGTH, IF NECESSARY.
    3244. *
    3245. * 4) DETERMINE THE RESIDENCE OF THE FILE AND UPDATE DEVICE
    3246. * AND SUBFAMILY STATISTICS ACCORDINGLY.
    3247. *
    3248. * 5) IGNORE THE FILE IF IT IS EXCLUDED FROM PROCESSING DUE
    3249. * TO RUN-TIME PARAMETERS OR IF IT HAS A SPECIAL USER INDEX.
    3250. *
    3251. * 6) SELECT PROCESSING ACTIONS AS CONTROLLED BY THE *SF,FN=..*
    3252. * DIRECTIVE OR THE *AFFREE* FLAG IN THE PFC ENTRY.
    3253. *
    3254. * 7) EVALUATE THE DESTAGE AND RELEASE FORMULAS AND SET
    3255. * THE APPROPRIATE PROCESSING ACTION FLAGS.
    3256. #
    3257.  
    3258. SLOWFOR NXTPFC = 0 STEP 1 WHILE NOT EOPFC
    3259. DO # FINISH PROCESSING OLD PFC ENTRY,
    3260.   THEN START NEW ONE #
    3261. BEGIN # NEXT PFC #
    3262. IF EXT$PA[0] NQ 0
    3263. THEN # SAVE ENTRY FOR NEXT STEP OF
    3264.   ANALYSIS #
    3265. BEGIN
    3266. TDAMFLN[0] = PFC$LF[0];
    3267. TDAMASA[0] = PFC$AA[0];
    3268. TDAMAT[0] = PFC$AT[0];
    3269. TDAMPFN[0] = PFC$FN[0];
    3270. TDAMUI[0] = PFC$UI[0];
    3271. TDAMSBF[0] = PFC$SF[0];
    3272. TDAMFAM[0] = MVARG$FM[0];
    3273. TDAMCDT[0] = PFC$CD[0];
    3274. TDAMAL[0] = PFC$AL[0];
    3275. TDAMFFF[0] = PFC$AFFRE[0];
    3276. TDAMFFF[0] = PFC$AFFRE[0];
    3277. EXT$AFOBS[0] = PFC$AFOBS[0];
    3278. EXT$RES[0] = RES;
    3279. EXT$FTYPE[0] = FTYPE;
    3280.  
    3281. #
    3282. * SAVE DATES AND ACCESS COUNT FOR THE REPORT FILE.
    3283. #
    3284.  
    3285. TDAMLMD[0] = PFC$MDD[0];
    3286. TDAMLAD[0] = PFC$ADD[0];
    3287. TDAMACC[0] = PFC$AC[0];
    3288.  
    3289. WRITEW(MV$FET[FILEMO],MV$WBUF[0],MVWBUFL,FLAG);
    3290. END
    3291.  
    3292. ZFILL(EXT$TDAM,3); # CLEAR FOR NEXT FILE #
    3293. FLAG = 0;
    3294. GETPFC(PEOCNT, FLAG);
    3295. IF FLAG NQ OK
    3296. THEN
    3297. BEGIN
    3298. EOPFC = TRUE;
    3299. TEST NXTPFC;
    3300. END
    3301.  
    3302. #
    3303. * ESTABLISH FILE TYPE, SUBFAMILY AND DEVICE NUMBER INDICES.
    3304. #
    3305.  
    3306. IF PFC$DA[0]
    3307. THEN
    3308. BEGIN
    3309. FTYPE = IXDA;
    3310. END
    3311.  
    3312. ELSE
    3313. BEGIN
    3314. FTYPE = IXIA;
    3315. END
    3316.  
    3317. TDAMIA[0] = NOT PFC$DA[0];
    3318. SFX = PFC$SF[0];
    3319.  
    3320. IF PFC$EO[0] EQ 0
    3321. THEN
    3322. BEGIN
    3323. DNX = DN$TO$DNX[CNTR$DN[0]];
    3324. END
    3325.  
    3326. ELSE
    3327. BEGIN
    3328. DNX = DN$TO$DNX[PFC$EO[0]];
    3329. END
    3330.  
    3331. EXT$DNX[0] = DNX;
    3332. TDAMDN[0] = CNTR$DN[0];
    3333.  
    3334. #
    3335. * ISSUE DAYFILE MESSAGE IF ILLEGAL DEVICE INDEX.
    3336. #
    3337.  
    3338. IF DNX EQ 0
    3339. THEN # IGNORE FILE #
    3340. BEGIN
    3341. MVMSG$LN[0] = " INCORRECT DEVICE INDEX.";
    3342. MESSAGE(MVMSG[0],UDFL1);
    3343. TEST NXTPFC;
    3344. END
    3345.  
    3346. #
    3347. * SET UP PFID AND GET FILE LENGTH, IF NECESSARY.
    3348. #
    3349.  
    3350. TDAMPEO[0] = PEOCNT;
    3351. TDAMTRACK[0] = CNTR$TRK[0];
    3352. TDAMSECTOR[0] = CNTR$SEC[0];
    3353.  
    3354. IF PFC$LF[0] EQ 0 AND PFC$DA[0] ##
    3355. AND(PFC$UI[0] LS DEF$UI OR PFC$UI[0] GR DEF$UI+7)
    3356. THEN # GET FILE LENGTH #
    3357. BEGIN
    3358. PFNAME = PFC$FN[0];
    3359. BZFILL(PFNAME,TYPFILL"ZFILL",10);
    3360. UATTACH(LFNAME,FLAG,6,PFNAME,PTRD,PFC$UI[0],FAM, ##
    3361. TDAMPFID[0],PFC[0],PFC$CD[0],LOC(ERRMSG));
    3362. FETP = LOC(SCR$FET[0]);
    3363. ZSETFET(FETP,LFNAME,0,0,SFETL);
    3364. RETERN(SCR$FET[0],RCL); # RETURN THE FILE #
    3365. END
    3366.  
    3367. #
    3368. * CALCULATE RESIDENCE OF THE FILE AND UPDATE
    3369. * DEVICE OR SUBFAMILY STATISTICS ACCORDINGLY.
    3370. *
    3371. * DO NOT EXCLUDE ANY FILE HAVING *AFFRE* FLAG SET
    3372. * INCLUDING FILES LOCKED TO DISK AND FILES WITH AN
    3373. * OBSOLETE MSAS COPY.
    3374. #
    3375.  
    3376. DISKIMAGE = (PFC$BT[0] NQ 0);
    3377. NUMMSS = 0;
    3378. IF PFC$AA[0] NQ 0
    3379. THEN # OBSOLETE COPY #
    3380. BEGIN
    3381. IF (PFC$AFOBS[0] AND NOT PFC$AFFRE[0])
    3382. THEN
    3383. BEGIN
    3384. NUMMSS = 0;
    3385. END
    3386.  
    3387. ELSE
    3388. BEGIN
    3389. NUMMSS = 1;
    3390. END
    3391.  
    3392. END
    3393.  
    3394. IF NUMMSS NQ 0 AND NOT DISKIMAGE
    3395. THEN # FILE RELEASED #
    3396. BEGIN
    3397. RES = RESIDENCE"RES$M86";
    3398. SFRL$NF[FTYPE,SFX] = SFRL$NF[FTYPE,SFX] + 1;
    3399. SFRL$PRU[FTYPE,SFX] = SFRL$PRU[FTYPE,SFX] + PFC$LF[0];
    3400. SFDM$NF[FTYPE,SFX] = SFDM$NF[FTYPE,SFX] + 1;
    3401. SFDM$PRU[FTYPE,SFX] = SFDM$PRU[FTYPE,SFX] + PFC$LF[0];
    3402. END
    3403.  
    3404. IF DISKIMAGE
    3405. THEN # FILE ON DISK #
    3406. BEGIN
    3407. RES = RESIDENCE"RES$RMS";
    3408. DEV$NF[FTYPE,DNX] = DEV$NF[FTYPE,DNX] + 1;
    3409. DEV$TRPRU[FTYPE,DNX] = DEV$TRPRU[FTYPE,DNX] + PFC$LF[0];
    3410. IF FTYPE EQ IXIA
    3411. THEN
    3412. BEGIN
    3413. DEV$PRU[FTYPE,DNX] = DEV$PRU[FTYPE,DNX] + PFC$LF[0];
    3414. END
    3415.  
    3416. ELSE
    3417. BEGIN
    3418. PRUTRK = DEV$SECTR[IXDA,DNX];
    3419. TRUPRU = (((PFC$LF[0] + 1) / PRUTRK) + 1) * PRUTRK;
    3420. DEV$PRU[FTYPE,DNX] = DEV$PRU[FTYPE,DNX] + TRUPRU;
    3421. END
    3422.  
    3423. IF NUMMSS NQ 0
    3424. THEN # FILE ALSO ON MSAS #
    3425. BEGIN
    3426. RES = RESIDENCE"RES$RMS$MF";
    3427. SFDM$NF[FTYPE,SFX] = SFDM$NF[FTYPE,SFX] + 1;
    3428. SFDM$PRU[FTYPE,SFX] = SFDM$PRU[FTYPE,SFX] + PFC$LF[0];
    3429. END
    3430.  
    3431. END
    3432.  
    3433. IF FTYPE EQ IXDA
    3434. AND PFC$LF[0] NQ 0
    3435. THEN # IGNORE SYSTEM SECTOR #
    3436. BEGIN
    3437. PFC$LF[0] = PFC$LF[0] - 1;
    3438. END
    3439.  
    3440. #
    3441. * SEE IF THE FILE IS TO BE EXCLUDED DUE TO RUN-TIME PARAMETERS
    3442. * (PX, UI OPTIONS), IF THE FILE IS IN A RESERVED USER INDEX,
    3443. * OR IF IT IS LOCKED TO DISK.
    3444. #
    3445.  
    3446. IF (PFC$DA[0] AND PX$D[0] ) # DIRECT ACCESS FILE #
    3447. OR ( NOT PFC$DA[0] AND PX$I[0] ) # INDIRECT ACCESS FILE #
    3448.  
    3449. OR ( MVARG$UI[0] NQ 0 # NOT THE SELECTED #
    3450. AND PFC$UI[0] NQ MVARG$UI[0] ) # USER INDEX #
    3451.  
    3452. OR ( PFC$UI[0] GQ DEF$UI # MSS USER INDICES #
    3453. AND PFC$UI[0] LQ DEF$UI+7 ) ##
    3454.  
    3455. OR ( PFC$UI[0] EQ SYS$UI ) # SYSTEM USER INDEX #
    3456.  
    3457. OR (PFC$UI[0] EQ FPF$UI) # FLAWPF USER INDEX #
    3458.  
    3459. OR ( PFC$RS[0] EQ RSLK # FILE LOCKED TO DISK #
    3460. AND NOT PFC$AFFRE[0])
    3461.  
    3462. THEN # DO NOT CONSIDER THIS FILE FOR
    3463.   FURTHER PROCESSING #
    3464. BEGIN
    3465. TEST NXTPFC;
    3466. END
    3467.  
    3468. #
    3469. * PROCESS THE SPECIAL FLAGS (*PO* OR FREE-UP FLAG IN *PFC*)
    3470. * AS FOLLOWS..
    3471. *
    3472. * 1) PO=F (FREE FILE FROM CARTRIDGE)
    3473. * IF THE ASA NQ 0 THEN SET *CLR*. ALLOW FILE TO
    3474. * BE SELECTED TO BE STAGED.
    3475. *
    3476. * 2) PO=A (ARCHIVE OR RELEASE FROM DISK)
    3477. * FORCE RELEASE BY SETTING *REL* UNLESS THE FILE
    3478. * IS ALREADY ARCHIVED. THE CHECK TO VERIFY THAT
    3479. * THE *BR=Y* REQUIREMENT IS MET IS MADE FURTHER ON.
    3480. *
    3481. * 3) PO=S OR *CLR* OR PFC$AFFRE SET (STAGE TO DISK)
    3482. * FORCE THE FILE TO BE STAGED TO DISK BY SETTING
    3483. * *STG* UNLESS THE FILE IS ALREADY ON DISK. SET
    3484. * *NOREL* TO PROHIBIT THE FILE FROM BEING RELEASED
    3485. * FROM DISK. IF THE FREE FILE FLAG IS SET IN THE
    3486. * *PFC* STAGER WILL CLEAR THE *ASA* AFTER STAGING
    3487. * THE FILE TO DISK.
    3488. *
    3489. * 4) PO=B (BACKUP OR DESTAGE TO MSAS)
    3490. * SET THE *DES* FLAG IF THE FILE RESIDES ON DISK ONLY.
    3491. #
    3492.  
    3493. MVCKSF(PFC$FN[0],PFC$UI[0],PO); # SEE IF FILE SELECTED #
    3494.  
    3495. EXT$CLR[0] = (PFC$AA[0] NQ 0) # CASE 1 #
    3496. AND ((RES EQ RESIDENCE"RES$RMS$MF" AND PFC$AFFRE[0])
    3497. OR (PO EQ "F"));
    3498.  
    3499. EXT$REL[0] = (PO EQ "A") # CASE 2 #
    3500. AND (RES NQ RESIDENCE"RES$M86");
    3501.  
    3502. EXT$STG[0] = (PO EQ "S" OR EXT$CLR[0] OR PFC$AFFRE[0]) ##
    3503. AND (RES EQ RESIDENCE"RES$M86");
    3504. NOREL = EXT$STG[0] OR EXT$CLR[0];
    3505.  
    3506. #
    3507. * IF ERROR FLAGS ARE SET IN THE *PFC* DO NOT ALLOW THE FILE
    3508. * TO BE STAGED.
    3509. #
    3510.  
    3511. IF EXT$STG[0]
    3512. THEN
    3513. BEGIN # CHECK *PFC* FOR ERRORS #
    3514. IF PFC$AFPDE[0] # DATA ERROR #
    3515. OR PFC$AFPSE[0] # SYSTEM ERROR #
    3516. OR PFC$AFTMP[0] # TEMPORARY ERROR #
    3517. THEN
    3518. BEGIN
    3519. MSG1$FN[0] = PFC$FN[0];
    3520. XWOD(PFC$AA[0],DISASA);
    3521. MSG1$ASA[0] = DIS$ASA[0];
    3522. MVMSG$LN[0] = " PFC ERROR FLAGS SET";
    3523. MESSAGE(MVMSG[0],UDFL1);
    3524. MESSAGE(MSG1[0],UDFL1);
    3525. EXT$STG[0] = FALSE; # PROHIBIT STAGING #
    3526. EXT$CLR[0] = FALSE;
    3527. TEST NXTPFC;
    3528. END
    3529. END # CHECK *PFC* FOR ERRORS #
    3530.  
    3531. #
    3532. * IF THE FILE RESIDES ON DISK, SELECT IT TO BE DESTAGED IF
    3533. * SPECIFIED BY THE FILE-S *PO* ATTRIBUTE, OR IF ITS DESTAGE
    3534. * VALUE EXCEEDS THE THRESHOLD.
    3535. #
    3536.  
    3537. IF RES EQ RESIDENCE"RES$RMS"
    3538. THEN # SELECT DESTAGE IF APPROPRIATE #
    3539. BEGIN
    3540. IF PO EQ "B"
    3541. THEN # CASE 4 #
    3542. BEGIN
    3543. EXT$DES[0] = TRUE;
    3544. END
    3545.  
    3546. ELSE # CALCULATE DESTAGE VALUE AND
    3547.   COMPARE TO THRESHOLD #
    3548. BEGIN
    3549. MVVALDS(TMPI,PO); # CALCULATE DESTAGE VALUE #
    3550. EXT$DES[0] = TMPI GQ FR$VAL[FTYPE,IXDS,FRTH];
    3551. EXT$CDES[0] = NOT EXT$DES[0]; # IN CASE FILE IS RELEASED #
    3552. EXT$DESV[0] = TMPI;
    3553. END
    3554.  
    3555. END
    3556.  
    3557. #
    3558. * CHECK TO SEE IF THE FILE CAN BE RELEASED.
    3559. * - VERIFY *BR=Y* REQUIREMENT SATISFIED.
    3560. * - VERIFY *DN* PARAMETER SATISFIED.
    3561. * - VERIFY FILE NOT ALREADY SELECTED FOR RELEASE.
    3562. * - CALCULATE RELEASE VALUE AND IF GREATER THAN
    3563. * THE THRESHOLD, SAVE IT FOR FUTURE USE IN
    3564. * SELECTING AMONG THE CANDIDATE FILES.
    3565. #
    3566.  
    3567. #
    3568. * IF A DUMP TAPE BACKUP IS REQUIRED, PROHIBIT
    3569. * RELEASING THE FILE.
    3570. #
    3571.  
    3572. GETDI(CNTR$EQ[0],INHBDT); # GET DEVICE INHIBIT DATE/TIME #
    3573. IF PFC$BR[0] EQ BRAL AND INHBDT LQ PFC$UD[0]
    3574. THEN # PROHIBIT RELEASING THE FILE #
    3575. BEGIN
    3576. EXT$REL[0] = FALSE;
    3577. NOREL = TRUE;
    3578. END
    3579.  
    3580. IF EXT$REL[0]
    3581. THEN # COUNT PRU TO BE RELEASED #
    3582. BEGIN
    3583. DEV$RELF[FTYPE,DNX] = DEV$RELF[FTYPE,DNX] + 1;
    3584. DEV$TRPRU[FTYPE,DNX] = DEV$TRPRU[FTYPE,DNX] - PFC$LF[0];
    3585. IF FTYPE EQ IXIA
    3586. THEN
    3587. BEGIN
    3588. DEV$RELP[FTYPE,DNX] = DEV$RELP[FTYPE,DNX] + PFC$LF[0];
    3589. END
    3590.  
    3591. ELSE
    3592. BEGIN
    3593. PRUTRK = DEV$SECTR[IXDA,DNX];
    3594. TRUPRU = (((PFC$LF[0]+1) / PRUTRK) + 1) * PRUTRK;
    3595. DEV$RELP[FTYPE,DNX] = DEV$RELP[FTYPE,DNX] + TRUPRU;
    3596. END
    3597.  
    3598. TEST NXTPFC;
    3599. END
    3600.  
    3601. IF MV$DNX NQ 0 ##
    3602. AND MV$DNX NQ DNX # FAILS *DN* PARAMETER #
    3603. THEN # DO NOT CONSIDER FILE FOR
    3604.   DESTAGING OR RELEASING #
    3605. BEGIN
    3606. EXT$DES[0] = FALSE; # DO NOT DESTAGE #
    3607. TEST NXTPFC;
    3608. END
    3609.  
    3610. IF NOREL
    3611. THEN # DO NOT RELEASE #
    3612. BEGIN
    3613. TEST NXTPFC;
    3614. END
    3615.  
    3616. IF RES NQ RESIDENCE"RES$M86"
    3617. THEN
    3618. BEGIN
    3619. MVVALRL(TMPI,PO); # CALCULATE RELEASE VALUE #
    3620. EXT$CREL[0] = TMPI GQ FR$VAL[FTYPE,IXRL,FRTH];
    3621. EXT$RELV[0] = TMPI;
    3622. TEST NXTPFC;
    3623. END
    3624.  
    3625. END # NEXT PFC #
    3626.  
    3627. #
    3628. * AFTER PROCESSING ALL FILES,
    3629. * - FLUSH THE PASS 1 OUTPUT BUFFER TO DISK.
    3630. * - CALCULATE THE AMOUNT OF DISK SPACE NEEDED
    3631. * TO BE RELEASED ON EACH DEVICE.
    3632. #
    3633.  
    3634. WRITER(MV$FET[FILEMO],RCL);
    3635. REWIND(MV$FET[FILEMO],RCL);
    3636.  
    3637. #
    3638. * CALCULATE THE NUMBER OF PRU TO BE RELEASED ON EACH DEVICE.
    3639. #
    3640.  
    3641. SLOWFOR I = 1 STEP 1 UNTIL MAXDEV
    3642. DO
    3643. BEGIN # EACH DEVICE #
    3644. IF DEV$MAST[IXIA,I]
    3645. THEN # USE MASTER DEVICE GOALS #
    3646. BEGIN
    3647. TMPI = SMMG;
    3648. END
    3649.  
    3650. ELSE # USE SECONDARY DEVICE GOALS #
    3651. BEGIN
    3652. TMPI = SMSG;
    3653. END
    3654.  
    3655. SLOWFOR FTYPE = IXDA STEP IXIA-IXDA UNTIL IXIA
    3656. DO
    3657. BEGIN
    3658.  
    3659. GOAL = SM$VAL[FTYPE,IXRL,TMPI]*DEV$TPRU[IXIA,I]/100;
    3660. DEV$NEED[FTYPE,I] = ##
    3661. DEV$PRU[FTYPE,I] - GOAL - DEV$RELP[FTYPE,I];
    3662. END
    3663.  
    3664. END # EACH DEVICE #
    3665.  
    3666. RETURN;
    3667.  
    3668. END # MVPFRD #
    3669.  
    3670. TERM
    3671. PROC MVPRNDT(PDATE,ACC$CT,DVAL,RVAL);
    3672. # TITLE MVPRNDT - PRINT DATE AND ACCESS COUNTS. #
    3673.  
    3674. BEGIN # MVPRNDT #
    3675.  
    3676. #
    3677. ** MVPRNDT - PRINT DATE AND ACCESS COUNTS.
    3678. *
    3679. * THIS PROCEDURE PRINTS THE DATE AND THE ACCESS COUNT FOR
    3680. * A FILE ON THE REPORT FILE.
    3681. *
    3682. * PROC MVPRNDT.
    3683. *
    3684. * ENTRY. PDATE = *YYMMDD*.
    3685. * ACC$CT = ACCESS COUNT.
    3686. *
    3687. * EXIT. COL. 33-40 CONTAIN *YY.MM.DD*.
    3688. * COL. 42-48 CONTAIN ACCESS COUNT.
    3689. #
    3690.  
    3691. ITEM PDATE C(10); # PACKED DATE #
    3692. ITEM ACC$CT I; # ACCESS COUNT #
    3693. ITEM DVAL U; # CALCULATED DESTAGE VALUE #
    3694. ITEM RVAL U; # CALCULATED RELEASE VALUE #
    3695.  
    3696. #
    3697. **** PROC MVPRNDT - XREF LIST BEGIN.
    3698. #
    3699.  
    3700. XREF
    3701. BEGIN
    3702. PROC RPLINE; # WRITE LINE #
    3703. FUNC XCDD C(10); # BINARY TO DECIMAL DISPLAY #
    3704. END
    3705.  
    3706. #
    3707. **** PROC MVPRNDT - XREF LIST END.
    3708. #
    3709.  
    3710. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    3711.  
    3712. *CALL,COMBFAS
    3713. *CALL,COMTMOV
    3714.  
    3715. ITEM TMPC C(10); # TEMPORARY CHARACTER #
    3716. CONTROL EJECT;
    3717. TMPC = XCDD(ACC$CT);
    3718. RPLINE(LISTFETP,TMPC,40,10,1); # WRITE ACCESS COUNT #
    3719.  
    3720. RPLINE(LISTFETP,"YY.MM.DD",34,8,1);
    3721.  
    3722. CHR$10[0] = XCDD(70+B<42,6>PDATE); # YEAR #
    3723. RPLINE(LISTFETP,CHR$R2[0],34,2,1);
    3724.  
    3725. #
    3726. * FORCE LEADING ZERO ON DAY AND MONTH BY ADDING 100.
    3727. #
    3728.  
    3729. CHR$10[0] = XCDD(100+B<48,6>PDATE); # MONTH #
    3730. RPLINE(LISTFETP,CHR$R2[0],37,2,1);
    3731.  
    3732. CHR$10[0] = XCDD(100+B<54,6>PDATE); # DATE #
    3733. RPLINE(LISTFETP,CHR$R2[0],40,2,1);
    3734.  
    3735. IF DVAL GQ 0
    3736. THEN
    3737. BEGIN
    3738. CHR$10[0] = XCDD(DVAL);
    3739. RPLINE(LISTFETP,CHR$10[0],87,10,1);
    3740. END
    3741.  
    3742. ELSE # NEGATIVE VALUE #
    3743. BEGIN
    3744. RPLINE(LISTFETP,"-1",95,2,1);
    3745. END
    3746.  
    3747. IF RVAL GQ 0
    3748. THEN
    3749. BEGIN
    3750. CHR$10[0] = XCDD(RVAL);
    3751. RPLINE(LISTFETP,CHR$10[0],98,10,1);
    3752. END
    3753.  
    3754. ELSE # NEGATIVE VALUE #
    3755. BEGIN
    3756. RPLINE(LISTFETP,"-1",106,2,1);
    3757. END
    3758.  
    3759.  
    3760. RETURN;
    3761. END # MVPRNDT #
    3762.  
    3763. TERM
    3764. FUNC MVRELAG(RELDATE) U;
    3765. # TITLE MVRELAG - CALCULATE RELATIVE AGE. #
    3766.  
    3767. BEGIN # MVRELAG #
    3768.  
    3769. #
    3770. ** MVRELAG - CALCULATE RELATIVE AGE.
    3771. *
    3772. * THIS FUNCTION CALCULATES THE RELATIVE AGE OF AN ITEM
    3773. * GIVEN A DATE IN PACKED FORMAT. THIS AGE IS THE NUMBER
    3774. * OF DAYS SINCE JAN 01, 1970.
    3775. * THE ABSOLUTE AGE OF AN ITEM IS CALCULATED BY THE CALLING
    3776. * PROGRAMS WHICH SUBTRACT THE RELATIVE AGE OF THE ITEM
    3777. * FROM THE RELATIVE AGE OF THE CURRENT DATE.
    3778. * IF THE DIFFERENCE BETWEEN THE CURRENT DATE AND THE
    3779. * LAST ACCESS DATE OR MODIFY DATE IS LESS THAN 30 DAYS,
    3780. * THEIR DIFFERENCE AS CALCULATED BY THIS FUNCTION WILL
    3781. * BE CALCULATED CORRECTLY. IF THE DIFFERENCE IS MORE
    3782. * THAN 30 DAYS, THEN A 1 DAY ERROR MAY BE INTRODUCED.
    3783. * IT IS ASSUMED THAT A 3 PERCENT ERROR IS NOT OF CONCERN
    3784. * FOR THE PURPOSES OF *SSMOVE*.
    3785. *
    3786. * FUNC MVRELAG( (RELDATE) ).
    3787. *
    3788. * ENTRY. RELDATE = *YYMMDD* OF AN OBJECT.
    3789. *
    3790. * EXIT. MVRELAG = NUMBER OF DAYS SINCE 70/01/01.
    3791. #
    3792.  
    3793. ITEM RELDATE C(10); # *YYMMDD* #
    3794.  
    3795.  
    3796. ITEM DAY U; # *DD* FROM *RELDATE* #
    3797. ITEM MONTH U; # *MM* FROM *RELDATE* #
    3798. ITEM TMPI I; # TEMPORARY #
    3799. ITEM YEAR U; # *YY* FROM *RELDATE* #
    3800.  
    3801. ARRAY MONTHS [1:12] S(1); # TOTAL DAYS IN PREVIOUS MONTHS #
    3802. BEGIN
    3803. ITEM MON$TOT I(00,00,60) = [ ##
    3804. 0,
    3805. 31,
    3806. 59,
    3807. 90,
    3808. 120,
    3809. 151,
    3810. 181,
    3811. 212,
    3812. 243,
    3813. 273,
    3814. 304,
    3815. 334];
    3816. END
    3817.  
    3818. CONTROL EJECT;
    3819. YEAR = B<42,6>RELDATE;
    3820. MONTH = B<48,6>RELDATE;
    3821. DAY = B<54,6>RELDATE;
    3822.  
    3823. TMPI = YEAR*365 + MON$TOT[MONTH] + DAY;
    3824.  
    3825. IF( (YEAR/4)*4 EQ YEAR) AND (MONTH EQ 3)
    3826. THEN
    3827. BEGIN
    3828. TMPI = TMPI + 1;
    3829. END
    3830.  
    3831. MVRELAG = TMPI;
    3832. RETURN;
    3833. END
    3834.  
    3835. TERM
    3836. PROC MVRPTDS((ABNDN));
    3837. # TITLE MVRPTDS - REPORT DEVICE STATUS. #
    3838.  
    3839. BEGIN # MVRPTDS #
    3840.  
    3841. #
    3842. ** MVRPTDS - REPORT DEVICE STATUS.
    3843. *
    3844. * THIS PROCEDURE PRINTS A PAGE SUMMARIZING THE SPACE
    3845. * AVAILABILITY ON EACH DEVICE.
    3846. *
    3847. * PROC MVRPTDS( (ABNDN) ).
    3848. *
    3849. * ENTRY. THE ARRAY *DEVSTAT* CONTAINS DATA TO BE PRINTED.
    3850. *
    3851. * EXIT. THE RELEVANT INFORMATION IS PRINTED ON THE OUTPUT FILE.
    3852. *
    3853. * MESSAGES. DEVICE SPACE GOAL NOT MET.
    3854. #
    3855.  
    3856. ITEM ABNDN B; # PROCESS ABANDONMENT REPORT #
    3857.  
    3858. #
    3859. **** PROC MVRPTDS - XREF LIST BEGIN.
    3860. #
    3861.  
    3862. XREF
    3863. BEGIN
    3864. PROC MESSAGE; # ISSUE DAYFILE MESSAGE #
    3865. PROC RPEJECT; # PAGE EJECT #
    3866. PROC RPLINE; # WRITE LINE #
    3867. PROC RPSPACE; # PRINT BLANK LINES #
    3868. FUNC XCDD C(10); # BINARY TO DECIMAL DISPLAY CODE #
    3869. FUNC XCOD C(10); # BINARY TO OCTAL DISPLAY CODE #
    3870. END
    3871.  
    3872. #
    3873. **** PROC MVRPTDS - XREF LIST END.
    3874. #
    3875.  
    3876.  
    3877. DEF HDR11 #" (BEFORE) DEVICE STATUS "#;
    3878. DEF HDR12 #" (AFTER) PERCENTS "#;
    3879. DEF HDR21 #"EO DN DT-N TYPE "#;
    3880. DEF HDR22 #" FILES / PRU "#;
    3881. DEF HDR23 #"EXP. GOAL "#;
    3882. DEF HDR24 #"FLAG."#;
    3883.  
    3884. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    3885.  
    3886. *CALL,COMBFAS
    3887. *CALL COMBSIT
    3888. *CALL,COMSPFM
    3889. *CALL,COMTMOV
    3890. *CALL,COMTMVD
    3891. *CALL,COMTOUT
    3892.  
    3893.  
    3894. ITEM EXP$PER I; # EXPECTED PERCENT SPACE AVAILABLE
    3895.   #
    3896. ITEM EXP$PRU I; # EXPECTED PRU AVAILABLE #
    3897. ITEM GOAL I; # PERCENT DESIRED DISK SPACE #
    3898. ITEM I I; # LOOP INDEX #
    3899. ITEM IX I; # FILE TYPE INDEX #
    3900. ITEM SUBFAM I; # LOOP INDEX #
    3901.  
    3902.  
    3903. ARRAY FILETYPE[IXDA:IXIA] S(1);
    3904. BEGIN
    3905. ITEM FILE$TYPE C(00,00,04) = [ ##
    3906. "DIR.",
    3907. "IND."];
    3908. END
    3909.  
    3910. CONTROL EJECT;
    3911.  
    3912. #
    3913. * PRINT HEADER LINES.
    3914. #
    3915.  
    3916. RPEJECT(OUT$FETP);
    3917.  
    3918. IF ABNDN
    3919. THEN
    3920. BEGIN
    3921. RPLINE(OUT$FETP,"DESTAGE ABANDONMENT REPORT",5,26,0);
    3922. RPSPACE(OUT$FETP,SP"SPACE",1);
    3923. END
    3924.  
    3925. RPLINE(OUT$FETP,HDR11,21,30,1);
    3926. RPLINE(OUT$FETP,HDR12,51,20,0);
    3927. RPSPACE(OUT$FETP,SP"SPACE",2);
    3928.  
    3929. RPLINE(OUT$FETP,HDR21,2,19,1);
    3930. RPLINE(OUT$FETP,HDR22,21,20,1);
    3931. RPLINE(OUT$FETP,HDR22,41,20,1);
    3932. RPLINE(OUT$FETP,HDR23,61,10,1);
    3933. RPLINE(OUT$FETP,HDR24,72,05,0);
    3934.  
    3935. #
    3936. * PRINT DATA FOR DEVICES ABLE TO HOLD INDIRECT FILES (MASTER
    3937. * DEVICES), FOLLOWED BY DATA ON DEVICES ABLE TO HOLD DIRECT
    3938. * ACCESS FILES.
    3939. #
    3940.  
    3941. SLOWFOR I = 1 STEP 1 UNTIL 2
    3942. DO
    3943. BEGIN # REPORT ON BOTH FILE TYPES #
    3944. RPSPACE(OUT$FETP,SP"SPACE",2); # 2 BLANK LINES AS A SEPARATOR
    3945.   #
    3946.  
    3947. SLOWFOR DNX = 1 STEP 1 UNTIL MAXDEV
    3948. DO
    3949. BEGIN # REPORT EACH DEVICE #
    3950.  
    3951. IF I EQ 1
    3952. THEN # ONLY DO MASTER DEVICES #
    3953. BEGIN
    3954. IX = IXIA;
    3955. GOAL = SM$VAL[IXIA,IXRL,SMMG];
    3956. IF NOT DEV$MAST[IXIA,DNX]
    3957. THEN # SKIP THIS DEVICE #
    3958. BEGIN
    3959. TEST DNX;
    3960. END
    3961.  
    3962. END
    3963.  
    3964. ELSE # ONLY DO DEVICES HOLDING DIRECT
    3965.   ACCESS FILES #
    3966. BEGIN
    3967. IX = IXDA;
    3968. IF DEV$MAST[IXIA,DNX]
    3969. THEN
    3970. BEGIN
    3971. GOAL = SM$VAL[IXDA,IXRL,SMMG];
    3972. END
    3973.  
    3974. ELSE
    3975. BEGIN
    3976. GOAL = SM$VAL[IXDA,IXRL,SMSG];
    3977. END
    3978.  
    3979. IF NOT DEV$SEC[IXIA,DNX] OR ##
    3980. DEV$NF[IXDA,DNX] EQ 0
    3981. THEN # SKIP THIS DEVICE #
    3982. BEGIN
    3983. TEST DNX;
    3984. END
    3985.  
    3986. END
    3987.  
    3988. #
    3989. * PRINT EO, DN, DT-N, TYPE.
    3990. #
    3991.  
    3992. CHR$10[0] = XCOD(DEV$EO[IXIA,DNX]);
    3993. RPLINE(OUT$FETP,CHR$R2[0],2,2,1);
    3994.  
    3995. CHR$10[0] = XCOD(DEV$DN[IXIA,DNX]);
    3996. RPLINE(OUT$FETP,CHR$R2[0],6,2,1);
    3997.  
    3998. CHR$10[0] = XCOD(DEV$NUM[IXIA,DNX]);
    3999. RPLINE(OUT$FETP,DEV$TYPE[IXIA,DNX],10,2,1);
    4000. RPLINE(OUT$FETP,"-",12,1,1);
    4001. RPLINE(OUT$FETP,CHR$R1[0],13,1,1);
    4002.  
    4003. RPLINE(OUT$FETP,FILE$TYPE[IX],16,4,1);
    4004.  
    4005. #
    4006. * ISSUE BEFORE STATISTICS - NUM. FILES, PRU.
    4007. #
    4008.  
    4009. CHR$10[0] = XCDD(DEV$NF[IX,DNX]);
    4010. RPLINE(OUT$FETP,CHR$R8[0],21,8,1);
    4011.  
    4012. CHR$10[0] = XCDD(DEV$PRU[IX,DNX]);
    4013. RPLINE(OUT$FETP,CHR$R8[0],31,8,1);
    4014.  
    4015. #
    4016. * ISSUE AFTER STATISTICS - FILES, PRU.
    4017. #
    4018.  
    4019. CHR$10[0] = XCDD(DEV$NF[IX,DNX] - DEV$RELF[IX,DNX]);
    4020. RPLINE(OUT$FETP,CHR$R8[0],41,8,1);
    4021.  
    4022. EXP$PRU = DEV$PRU[IX,DNX] - DEV$RELP[IX,DNX];
    4023. EXP$PER = (EXP$PRU*100 + DEV$TPRU[IXIA,DNX]/2)
    4024. /DEV$TPRU[IXIA,DNX];
    4025. CHR$10[0] = XCDD(EXP$PRU);
    4026. RPLINE(OUT$FETP,CHR$R8[0],51,8,1);
    4027.  
    4028. #
    4029. * ISSUE PERCENTAGES. IF SPACE GOAL NOT MET ISSUE WARNING
    4030. * FLAG AND DAYFILE MESSAGE.
    4031. #
    4032.  
    4033. IF EXP$PER GR GOAL
    4034. THEN # SPACE GOAL NOT MET #
    4035. BEGIN
    4036. RPLINE(OUT$FETP,"**",72,2,1);
    4037. MVMSG$LN[0] = " DEVICE SPACE GOAL NOT MET.";
    4038. MESSAGE(MVMSG[0],UDFL1);
    4039. END
    4040.  
    4041. CHR$10[0] = XCDD(EXP$PER);
    4042. RPLINE(OUT$FETP,CHR$R3[0],61,3,1);
    4043.  
    4044. CHR$10[0] = XCDD(GOAL);
    4045. RPLINE(OUT$FETP,CHR$R3[0],66,3,0); # WRITE LINE #
    4046. END # REPORT EACH DEVICE #
    4047.  
    4048. END # REPORT BOTH FILE TYPES #
    4049.  
    4050. #
    4051. * ISSUE SUBFAMILY REPORT. PRINT HEADER TO REPORT FILE.
    4052. #
    4053.  
    4054. RPSPACE(OUT$FETP,SP"SPACE",2);
    4055. RPLINE(OUT$FETP," ** - DEVICE SPACE GOAL NOT MET",2,32,0);
    4056. RPSPACE(OUT$FETP,SP"SPACE",2);
    4057. RPLINE(OUT$FETP,"SUBFAMILY REPORT",40,16,0);
    4058. RPSPACE(OUT$FETP,SP"SPACE",1);
    4059.  
    4060. IF ABNDN
    4061. THEN
    4062. BEGIN
    4063. RPLINE(OUT$FETP,"FILES NOT DESTAGED",22,18,1);
    4064. END
    4065.  
    4066. ELSE
    4067. BEGIN
    4068. RPLINE(OUT$FETP,"FILES TO DESTAGE",22,16,1);
    4069. END
    4070.  
    4071. RPLINE(OUT$FETP,"FILES ONLY ON 7990",63,18,1);
    4072. RPLINE(OUT$FETP,"FILES ON 7990",108,13,0);
    4073. RPLINE(OUT$FETP,"SUB DIRECT",2,25,1);
    4074. RPLINE(OUT$FETP,"INDIRECT",37,8,1);
    4075. RPLINE(OUT$FETP,"DIRECT INDIRECT",60,27,1);
    4076. RPLINE(OUT$FETP,"DIRECT INDIRECT",102,27,0);
    4077. RPLINE(OUT$FETP,"FAMILY NUMBER",2,16,1);
    4078. RPLINE(OUT$FETP,"PRU NUMBER PRU",26,24,1);
    4079. RPLINE(OUT$FETP,"NUMBER PRU",54,17,1);
    4080. RPLINE(OUT$FETP,"NUMBER PRU",75,17,1);
    4081. RPLINE(OUT$FETP,"NUMBER PRU",96,17,1);
    4082. RPLINE(OUT$FETP,"NUMBER PRU",117,17,0);
    4083. RPSPACE(OUT$FETP,SP"SPACE",1);
    4084.  
    4085. #
    4086. * PROCESS EACH SUBFAMILY.
    4087. #
    4088.  
    4089. SLOWFOR SUBFAM = 0 STEP 1 UNTIL MAXSF
    4090. DO
    4091. BEGIN # FOR EACH SUBFAMILY #
    4092. SLOWFOR IX = IXDA STEP 1 UNTIL IXIA
    4093. DO
    4094. BEGIN # REPORT BOTH FILE TYPES #
    4095. CHR$10[0] = XCDD(SUBFAM);
    4096. RPLINE(OUT$FETP,CHR$R1[0],3,1,1);
    4097. IF IX EQ IXDA
    4098. THEN
    4099. BEGIN # DIRECT ACCESS #
    4100. CHR$10[0] = XCDD(SFDS$NF[IX,SUBFAM]);
    4101. RPLINE(OUT$FETP,CHR$R8[0],10,8,1);
    4102. CHR$10[0] = XCDD(SFDS$PRU[IX,SUBFAM]);
    4103. RPLINE(OUT$FETP,CHR$R8[0],21,8,1);
    4104. CHR$10[0] = XCDD(SFRL$NF[IX,SUBFAM]);
    4105. RPLINE(OUT$FETP,CHR$R8[0],52,8,1);
    4106. CHR$10[0] = XCDD(SFRL$PRU[IX,SUBFAM]);
    4107. RPLINE(OUT$FETP,CHR$R8[0],63,8,1);
    4108. CHR$10[0] = XCDD(SFDM$NF[IX,SUBFAM]);
    4109. RPLINE(OUT$FETP,CHR$R8[0],94,8,1);
    4110. CHR$10[0] = XCDD(SFDM$PRU[IX,SUBFAM]);
    4111. RPLINE(OUT$FETP,CHR$R8[0],105,8,1);
    4112. END # DIRECT ACCESS #
    4113.  
    4114. ELSE
    4115. BEGIN # INDIRECT ACCESS #
    4116. CHR$10[0] = XCDD(SFDS$NF[IX,SUBFAM]);
    4117. RPLINE(OUT$FETP,CHR$R8[0],31,8,1);
    4118. CHR$10[0] = XCDD(SFDS$PRU[IX,SUBFAM]);
    4119. RPLINE(OUT$FETP,CHR$R8[0],42,8,1);
    4120. CHR$10[0] = XCDD(SFRL$NF[IX,SUBFAM]);
    4121. RPLINE(OUT$FETP,CHR$R8[0],73,8,1);
    4122. CHR$10[0] = XCDD(SFRL$PRU[IX,SUBFAM]);
    4123. RPLINE(OUT$FETP,CHR$R8[0],84,8,1);
    4124. CHR$10[0] = XCDD(SFDM$NF[IX,SUBFAM]);
    4125. RPLINE(OUT$FETP,CHR$R8[0],115,8,1);
    4126. CHR$10[0] = XCDD(SFDM$PRU[IX,SUBFAM]);
    4127. RPLINE(OUT$FETP,CHR$R8[0],126,8,0);
    4128. END # INDIRECT ACCESS #
    4129.  
    4130. END # REPORT BOTH FILE TYPES #
    4131.  
    4132. END # FOR EACH SUBFAMILY #
    4133.  
    4134. END # MVRPTDS #
    4135.  
    4136. TERM
    4137. PROC MVVALDS(DVAL,PO);
    4138. # TITLE MVVALDS - CALCULATE DESTAGE VALUE. #
    4139.  
    4140. BEGIN # MVVALDS #
    4141.  
    4142. #
    4143. ** MVVALDS - CALCULATE DESTAGE VALUE.
    4144. *
    4145. * PROC MVVALDS(DVAL,PO).
    4146. *
    4147. * ENTRY. PO = PROCESSING OPTION FROM *SF* DIRECTIVE, OR 0.
    4148. *
    4149. * EXIT. DVAL = DESTAGE VALUE.
    4150. #
    4151.  
    4152. ITEM DVAL I; # DESTAGE VALUE #
    4153. ITEM PO C(1); # PROCESSING OPTION #
    4154.  
    4155. #
    4156. **** PROC MVVALDS - XREF LIST BEGIN.
    4157. #
    4158.  
    4159. XREF
    4160. BEGIN
    4161. FUNC MVRELAG U; # RELATIVE AGE #
    4162. END
    4163.  
    4164. #
    4165. **** PROC MVVALDS - XREF LIST END.
    4166. #
    4167.  
    4168. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    4169. *CALL,COMBFAS
    4170. *CALL COMBSIT
    4171. *CALL,COMSPFM
    4172. *CALL,COMTMOV
    4173. *CALL,COMTMVD
    4174.  
    4175.  
    4176. ITEM AGE I; # DAYS SINCE LAST ACCESS #
    4177. CONTROL EJECT;
    4178. AGE = CURAGE - MVRELAG(PFC$MDD[0]); # TIME SINCE LAST ACCESS #
    4179. IF PFC$MDT[0] GR CURTIME
    4180. THEN
    4181. BEGIN
    4182. AGE = AGE - 1;
    4183. END
    4184.  
    4185. #
    4186. * VERIFY FILE MEETS AGE AND SIZE REQUIREMENTS.
    4187. #
    4188.  
    4189. IF (AGE LS FR$VAL[FTYPE,IXDS,FRDD]) # TEST AGE #
    4190. OR (PFC$LF[0] LS FR$VAL[FTYPE,IXDS,FRMN]) # MINIMUM SIZE #
    4191. OR (PFC$LF[0] GR FR$VAL[FTYPE,IXDS,FRMX]) # MAXIMUM SIZE #
    4192. THEN # FILE FAILS REQUIREMENTS #
    4193. BEGIN
    4194. DVAL = -1;
    4195. RETURN;
    4196. END
    4197.  
    4198. #
    4199. * EVALUATE DESTAGE VALUE FORMULA.
    4200. #
    4201.  
    4202. DVAL = ##
    4203. (WA$VAL[FTYPE,IXDS,WMAG]+WM$VAL[FTYPE,IXDS,WMAG]*AGE) ##
    4204. *(WA$VAL[FTYPE,IXDS,WMLN]+WM$VAL[FTYPE,IXDS,WMLN]*PFC$LF[0])##
    4205. *(PR$VAL[FTYPE,IXDS,PFC$RS[0]]) # *PR* FACTOR #
    4206. *(BR$VAL[FTYPE,IXDS,PFC$BR[0]]) # *BR* FACTOR #
    4207. /((WA$VAL[FTYPE,IXDS,WAAC]+WM$VAL[FTYPE,IXDS,WMAC] ##
    4208. *PFC$AC[0])*WA$VAL[FTYPE,IXDS,WADV]);
    4209.  
    4210.  
    4211.  
    4212. RETURN;
    4213. END # MVVALDS #
    4214.  
    4215. TERM
    4216. PROC MVVALRL(RVAL,PO);
    4217. # TITLE MVVALRL - CALCULATE RELEASE VALUE. #
    4218. BEGIN # MVVALRL #
    4219.  
    4220. #
    4221. ** MVVALRL - CALCULATE RELEASE VALUE.
    4222. *
    4223. * PROC MVVALRL(RVAL,PO).
    4224. *
    4225. * ENTRY. PO = PROCESSING OPTION FROM *SF* DIRECTIVE, OR 0.
    4226. *
    4227. * EXIT. RVAL = RELEASE VALUE.
    4228. #
    4229.  
    4230. ITEM PO C(1); # PROCESSING OPTION #
    4231. ITEM RVAL I; # RELEASE VALUE #
    4232.  
    4233. #
    4234. **** PROC MVVALRL - XREF LIST BEGIN.
    4235. #
    4236.  
    4237. XREF
    4238. BEGIN
    4239. FUNC MVRELAG U; # RELATIVE AGE #
    4240. END
    4241.  
    4242. #
    4243. **** PROC MVVALRL - XREF LIST END.
    4244. #
    4245.  
    4246. DEF LISTCON #0#; # DO NOT LIST COMMON DECKS #
    4247. *CALL,COMBFAS
    4248. *CALL COMBSIT
    4249. *CALL,COMSPFM
    4250. *CALL,COMTMOV
    4251. *CALL,COMTMVD
    4252.  
    4253.  
    4254. ITEM AGE I; # DAYS SINCE LAST ACCESS #
    4255. CONTROL EJECT;
    4256. AGE = CURAGE - MVRELAG(PFC$ADD[0]); # TIME SINCE LAST ACCESS #
    4257. IF PFC$ADT[0] GR CURTIME
    4258. THEN
    4259. BEGIN
    4260. AGE = AGE - 1;
    4261. END
    4262.  
    4263. #
    4264. * VERIFY FILE MEETS AGE AND SIZE REQUIREMENTS.
    4265. #
    4266.  
    4267. IF (AGE LS FR$VAL[FTYPE,IXRL,FRDD]) # TEST AGE #
    4268. OR (PFC$LF[0] LS FR$VAL[FTYPE,IXRL,FRMN]) # MINIMUM SIZE #
    4269. OR (PFC$LF[0] GR FR$VAL[FTYPE,IXRL,FRMX]) # MAXIMUM SIZE #
    4270. THEN # FILE FAILS REQUIREMENTS #
    4271. BEGIN
    4272. RVAL = -1;
    4273. RETURN;
    4274. END
    4275.  
    4276. #
    4277. * EVALUATE RELEASE VALUE FORMULA.
    4278. #
    4279.  
    4280. RVAL = ##
    4281. (WA$VAL[FTYPE,IXRL,WAAG]+WM$VAL[FTYPE,IXRL,WMAG]*AGE) ##
    4282. *(WA$VAL[FTYPE,IXRL,WALN]+WM$VAL[FTYPE,IXRL,WMLN]*PFC$LF[0])##
    4283. *(PR$VAL[FTYPE,IXRL,PFC$RS[0]]) # *PR* FACTOR #
    4284. *(BR$VAL[FTYPE,IXRL,PFC$BR[0]]) # *BR* FACTOR #
    4285. /((WA$VAL[FTYPE,IXRL,WAAC]+WM$VAL[FTYPE,IXRL,WMAC] ##
    4286. *PFC$AC[0])*WA$VAL[FTYPE,IXRL,WADV]);
    4287.  
    4288.  
    4289.  
    4290. RETURN;
    4291. END # MVVALRL #
    4292.  
    4293. TERM