Table of Contents

DMSCPY Source

References

Source Listing

DMSCPY.ASSEMBLE.txt
  1. CPY TITLE 'DMSCPY (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00003000
  3. * 00004000
  4. * 00005000
  5. * 00006000
  6. * 00007000
  7. * MODULE NAME: 00008000
  8. * 00009000
  9. * DMSCPY (COPYFILE) 00010000
  10. * 00011000
  11. * FUNCTION: 00012000
  12. * 00013000
  13. * TO COPY DISK FILES, SPECIFYING VARIOUS CONVERSIONS. 00014000
  14. * 00015000
  15. * ATTRIBUTES: 00016000
  16. * 00017000
  17. * REENTRANT, DISK RESIDENT 00018000
  18. * 00019000
  19. * ENTRY POINTS: 00020000
  20. * 00021000
  21. * DMSCPY - ENTERED BY ISSUING 'COPYFILE' COMMAND 00022000
  22. * 00023000
  23. * ENTRY CONDITIONS: 00024000
  24. * 00025000
  25. * R1 -> PLIST 00026000
  26. * 00027000
  27. * EXIT CONDITIONS: 00028000
  28. * 00029000
  29. * NORMAL - 00030000
  30. * RC=0 00031000
  31. * 00032000
  32. * ERROR - AN ERROR MESSAGE IS TYPED, AND REGISTER 15 IS 00033000
  33. * SET TO THE ERROR MESSAGE NUMBER. 00034000
  34. * 00035000
  35. * CALLS TO OTHER ROUTINES: 00036000
  36. * 00037000
  37. * STRINIT: TO INITIALIZE STORAGE 00038000
  38. * GETMAIN (OS MACRO): TO ALLOCATE STORAGE AND BUFFERS 00039000
  39. * WAITRD: TO READ FORM THE CONSOLE 00040000
  40. * FSTLKP: TO FIND THE FST FOR A FILE 00041000
  41. * ADTLKP: TO FIND ADT FOR OUTPUT DISK (TO SEE IF IT'S RDONLY) 00042000
  42. * RDBUF: TO READ A RECORD FROM A DISK FILE 00043000
  43. * WRBUF: TO WRITE A RECORD TO A DISK FILE 00044000
  44. * FREEMAIN (OS MACRO): TO FREE ALLOCATED STORAGE 00045000
  45. * FINIS: TO RELEASE ACTIVE FILES 00046000
  46. * ERASE: TO ERASE FILES 00047000
  47. * DMSERR: TO TYPE OUT INFORMATION ERROR MESSAGES 00048000
  48. * ALTER: TO ALTER TEMP FILE NAME TO REAL OUTPUT FILE NAME 00049000
  49. * 00050000
  50. * EXTERNAL REFERENCES: 00051000
  51. * 00052000
  52. * NONE. 00053000
  53. * 00054000
  54. * TABLES / WORKAREAS: 00055000
  55. * 00056000
  56. * A WORK AREA IS ALLOCATED USING THE 'GETMAIN' MACRO, 00057000
  57. * AND FREED USING THE 'FREEMAIN' MACRO. IN ADDITION, 00058000
  58. * INPUT/OUTPUT BUFFERS ARE ALLOCATED AND FREED WHEN 00059000
  59. * NECESSARY. 00060000
  60. * 00061000
  61. * REGISTER USAGE: 00062000
  62. * 00063000
  63. * XR = R2 IS A SCRATCH REGISTER 00064000
  64. * WR = R3 POINTS TO THE WORK AREA 00065000
  65. * BR = R4 IS THE FIRST BASE REGISTER 00066000
  66. * XR2 = R5 IS A SCRATCH REGISTER 00067000
  67. * XR3 = R6 IS A SCRATCH REGISTER 00068000
  68. * CDR = R7 POINTS TO THE COPY PHASE TABLES 00069000
  69. * RR = R8 IS THE INTERNAL 'BAL' REGISTER 00070000
  70. * SPR = R9 IS THE POINTER TO THE 'SPECS' CONTROL 00071000
  71. * BLOCKS 00072000
  72. * BR2, BR3, BR4 (R10-R12) ARE ADDITIONAL BASE REGISTERS 00073000
  73. * 00074000
  74. * NOTES: 00075000
  75. * 00076000
  76. * NONE. 00077000
  77. * 00078000
  78. * OPERATION: 00079000
  79. * 00080000
  80. * OPERATION TAKES PLACE IN SEVERAL STEPS. 00081000
  81. * 00082000
  82. * STEP 1. THE WORK SPACE IA ALLOCATED VIA 'GETMAIN' 00083000
  83. * AND ITS FIELDS ARE INITIALIZED. 00084000
  84. * 00085000
  85. * STEP 2. THE FILE NAME LIST IS SCANNED. A FLAG BYTE 00086000
  86. * IS SET UP FOR EACH FILE NAME, INDICATING THE FIELDS, 00087000
  87. * IF ANY, IN WHICH AN ASTERISK OR AN EQUAL SIGN OCCURS. 00088000
  88. * 00089000
  89. * STEP 3. THE OPTION LIST IS SCANNED. FOR EACH OPTION 00090000
  90. * IN THE USER-SUPPLIED LIST, A SPECIAL ROUTINE IS 00091000
  91. * ENTERED TO HANDLE IT. THE HANDLING ROUTINE CAN SET A 00092000
  92. * FLAG, AND CAN HANDLE SUB-FIELDS OF THE OPTION NAME. 00093000
  93. * 00094000
  94. * STEP 4. ADDITIONAL OPTION PROCESSING. THIS 00095000
  95. * INCLUDES: 00096000
  96. * CHECKING FOR OPTION CONFLICTS. 00097000
  97. * SETTING MULTIPLE OR SINGLE MODE, AS SPECIFIED. 00098000
  98. * READING 'SPECS' LIST, IF THAT OPTION WAS 00099000
  99. * GIVEN. 00100000
  100. * SETTING UP TRANSLATE TABLE, IF NECESSARY. 00101000
  101. * READING TABLE FOR TERMINAL IF 'TRANSLATE' 00102000
  102. * SPECIFIED. 00103000
  103. * 00104000
  104. * STEPS 4 AND 5. PERFORM THE ACTUAL COPYING OPERATION. 00105000
  105. * 00106000
  106. * DUE TO THE NUMBER OF OPTIONS AND MODES AVAILABLE, IT 00107000
  107. * WAS FELT THAT A STRAIGHTFORWARD CODING OF THE COPYING 00108000
  108. * STEP WOULD LEAD TO VERY COMPLEX AND HARD-TO-MANAGE 00109000
  109. * CODE. IN ORDER TO AVOID THIS PROBLEM, A DIFFERENT 00110000
  110. * SCHEME WAS USED. THIS SCHEME WAS DESIGNED WITH THE 00111000
  111. * FOLLOWING OBJECTIVES IN MIND: 00112000
  112. * FAST EXECUTION SPEED 00113000
  113. * EASY TO DEBUG CODE 00114000
  114. * EASY TO MODIFY CODE 00115000
  115. * 00116000
  116. * THE IDEA BEHIND THE COPYING OPERATION IS THE 00117000
  117. * FOLLOWING: THE COPYING OPERATION IS BROKEN UP INTO A 00118000
  118. * LARGE NUMBER OF SMALL ROUTINES, HANDLING THE VARIOUS 00119000
  119. * TASKS TO BE PERFORMED AS PART OF THE COPYING 00120000
  120. * OPERATION. EACH OF THE ROUTINES IS MADE TO BE AS 00121000
  121. * STRAIGHT-LINE AS POSSIBLE, SO THAT IT WON'T DEPEND ON 00122000
  122. * WHICH OPTIONS HAVE BEEN SPECIFIED. 00123000
  123. * 00124000
  124. * IT MUST, THEREFORE, BE DETERMINED IN ADVANCE WHICH OF 00125000
  125. * THESE ROUTINES ARE TO BE EXECUTED. A ONE-BYTE CODE IS 00126000
  126. * ASSIGNED TO EACH OF THE ROUTINES, AND TABLES ARE MADE 00127000
  127. * UP, DEPENDING UPON THE OPTIONS WHICH WERE SPECIFIED, 00128000
  128. * TO CALL ONLY THE ROUTINES WHICH SHOULD BE INVOKED FOR 00129000
  129. * THE SPECIFIED OPTIONS. 00130000
  130. * 00131000
  131. * STEP 4, THEN, SETS UP THE CODE STRINGS, DEPENDING 00132000
  132. * UPON WHICH OPTIONS WERE SPECIFIED. THE CODE STRINGS 00133000
  133. * ARE GROUPED INTO 'PHASES', REPRESENTING THE DIFFERENT 00134000
  134. * LOGICAL PHASES OF THE COPYING OPERATION. (PHASES ARE 00135000
  135. * NECESSARY FOR A DIFFERENT REASON: THEY REPRESENT THE 00136000
  136. * ONLY REAL MEANS FOR PROVIDING FOR CONDITIONAL 00137000
  137. * BRANCHES AMONG ROUTINES DURING THE COPYING OPERATION 00138000
  138. * - A CONDITIONAL BRANCH IS ACCOMPLISHED BY A 00139000
  139. * CONDITIONAL CHANGE OF PHASE.) 00140000
  140. * 00141000
  141. * STEP 5 PERFORMS THE ACTUAL COPYING OPERATION BY 00142000
  142. * BRANCHING TO THE ROUTINES, IN TURN, AS SPECIFIED BY 00143000
  143. * THE CODE TABLES. 00144000
  144. * 00145000
  145. *. 00146000
  146. EJECT 00147000
  147. MACRO 00148000
  148. &NM TABLE &LIST 00149000
  149. GBLC &OPLIST(35) OPTION LIST 00150000
  150. LCLA &I 00151000
  151. LCLC &T,&TT 00152000
  152. * FOR EACH OPTION IN THE LIST THERE ARE TWO MACRO ARGUMENTS: 00153000
  153. * OPTION NAME AND MINIMUM NUMBER OF LETTERS. 00154000
  154. SPACE 00155000
  155. &NM DS 0D 00156000
  156. .LOOP ANOP 00157000
  157. &I SETA &I+2 00158000
  158. AIF (&I GT N'&SYSLIST).MEND 00159000
  159. &T SETC '&SYSLIST(&I-1)' 00160000
  160. &OPLIST(&I/2) SETC '&T' 00161000
  161. &TT SETC '&T'(1,7) 00162000
  162. $&TT DC CL8'&T',AL1(&SYSLIST(&I)-1),AL3(@&TT) 00163000
  163. AGO .LOOP 00164000
  164. .MEND MEND 00165000
  165. EJECT 00166000
  166. MACRO 00167000
  167. &NM CONFLICT &LIST 00168000
  168. GBLC &OPLIST(35) OPTION LIST 00169000
  169. LCLA &I,&J,&L(20),&P,&Q,&K 00170000
  170. LCLC &T 00171000
  171. &NM DS 0H 00172000
  172. .ILOOP ANOP 00173000
  173. &I SETA &I+1 00174000
  174. AIF (&I GT N'&SYSLIST).ENDI 00175000
  175. &J SETA 0 00176000
  176. .JLOOP ANOP 00177000
  177. &J SETA &J+1 00178000
  178. AIF (&J GT N'&SYSLIST(&I)).ENDJ 00179000
  179. &T SETC '&SYSLIST(&I,&J)' 00180000
  180. &K SETA 0 00181000
  181. .KLOOP ANOP 00182000
  182. &K SETA &K+1 00183000
  183. AIF ('&T' EQ '&OPLIST(&K)').ENDK 00184000
  184. AIF ('&OPLIST(&K)' NE '').KLOOP 00185000
  185. MNOTE 12,'ILLEGAL PARAMETER: &T' 00186000
  186. .ENDK ANOP 00187000
  187. &L(&J) SETA &K-1 00188000
  188. AGO .JLOOP 00189000
  189. .ENDJ ANOP 00190000
  190. &P SETA 0 00191000
  191. .PLOOP ANOP 00192000
  192. &P SETA &P+1 00193000
  193. AIF (&P GE 2).ENDP **** CHANGE &J TO 2 **** 00194000
  194. &Q SETA &P 00195000
  195. .QLOOP ANOP 00196000
  196. &Q SETA &Q+1 00197000
  197. AIF (&Q GE &J).PLOOP 00198000
  198. AIF (&L(&P) GT &L(&Q)).G 00199000
  199. DC FL1'&L(&P),&L(&Q)' 00200000
  200. AGO .QLOOP 00201000
  201. .G ANOP 00202000
  202. DC FL1'&L(&Q),&L(&P)' 00203000
  203. AGO .QLOOP 00204000
  204. .ENDP ANOP 00205000
  205. AGO .ILOOP 00206000
  206. .ENDI ANOP 00207000
  207. MEND 00208000
  208. EJECT 00209000
  209. MACRO 00210000
  210. &NM CODE &CODE,&B 00211000
  211. GBLA &NROUTS,&KKK 00212000
  212. GBLC &ROUTS(80) 00213000
  213. LCLA &I 00214000
  214. LCLC &T 00215000
  215. AIF ('&B' EQ '').NOB 00216000
  216. AIF ('&B'(1,1) EQ 'N').N 00217000
  217. BN&B *+12 00218000
  218. AGO .NOB 00219000
  219. .N ANOP 00220000
  220. &T SETC '&B'(2,1) 00221000
  221. B&T *+12 00222000
  222. .NOB ANOP 00223000
  223. &NM MVI 0(CDR),$@&CODE 00224000
  224. LA CDR,1(,CDR) 00225000
  225. .LOOP ANOP 00226000
  226. &I SETA &I+1 00227000
  227. AIF ('&CODE' EQ '&ROUTS(&I)').NOLIST 00228000
  228. AIF (&I LT &NROUTS).LOOP 00229000
  229. &NROUTS SETA &NROUTS+1 00230000
  230. &ROUTS(&NROUTS) SETC '&CODE' 00231000
  231. .NOLIST ANOP 00232000
  232. &KKK SETA &KKK+1 00233000
  233. .* THE FOLLOWING LINES ARE USED JUST TO MAKE THE LISTING EASIER TO 00234000
  234. .* FOLLOW. 00235000
  235. B $$&CODE (DOCUMENTATION) 00236000
  236. ORG *-4 (DOCUMENTATION) 00237000
  237. MEND 00238000
  238. EJECT 00239000
  239. MACRO 00240000
  240. ROUTINES &XX 00241000
  241. GBLA &NROUTS 00242000
  242. GBLC &ROUTS(80) 00243000
  243. LCLA &I 00244000
  244. LCLC &T 00245000
  245. ROUTAB DC A(ERUNX) 00246000
  246. .LOOP ANOP 00247000
  247. &I SETA &I+1 00248000
  248. &T SETC '&ROUTS(&I)' 00249000
  249. $@&T EQU &I 00250000
  250. DC A($$&T) 00251000
  251. AIF (&I LT &NROUTS).LOOP 00252000
  252. ROUTMAX EQU &I 00253000
  253. MEND 00254000
  254. EJECT 00255000
  255. MACRO 00256000
  256. &NM PHBEG &XXX 00257000
  257. GBLA &KKK 00258000
  258. GBLC &PPP 00259000
  259. AIF (&KKK EQ 0).OKKK 00260000
  260. MNOTE 8,'NO PHEND FOR PHASE &PPP' 00261000
  261. &KKK SETA 0 00262000
  262. .OKKK ANOP 00263000
  263. &PPP SETC '&NM' 00264000
  264. M&NM EQU * 00265000
  265. LA CDR,PH&NM POINT TO PHASE CONTROL BYTES 00266000
  266. MEND 00267000
  267. SPACE 2 00268000
  268. MACRO 00269000
  269. &NM PHEND &XXX 00270000
  270. GBLA &KPH,&PL(20),&KKK 00271000
  271. GBLC &PPP,&PH(20) 00272000
  272. LCLA &I 00273000
  273. AIF ('&NM' EQ '&PPP').OKPPP 00274000
  274. MNOTE 8,'LABEL ''&PPP'' ASSUMED' 00275000
  275. .OKPPP ANOP 00276000
  276. .L ANOP 00277000
  277. &I SETA &I+1 00278000
  278. AIF ('&PPP' EQ '&PH(&I)').F 00279000
  279. AIF (&I LT &KPH).L 00280000
  280. MNOTE 8,'NO ''PW'' SPECIFIED FOR PHASE ''&PPP''' 00281000
  281. .F ANOP 00282000
  282. AIF (&KKK LE &PL(&I)).OKTTT 00283000
  283. MNOTE 8,'PH&PPP SHOULD HAVE LENGTH AT LEAST XL&KKK' 00284000
  284. .OKTTT ANOP 00285000
  285. M&PPP.E EQU * 00286000
  286. &KKK SETA 0 00287000
  287. MEND 00288000
  288. SPACE 5 00289000
  289. MACRO 00290000
  290. &N PW &L 00291000
  291. GBLA &PL(20),&KPH 00292000
  292. GBLC &PH(20) 00293000
  293. &KPH SETA &KPH+1 00294000
  294. &PH(&KPH) SETC '&N' 00295000
  295. &PL(&KPH) SETA &L 00296000
  296. PH&N DS XL&L 00297000
  297. MEND 00298000
  298. EJECT 00299000
  299. MACRO 00300000
  300. GOGEN &XXXX 00301000
  301. GBLA &KPH 00302000
  302. GBLC &PH(20) 00303000
  303. LCLA &I 00304000
  304. LCLC &T 00305000
  305. .LOOP ANOP 00306000
  306. &I SETA &I+1 00307000
  307. &T SETC '&PH(&I)' 00308000
  308. $$GO&T EQU * 00309000
  309. PHASE &T 00310000
  310. SPACE 00311000
  311. AIF (&I LT &KPH).LOOP 00312000
  312. MEND 00313000
  313. EJECT 00314000
  314. MACRO 00315000
  315. &NM NEXT &XXX 00316000
  316. &NM B NEXT 00317000
  317. MEND 00318000
  318. SPACE 3 00319000
  319. MACRO 00320000
  320. &NM SKIP &N 00321000
  321. &NM LA CDR,&N+1(,CDR) 00322000
  322. B GO 00323000
  323. MEND 00324000
  324. SPACE 3 00325000
  325. MACRO 00326000
  326. &NM PHASE &PH 00327000
  327. &NM LA CDR,PH&PH 00328000
  328. B GO 00329000
  329. MEND 00330000
  330. EJECT 00331000
  331. MACRO 00332000
  332. &NM CKRW &RW,&EOF=ERRWX 00333000
  333. &NM SR R14,R14 00334000
  334. IC R14,&RW.BYTES(R15) GET JUMP CODE FROM RETURN CODE 00335000
  335. B *+4(R14) JUMP BASED ON RETURN CODE 00336000
  336. B *+16 ZERO RETURN CODE -- NORMAL 00337000
  337. BAL RR,ERRWX UNEXPECTED ERROR 00338000
  338. B ERACT FILE ALREADY ACTIVE FOR WR/RD 00339000
  339. BAL RR,&EOF END OF FILE ON RDBUF 00340000
  340. MEND 00341000
  341. * FOR EACH FILE NAME PASSED TO THIS ROUTINE, THERE WILL BE THREE 00342000
  342. * PLISTS REFERRING TO IT: 00343000
  343. SPACE 00344000
  344. * PLIST1 THIS PLIST CONTAINS THE FILE NAME AS PASSED TO THIS 00345000
  345. * ROUTINE. SUCH A FILE NAME WILL CONTAIN BOTH *'S AND ='S. 00346000
  346. * A POINTER TO A PLIST1 WILL BE A POINTER INTO THE MIDDLE 00347000
  347. * OF THE PLIST PASSED TO THIS ROUTINE. MORE SPECIFICALLY, 00348000
  348. * IT WILL POINT TO 8 BYTES BEFORE THE APPEARANCE OF THAT FILE 00349000
  349. * NAME IN THE PLIST PASSED TO 'COPY'. THIS PLIST WILL NEVER 00350000
  350. * BE MODIFIED. 00351000
  351. SPACE 00352000
  352. * PLIST2 THIS PLIST CONTAINS THE FILE NAME WITHOUT ANY ='S. 00353000
  353. * THE SAME PLIST ALSO CONTAINS POINTERS TO THE ASSOCIATED 00354000
  354. * PLIST1 AND PLIST3, AS WELL AS SOME OTHER POINTERS. (SEE 00355000
  355. * DSECT DESCRIPTION OF PLIST2 JUST BELOW.) 00356000
  356. * THIS PLIST WILL PHYSICALLY BE IN THE WORK AREA, AND WILL 00357000
  357. * BE ONE OF FIPLIST2, CIPLIST2 OR OUPLIST2. 00358000
  358. SPACE 00359000
  359. * PLIST3 THIS PLIST IS THE RDBUF/WRBUF PLIST, AND THE FILE NAME 00360000
  360. * FILE NAME IN THIS CASE WILL NOT CONTAIN EITHER ANY *'S 00361000
  361. * OR ANY ='S. 00362000
  362. * THIS PLIST IS PHYSICALLY IN THE WORK AREA, AND WILL BE ONE 00363000
  363. * OF RDPLIST, WRPLIST OR OVPLIST. 00364000
  364. EJECT 00365000
  365. PLIST1 DSECT 00366000
  366. DS CL8 PADDING FOR OPERATION 00367000
  367. PNA1 DS CL8 FILE NAME 00368000
  368. PTY1 DS CL8 FILE TYPE 00369000
  369. PMO1 DS CL2 FILE MODE 00370000
  370. DS CL6 PADDING 00371000
  371. PNEXTNA DS X NEXT NAME IN 'COPY' PLIST 00372000
  372. SPACE 00373000
  373. PNEXT1 EQU PMO1 UPDATE TO THIS ADDRESS 00374000
  374. SPACE 2 00375000
  375. PLIST2 DSECT 00376000
  376. DS CL8 OPERATION (IF NEEDED) 00377000
  377. PNA2 DS CL8 FILE NAME 00378000
  378. PTY2 DS CL8 FILE TYPE 00379000
  379. PMO2 DS CL2 FILE MODE 00380000
  380. * THE NEXT TWO FIELDS ARE COPIED OVER FROM THE ADT. 00381000
  381. PHYP DS CL8 POINTER TO CURRENT FST HYPERBLOK 00382000
  382. PSTFST EQU PHYP+2 POINTER TO FST FROM STATE @VA04333 00383000
  383. PFST DS A POINTER TO CURRENT FST 00384000
  384. PADT DS A POINTER TO CURRENT ADT 00385000
  385. SPACE 00386000
  386. * THE NEXT IS A POINTER INTO EITHER THE INFLAGS STRING, OR TO OUTFLAG. 00387000
  387. PFLG DS A POINTER TO FLAG BYTE FOR FILE 00388000
  388. PPLIST1 DS A POINTER TO PLIST1 00389000
  389. PPLIST3 DS A POINTER TO PLIST3 00390000
  390. SPACE 00391000
  391. PLEN2 EQU (*+7-PLIST2)/8 LENGTH OF PLIST2 IN DOUBLEWORDS 00392000
  392. SPACE 2 00393000
  393. PLIST3 DSECT 00394000
  394. DS CL8 OPERATION: RDBUF OR WRBUF 00395000
  395. PNA3 DS CL8 FILE NAME 00396000
  396. PTY3 DS CL8 FILE TYPE 00397000
  397. PMO3 DS CL2 FILE MODE 00398000
  398. PITEM3 DC H'0' ITEM NUMBER 00399000
  399. PBUFFA3 DS A BUFFER ADDRESS 00400000
  400. PBUFFS3 DS F BUFFER SIZE 00401000
  401. PFV3 DS CL2 F/V FLAG 00402000
  402. PNI3 DC H'1' NUMBER OF ITEMS TO R/W 00403000
  403. PRET3 DS F RDBUF: NO BYTES READ RETURNED 00404000
  404. EJECT 00405000
  405. * THE FOLLOWING DSECT DESCRIBES THE CONTROL WORDS ASSOCIATED WITH 00406000
  406. * EACH DESCRIPTION OF A 'SPECS' OPTION. 00407000
  407. SPSECT DSECT 00408000
  408. SPINDISP DS A DISPLACEMENT INTO INPUT BUFFER-1 00409000
  409. SPLAST DS A LAST COLUMN IN INPUT BUFFER 00410000
  410. SPACE 00411000
  411. * FOR A STRAIGHT STRING SUBSTITUTION, THE LAST TWO ADDRESSES ARE AS 00412000
  412. * FOLLOWS: 00413000
  413. * SPINDISP ADDRESS OF STRING TO BE SUBSTITUTED, WITH SIGN BIT 00414000
  414. * TURNED ON 00415000
  415. * SPLAST LENGTH OF STRING TO BE SUBSTITUTED 00416000
  416. SPACE 00417000
  417. * THE FOLLOWING FIELD CONTAINS THE ( (COLUMN NUMBER) - 1). 00418000
  418. SPOUDISP DS A DISPLACEMENT INTO OUTPUT BUFFER 00419000
  419. SPNEXT EQU * POINTER TO NEXT CONTROL BLOCK 00420000
  420. SPACE 00421000
  421. SPBLEN EQU *-SPSECT LENGTH OF CTL WORD BLOCK 00422000
  422. EJECT 00423000
  423. * THE FOLLOWING DSECT DESCRIBES THE CONTROL WORDS ASSOCIATED WITH EACH 00424000
  424. * 'COPY' OPTION. THESE CONTROL WORDS ARE GENERATED BY THE 'OPTAB' 00425000
  425. * MACRO. 00426000
  426. OPSECT DSECT 00427000
  427. OPNAME DS CL8 OPTION NAME 00428000
  428. OPMIN DS 0AL1 (MINIMUM NUMBER OF LETTERS)-1 00429000
  429. OPADD DS A ADDRESS OF BRANCH ROUTINE 00430000
  430. SPACE 00431000
  431. OPSLEN EQU *-OPSECT LENGTH OF BLOCK 00432000
  432. * THE WORKSPACE WHICH IS DESCRIBED HEREIN IS ALLOCATED BY A GETMAIN 00433000
  433. * MACRO AT THE START OF 'COPY' PROCESSING. 00434000
  434. * ALL FIELDS GIVEN BY 'DC' BELOW ARE INITIALIZED TO THAT VALUE BELOW. 00435000
  435. * ALL OTHER FIELDS ARE INITIALIZED TO 0. 00436000
  436. WORK DSECT 00437000
  437. SAVE13 DS A SAVE OLD R13 00438000
  438. SAVEAREA DS 18A NEW SAVE AREA 00439000
  439. PLPTR DS A POINTER TO 'COPY' PLIST 00440000
  440. RC DC X'00' RETURN CODE FROM 'COPY' 00441000
  441. EJECT 00442000
  442. WORK DSECT CONTINED 00443000
  443. SPACE 00444000
  444. * FIELDS HAVING TO DO WITH OPTION PROCESSING. 00445000
  445. SPACE 00446000
  446. * ONE 'OPBYTES' BYTE IS FILLED IN FOR EACH OPTION SPECIFIED. 00447000
  447. OPBYTES DS 50X 00448000
  448. NOPS DC H'0' NUMBER OF OPTIONS SPECIFIED. 00449000
  449. SPACE 00450000
  450. OPF1 DC AL1(0) FIRST OPTION FLAG BYTE 00451000
  451. SPACE 00452000
  452. OP1TYPE EQU X'80' TYPE OPTION SPECIFIED 00453000
  453. OP1OLDD EQU X'40' OLDDATE OPTION SPECIFIED 00454000
  454. OP1DEFO EQU X'20' DEFAULT OUTPUT FILE NAME '= = =' 00455000
  455. OP1FRL EQU X'10' 'FRLABEL' OPTION SPECIFIED 00456000
  456. OP1TOL EQU X'08' TOLABEL OPTION SPECIFIED 00457000
  457. OP1TRUNC EQU X'04' TRUNC OPTION SPECIFIED 00458000
  458. OP1SPECS EQU X'02' SPECS OPTION SPECIFIED 00459000
  459. OP1NOPR EQU X'01' NOPROMPT OPTION SPECIFIED 00460000
  460. SPACE 2 00461000
  461. OPF2 DC AL1(0) SECOND OPTION FLAG BYTE 00462000
  462. SPACE 00463000
  463. OP2MULT EQU X'80' MULTIPLE MODE IMPLIED @VA05078 00464000
  464. OP2REPL EQU X'40' REPLACE OPTION SPECIFIED 00465000
  465. OP2OVLY EQU X'20' OVLY OPTION SPECIFIED 00466000
  466. OP2APPE EQU X'10' APPEND OPTION SPECIFIED 00467000
  467. OP2NEWF EQU X'08' NEWFILE OPTION SPECIFIED (OR *00468000
  468. DEFAULTED) 00469000
  469. * X'04' NOT USED @VA11777 00470000
  470. OP2PACK EQU X'02' 'PACK' OPTION 00471000
  471. OP2UNPA EQU X'01' 'UNPACK' OPTION 00472000
  472. SPACE 2 00473000
  473. OPF3 DS AL1(0) THIRD OPTION FLAG BYTE 00474000
  474. SPACE 00475000
  475. OP3EBCD EQU X'80' 'EBCDIC' OPTION SPECIFIED 00476000
  476. OP3TRAN EQU X'40' 'TRANS' OPTION SPECIFIED 00477000
  477. OP3UPCA EQU X'20' 'UPCASE' OPTION SPECIFIED 00478000
  478. OP3LOCA EQU X'10' 'LOWCASE' OPTION SPECIFIED 00479000
  479. * X'08' NOT USED @VA11777 00480000
  480. OP3MODE3 EQU X'04' 'OLDDATE WITH MODE A3' @VA03020 00481000
  481. OP3MORIN EQU X'02' THERE IS(ARE) MORE INPUT FILE(S) @VA03971 00482000
  482. OP3PHCV EQU X'01' 'OVLY' PHASE CV IS BEING EXECUTED@VA03971 00483000
  483. EJECT 00484000
  484. WORK DSECT 00485000
  485. SPACE 2 00486000
  486. * OTHER OPTION FIELDS 00487000
  487. RECFM DS C SPECIFIED RECFM 00488000
  488. LRECL DC F'0' SPECIFIED LRECL 00489000
  489. FROMN DC F'0' SPECIFIED 'FROM' NUMBER 00490000
  490. FORN DC F'0' SPECIFIED 'FOR' NUMBER 00491000
  491. FILLC DC X'40000000' DEFAULT FILL CHAR IS BLANK 00492000
  492. FRL DS CL8 'FRLABEL' LABEL 00493000
  493. TOL DS CL8 'TOLABEL' LABEL 00494000
  494. FRLL DS H (LENGTH OF FRLABEL) - 1 00495000
  495. TOLL DS H (LENGTH OF TOLABEL) - 1 00496000
  496. SPACE 00497000
  497. FOREND DS F TEMPORARY USED WITH 'FOR' PROC 00498000
  498. EJECT 00499000
  499. WORK DSECT CONTINUED 00500000
  500. SPACE 00501000
  501. * STORAGE ASSOCIATED WITH 'SPECS' SPECIFICATIONS 00502000
  502. SPACE 00503000
  503. MAXSPECS EQU 20 MAX NUMBER OF SPECS ALLOWED 00504000
  504. SPECSB DC (MAXSPECS)A(0,0,0) 'SPECS' DESCRIPTION BLOCKS 00505000
  505. * THE PRECEDING CONTROL BLOCKS ARE DESCRIBED BY THE SPSECT DSECT. 00506000
  506. SPACE 00507000
  507. SPECSBE DC X'FF' X'FF' MEANS END OF SPECS 00508000
  508. SPECC DS C CURRENT SPEC DELIMITER CHAR 00509000
  509. SPECST DS CL130 SPEC STRINGS 00510000
  510. SPECSTM DS A (*) END OF SPECST -- INIT TO A(*) 00511000
  511. SPECSTE DS A END OF SPEC STRINGS 00512000
  512. SPECTMP DS A TEMP FOR PROCESSING SPECS 00513000
  513. SPACE 00514000
  514. * THE FOLLOWING FIELD CONTAINS THE MAXIMUM DISPLACEMENT OF ANY 00515000
  515. * SPECIFICATION INTO THE OUTPUT BUFFER. THIS FIGURE IS NEEDED TO 00516000
  516. * COMPUTE THE MAXIMUM SIZE OF THE OUTPUT BUFFER. 00517000
  517. SPECMAX DC F'0' 00518000
  518. SPACE 3 00519000
  519. EJECT 00525000
  520. WORK DSECT 00526000
  521. * PACK/UNPACK OPTION AREA 00527000
  522. * PACK FILE HEADER BUFFER 00528000
  523. PACKFHB DS 0F 00529000
  524. PACKVER DC H'1' PACK VERSION NUMBER 00530000
  525. PACKCHAR DS C SPECIAL PACK CHARACTER 00531000
  526. PACKRECF DS C RECFM OF FILE BEING PACKED 00532000
  527. PACKLREC DS F LRECL OF FILE BEING PACKED 00533000
  528. PACKBL EQU *-PACKFHB LENGTH OF HEADER BUFFER 00534000
  529. SPACE 00535000
  530. * THERE ARE TWO SETS OF BUFFER POINTERS, ONE FOR THE 'PACK' BUFFER, 00536000
  531. * AND ONE FOR THE REAL FILE BUFFER. WHICH IS INPUT AND WHICH IS OUTPUT 00537000
  532. * DEPENDS ON WHETHER A PACK OR UNPACK IS BEING DONE. 00538000
  533. SPACE 00539000
  534. * PACK BUFFER POINTERS. 00540000
  535. PACKBUF DS A POINTER TO NEXT AVAILABLE BYTE *00541000
  536. PACK BUFFER 00542000
  537. PACKLEFT DS F NUMBER OF BYTES LEFT IN PACK *00543000
  538. BUFFER 00544000
  539. SPACE 00545000
  540. * POINTERS TO THE REAL FILE BUFFER. 00546000
  541. PKBX DS A NEXT AVAILABLE BYTE IN BUFFER 00547000
  542. PKBXE DS A POINTER TO BYTE BEYOND END OF *00548000
  543. BUFFER 00549000
  544. PKBXE2 DS A 2 BYTES LESS THAN PKBXE 00550000
  545. PKBXE3 DS A 3 BYTES LESS THAN PKBXE 00551000
  546. PKBXE4 DS A 4 BYTES LESS THAN PKBXE 00552000
  547. SPACE 00553000
  548. PKCC DS 2C TWO COPIES OF PACKCHAR 00554000
  549. SPACE 00555000
  550. * THE FLAG BYTE APPEARS AS PART OF EACH DATA SPECIFICATION IN THE 00556000
  551. * PACKED FILE FORMAT. IN THIS FLAG BYTE, IF NOT ALL THE PKFFF BITS 00557000
  552. * ARE ON, THEN ONLY PKDAF IS A FLAG BIT, AND ALL THE REST ARE LENGTH 00558000
  553. * BITS SPECIFYING THE LENGTH OF THE DATA FIELD. IF ALL THE PKFFF BITS 00559000
  554. * ARE ON, THEN ALL THE BITS IN THE BYTE ARE FLAG BITS AND ARE VALID. 00560000
  555. PKFLAG DS B FLAG BYTE 00561000
  556. PKDAF EQU B'10000000' DATA FIELD -- THIS BYTE IS FOL- *00562000
  557. LOWED BY A FIELD OF NONEQUAL *00563000
  558. CHARS 00564000
  559. PKFFF EQU B'01111000' MAX LENGTH SPEC IS 119+1. 00565000
  560. PKERF EQU B'00000100' END OF RECORD BIT FOR V RECORD 00566000
  561. PKSCF EQU B'00000010' SPECIAL (NON-FILL) CHARACTER BIT 00567000
  562. PKELF EQU B'00000001' EXTRA LONG FIELD BIT -- LONGER *00568000
  563. THAN 256 CHARACTERS. 00569000
  564. EJECT 00570000
  565. WORK DSECT CONTINUED 00571000
  566. * PLIST'S FOR THE ROUTINE 00572000
  567. DS 0D 00573000
  568. SPACE 00574000
  569. ERPLIST DC CL8'ERASE',3D'0',8X'FF' ERASE PLIST 00575000
  570. FIPLIST DC CL8'FINIS',3D'0',8X'FF' FINIS PLIST 00576000
  571. RNPLIST DC CL8'RENAME',6D'0',8X'FF' RENAME PLIST 00577000
  572. STPLIST DC CL8'STATE',3D'0',8X'FF' STATE PLIST 00578000
  573. SPACE 2 00579000
  574. * TERMINAL READ PLIST 00580000
  575. CRPLIST DS 0F 00581000
  576. DC CL8'WAITRD' OPERATION 00582000
  577. DC AL1(1) 00583000
  578. DC AL3(0) INIT TO A(STRING) 00584000
  579. DS C COVERSION INDICATOR 00585000
  580. DS AL3 BYTE COUNT STORED HERE 00586000
  581. * THE FOLLOWING PLIST'S ARE DESCRIBED BY THE PLIST2 DSECT. 00587000
  582. SPACE 00588000
  583. FIPLIST2 DC (PLEN2)D'0' FIRST INPUT FILE PLIST2 00589000
  584. CIPLIST2 DC (PLEN2)D'0' CURRENT INPUT FILE PLIST2 00590000
  585. OUPLIST2 DC (PLEN2)D'0' OUTPUT FILE PLIST2 00591000
  586. SPACE 00592000
  587. * THE FOLLOWING IS THE NAME, TYPE AND MODE FOR THE FIRST INPUT FILE, 00593000
  588. * WITH ALL *'S SUBSTITUTED. THIS INFO IS NEEDED TO SUBSTITUTE FOR 00594000
  589. * ='S IN OTHER INPUT FILES AND IN OUTPUT FILE. 00595000
  590. FNA DS CL8 FILE NAME 00596000
  591. FTY DS CL8 FILE TYPE 00597000
  592. FMO DS CL2 FILE MODE 00598000
  593. SPACE 00599000
  594. PPLIST2 DS A POINTER TO CURRENT PLIST2 00600000
  595. POUPL1 DS A POINTER TO OUTPUT FILE PLIST1 00601000
  596. EJECT 00602000
  597. WORK DSECT CONTINUED 00603000
  598. SPACE 00604000
  599. * RDBUF AND WRBUF PLISTS, DESCRIBED BY PLIST3 DSECT. 00605000
  600. SPACE 00606000
  601. RDPLIST DS 0F 00607000
  602. DC CL8'RDBUF' OPERATION 00608000
  603. RDFNAME DS CL8 FILE NAME 00609000
  604. RDFTYPE DS CL8 FILE TYPE 00610000
  605. RDFMODE DS CL2 FILE MODE 00611000
  606. RDITEM DC H'0' ITEM NUMBER 00612000
  607. RDBUFFA DS A BUFFER ADDRESS 00613000
  608. RDBUFFS DS F BUFFER SIZE 00614000
  609. RDFV DS CL2 F OR V -- RECFM 00615000
  610. RDNI DC H'1' NO OF ITEMS TO READ 00616000
  611. RDRET DS F NO OF BYTES READ RETURNED HERE 00617000
  612. SPACE 00618000
  613. WRPLIST DS 0F 00619000
  614. DC CL8'WRBUF' OPERATION 00620000
  615. WRFNAME DS CL8 FILE NAME 00621000
  616. WRFTYPE DS CL8 FILE TYPE 00622000
  617. WRFMODE DS CL2 FILE MODE 00623000
  618. WRITEM DC H'0' ITEM NUMBER 00624000
  619. WRBUFFA DS A BUFFER ADDRESS 00625000
  620. WRBUFFS DS F BUFFER SIZE 00626000
  621. WRFV DS CL2 F OR V -- RECFM 00627000
  622. WRNI DC H'1' NUMBER OF ITEMS TO WRITE 00628000
  623. SPACE 00629000
  624. OVPLIST DS 0F 00630000
  625. DC CL8'RDBUF' OPERATION 00631000
  626. OVFNAME DS CL8 FILE NAME 00632000
  627. OVFTYPE DS CL8 FILE TYPE 00633000
  628. OVFMODE DS CL2 FILE MODE 00634000
  629. OVITEM DC H'0' ITEM NUMBER 00635000
  630. OVBUFFA DS A BUFFER ADDRESS 00636000
  631. OVBUFFS DS F BUFFER SIZE 00637000
  632. OVFV DS CL2 F OR V -- RECFM 00638000
  633. OVNI DC H'1' NUMBER OF ITEMS TO READ 00639000
  634. OVRET DS F NO OF BYTES READ RETURNED HERE 00640000
  635. EJECT 00641000
  636. WORK DSECT CONTINUED 00642000
  637. SPACE 00643000
  638. * THE FOLLOWING CONTROL WORDS ARE ASSOCIATED WITH THE INPUT/OUTPUT 00644000
  639. * BUFFERS. THESE BUFFERS ARE ALLOCATED BY A SEPARATE GETMAIN MACRO. 00645000
  640. SPACE 00646000
  641. BUFAD DC A(0) BUFFER ADDRESS 00647000
  642. BUFLEN DC F'0' BUFFER LENGTH 00648000
  643. SPACE 00649000
  644. * BOTH THE INPUT AND OUTPUT BUFFERS ARE CONTAINED IN THE SAME BUFFER 00650000
  645. * AREA. THE INPUT BUFFER IS AT THE BEGINNING, AND OBUFAD GIVES THE 00651000
  646. * LOCATION OF THE OUTPUT BUFFER. 00652000
  647. OBUFAD DC A(0) 00653000
  648. OBUFLEN DC F'0' LENGTH OF OUTPUT BUFFER 00654000
  649. VBUFEND DS A END OF OUTBUF FOR VARIABLE *00655000
  650. OUTPUT 00656000
  651. SPACE 00657000
  652. BUFNEED DS F BUFFER SIZE NEEDED 00658000
  653. BINBYTE DS X BUFFER INITIALIZATION BYTE 00659000
  654. * THE PRECEDING BYTE WILL BE SET TO X'FF' IF IT IS NECESSARY TO 00660000
  655. * INITIALIZE THE OUTPUT BUFFER TO THE FILL CHARACTER AFTER EACH WRBUF. 00661000
  656. SPACE 00662000
  657. * THE FOLLOWING HALFWORD CONTAINS THE ITEM NUMBER OF THE FIRST OUTPUT 00663000
  658. * RECORD. IT IS USED TO DETERMINE WHETHER ANY RECORDS WERE WRITTEN TO 00664000
  659. * THE OUTPUT FILE. 00665000
  660. OFREC DS H FIRST OUTPUT RECORD ITEM # 00666000
  661. EJECT 00667000
  662. WORK DSECT CONTINUED 00668000
  663. SPACE 00669000
  664. * FLAGS FOR FILE SPECIFICATIONS 00670000
  665. MAXIN EQU 40 MAXIMUM NUMBER OF FILE NAMES *00671000
  666. IN 'COPY' PLIST 00672000
  667. INFLAGS DC (MAXIN)B'00000000' FLAG BYTES 00673000
  668. INEND DC X'FF' END OF INFLAGS 00674000
  669. OUTFLAGS DC B'00000000' OUTPUT FILE FLAGS 00675000
  670. SPACE 00676000
  671. * THE FOLLOWING ARE THE FLAGS SET IN INFLAGS AND OUTFLAG 00677000
  672. FENA EQU X'80' = SIGN IN FILE NAME 00678000
  673. FETY EQU X'40' = SIGN IN FILE TYPE 00679000
  674. FEMO EQU X'20' = SIGN IN FILE MODE 00680000
  675. FE EQU FENA+FETY+FEMO = SIGN SOMEWHERE 00681000
  676. FSNA EQU X'10' STAR IN FILE NAME 00682000
  677. FSTY EQU X'08' STAR IN FILE TYPE 00683000
  678. FSMO EQU X'04' STAR IN FILE MODE 00684000
  679. FS EQU FSNA+FSTY+FSMO STAR SOMEWHERE 00685000
  680. SPACE 00686000
  681. * FLAG FS IS SET IN CFLAGS IF THERE IS A STAR IN ANY FILE NA/TY/MO 00687000
  682. * EXCEPT THE FIRST INPUT FILE. THIS SITUATION IS ILLEGAL IN 00688000
  683. * MULTIPLE FILE MODE. 00689000
  684. CFLAGS DC B'00000000' 00690000
  685. EJECT 00691000
  686. WORK DSECT CONTINUED 00692000
  687. SPACE 00693000
  688. * PHASE CONTROL BYTES 00694000
  689. SPACE 00695000
  690. IN PW 12 INITIALIZATION PHASE @VA05624 00696000
  691. IN2 PW 13 LOOP THRU INPUT FOR LRGST LRECL @VA05624 00697000
  692. IN3 PW 5 SET LRECL AND RECFM @VA05624 00698000
  693. RE PW 9 'MULT' MODE RESTART PHASE 00699000
  694. PO PW 31 PROCESS OUTPUT FILE NAME @VA06129 00700000
  695. PC PW 9 PRE-COPY PHASE 00701000
  696. CO PW 15 COPY PHASE 00702000
  697. CV PW 8 SPECIAL OVLY PHASE @VA03971 00703000
  698. EO PW 17 EOF ON INPUT FILE @VA05624 00704000
  699. NI PW 10 NEW INPUT FILE PHASE 00705000
  700. CL PW 9 CLOSING PHASE @VA03972 00706000
  701. EJECT 00707000
  702. WORK DSECT CONTINUED 00708000
  703. SPACE 00709000
  704. * MISCELLANEOUS STORAGE SPACE 00710000
  705. SPACE 1 @VA04333 00711000
  706. PFSTAC DS 1F COPY OF FST FROM STATE @VA04333 00712000
  707. FFSTD DS 1F TIME AND DATE FOR MODE A3 @VA04333 00713000
  708. FFSTYR DS 1H YEAR FOR MODE A3 @VA04333 00714000
  709. SPACE 00715000
  710. ERLIST DMSERR MF=L,SUB=(,0,,0,,0,,0,,0,,0) ERROR MESSAGE PLIST 00716000
  711. SPACE 00717000
  712. TRTAB DS CL256 TRANSLATE TABLE 00718000
  713. SPACE 00719000
  714. STRING DS 0D,CL136 STRING STORAGE 00720000
  715. STEMP DS CL16 STRING TEMP 00721000
  716. SPACE 2 00722000
  717. * FLAG DOSF IS USED TO SAVE THE CONTENTS OF THE DOS SIMULATION FLAGS 00723000
  718. * LOCATED IN NUCON. 00724000
  719. DOSF DS X @V305066 00725000
  720. SPACE 2 00726000
  721. WORKLEN EQU (*+7-WORK)/8 WORKAREA LENGTH IN DOUBLEWORDS 00727000
  722. R0 EQU 0 00728000
  723. R1 EQU 1 00729000
  724. R2 EQU 2 00730000
  725. R3 EQU 3 00731000
  726. R4 EQU 4 00732000
  727. R5 EQU 5 00733000
  728. R6 EQU 6 00734000
  729. R7 EQU 7 00735000
  730. R8 EQU 8 00736000
  731. R9 EQU 9 00737000
  732. R10 EQU 10 00738000
  733. R11 EQU 11 00739000
  734. R12 EQU 12 00740000
  735. R13 EQU 13 00741000
  736. R14 EQU 14 00742000
  737. R15 EQU 15 00743000
  738. SPACE 00744000
  739. * REGISTER XR MUST EQUAL R2, SINCE IT IS USED BY TRT. 00745000
  740. XR EQU R2 SCRATCH REGISTER 00746000
  741. WR EQU R3 POINTER TO WORKSAPPACE AREA 00747000
  742. BR EQU R4 BASE REGISTER 00748000
  743. XR2 EQU R5 SECOND SCRATCH REGISTER 00749000
  744. XR3 EQU R6 THIRD SCRATCH REGISTER 00750000
  745. CDR EQU R7 PHASE CODE POINTER 00751000
  746. RR EQU R8 INTERNAL SUB RETURN REG 00752000
  747. SPR EQU R9 POINTER TO SPSECT 00753000
  748. BR2 EQU R10 SECOND BASE REGISTER 00754000
  749. BR3 EQU R11 THIRD BASE REGISTER 00755000
  750. BR4 EQU R12 FOURTH BASE REGISTER 00756000
  751. SPACE 2 00757000
  752. USING DMSCPY,BR,BR2,BR3,BR4 BASE REGISTERS 00758000
  753. USE WORK,WR WORKAREA POINTER 00759000
  754. USE SPSECT,SPR 00760000
  755. DMSCPY CSECT 00761000
  756. SAVE (14,12),,* 00762000
  757. LA XR,X'FFF' 00763000
  758. LR BR,R15 SET BASE REGISTER 00764000
  759. LA BR2,1(XR,BR) SET SECOND BASE REG 00765000
  760. LA BR3,1(XR,BR2) SET THIRD BASE REGISTER 00766000
  761. LA BR4,1(XR,BR3) SET FOURTH BASE REGISTER 00767000
  762. LA XR,0(,R1) 'COPY' PLIST POINTER 00768000
  763. STRINIT CALL STORAGE INITIALIZATION 00769000
  764. USING NUCON,R0 @V305066 00770000
  765. DMSKEY NUCLEUS @V305066 00771000
  766. IC R5,DOSFLAGS GET NUCON'S DOSFLAGS @V305066 00772000
  767. NI DOSFLAGS,255-DOSSVC TURN OFF DOS SVC HANDLE @V305066 00773000
  768. DMSKEY RESET @V305066 00774000
  769. GETMAIN R,LV=WORKLEN*8 GET WORK AREA SPACE 00775000
  770. LR WR,R1 POINT TO WORK AREA 00776000
  771. SR R15,R15 00777000
  772. LR R0,WR 00778000
  773. LA R1,8*WORKLEN 00779000
  774. MVCL R0,R14 ZERO OUT WORK AREA 00780000
  775. SPACE 00781000
  776. * INITIALIZE FIELDS IN WORK AREA 00782000
  777. SPACE 00783000
  778. STC R5,DOSF TEMPORARILY STORE DOSFLAGS @V305066 00784000
  779. ST R13,SAVE13 SAVE REGISTER 13 00785000
  780. LA R13,SAVEAREA POINT TO NEW SAVE AREA 00786000
  781. ST XR,PLPTR SAVE 'COPY' PLIST POINTER 00787000
  782. MVI FILLC,C' ' 00788000
  783. MVI SPECSBE,X'FF' 00789000
  784. LA R1,SPECSTM 00790000
  785. ST R1,SPECSTM 00791000
  786. MVI PACKVER+1,C'1' 00792000
  787. MVC ERPLIST,=CL8'ERASE' 00793000
  788. MVC ERPLIST+8+3*8(8),=8X'FF' 00794000
  789. MVC FIPLIST,=CL8'FINIS' 00795000
  790. MVC FIPLIST+8+3*8(8),=8X'FF' 00796000
  791. MVC RNPLIST,=CL8'RENAME' 00797000
  792. MVC RNPLIST+8+6*8(8),=8X'FF' 00798000
  793. MVC STPLIST,=CL8'STATE' 00799000
  794. MVC STPLIST+3*8(8),=8X'FF' 00800000
  795. MVC CRPLIST(8),=CL8'WAITRD' 00801000
  796. LA XR,STRING 00802000
  797. ST XR,CRPLIST+8 00803000
  798. MVI CRPLIST+8,1 00804000
  799. MVC RDPLIST(8),=CL8'RDBUF' 00805000
  800. MVI RDNI+1,1 00806000
  801. MVC WRPLIST(8),=CL8'WRBUF' 00807000
  802. MVI WRNI+1,1 00808000
  803. MVC OVPLIST(8),=CL8'RDBUF' 00809000
  804. MVI OVNI+1,1 00810000
  805. MVI INEND,X'FF' 00811000
  806. * WE CREAT ONE 'INFLAGS' FLAG BYTE FOR EACH INPUT FILE. 00812000
  807. LA XR3,INFLAGS 00813000
  808. SPACE 00814000
  809. L XR2,PLPTR POINTER TO 'COPY' PLIST 00815000
  810. USE PLIST1,XR2 00816000
  811. SPACE 00817000
  812. * FOR USE OF PLIST1, SEE DSECT DESCRIPTION. 00818000
  813. SPACE 00819000
  814. * IF THE OPTION LIST BEGINS IMMEDIATELY, THEN THERE ARE NO FILES 00820000
  815. * SPECIFIED. 00821000
  816. CLI PNA1,C'(' FIRST TOKEN IS AN OPTION? 00822000
  817. BE ERNOIN ERROR -- NO INPUT FILES 00823000
  818. CLI PNA1,X'FF' NO TOKENS WHATSOEVER? 00824000
  819. BE ERNOIN ERROR -- NO INPUT FILES 00825000
  820. SPACE 00826000
  821. * SET UP TRANSLATE TABLE FOR THE IDENTIFICATION OF =, *, ( AND X'FF' 00827000
  822. * IN THE FILE NAMES. (THE LATTER TWO SIGNAL THE START OF THE OPTION 00828000
  823. * LIST.) 00829000
  824. XC TRTAB,TRTAB ALL FIELDS 0 EXCEPT: 00830000
  825. MVI TRTAB+C'*',4 * -> 4 00831000
  826. MVI TRTAB+C'=',8 = -> 8 00832000
  827. MVI TRTAB+C'(',12 ( -> 12 00833000
  828. MVI TRTAB+X'FF',12 FF -> 12 00834000
  829. SPACE 2 00835000
  830. CLI PNEXTNA,X'FF' NO 2ND FILEID SPECIFIED? 00836000
  831. BE DEFO USE DEFAULT NAME 00837000
  832. CLI PNEXTNA,C'(' 00838000
  833. BNE INLUP OTHERWISE, GO START PROCESSING 00839000
  834. DEFO EQU * 00840000
  835. OI OPF1,OP1DEFO SET DEFAULT OUTPUT NAME FLAG 00841000
  836. B INLUP1 GO PROCESS INPUT FILENAME 00842000
  837. EJECT 00843000
  838. * COME HERE EACH TIME TO PROCESS NAME OF NEXT INPUT FILE. 00844000
  839. INLUP EQU * 00845000
  840. TM OPF1,OP1DEFO DEFAULT OUTPUT FILE NAME? 00846000
  841. BO INLUPE WE'RE THRU IF SO 00847000
  842. SPACE 00848000
  843. * IF THE NEXT NAME AFTER THE CURRENT ONE BEGINS WITH C'(' OR X'FF', 00849000
  844. * THEN THIS NAME IS AN OUTPUT FILE RATHER THAN AN INPUT FILE. 00850000
  845. CLI PNEXTNA,X'FF' 00851000
  846. BE INLUPE END OF INPUT FILE NAME PROC 00852000
  847. CLI PNEXTNA,C'(' 00853000
  848. BE INLUPE 00854000
  849. SPACE 00855000
  850. * XR3 POINTS TO THE CURRENT FILE FLAG BYTE. IF THIS BYTE ALREADY 00856000
  851. * CONTAINS X'FF' RATHER THAN ZERO, THEN WE DON'T HAVE ROOM FOR ANY 00857000
  852. * MORE INPUT FILE NAMES. 00858000
  853. CLI 0(XR3),X'FF' 00859000
  854. BE ERTMI TOO MANY INPUT FILE NAMES 00860000
  855. SPACE 00861000
  856. * WE FIRST CHECK FOR ILLEGAL CHARACTERS IN THE FILENAME. 00862000
  857. INLUP1 EQU * 00863000
  858. MVI TRTAB+C'*',0 DON'T CATCH *'S 00864000
  859. MVI TRTAB+C'=',0 DON'T CATCH ='S 00865000
  860. TRT PNA1(18),TRTAB CHECK FOR ILLEGAL CHARS 00866000
  861. BNZ ERILC ERROR IF ANY FOUND 00867000
  862. CLI PMO1+2,C' ' MORE THAN TWO CHARS IN FMODE? 00868000
  863. BNE ERFM ERROR IF THERE ARE 00869000
  864. MVI TRTAB+C'*',4 CHECK FOR *'S IN NAME 00870000
  865. TRT PNA1(18),TRTAB SEARCH 00871000
  866. BZ INLUPNS SKIP FOLLOWING CODE IF NONE 00872000
  867. SPACE 00873000
  868. * IF THERE IS AN ASTERISK IN THE FILE NAME, WE RECORD THIS FACT IN THE 00874000
  869. * FLAG BYTE, AND THEN GO ON TO CHECK FOR AN EQUAL SIGN. 00875000
  870. TRT PNA1,TRTAB STAR IN FILE NAME? 00876000
  871. BZ *+8 SKIP IF NOT 00877000
  872. OI 0(XR3),FSNA SET FLAG IF SO 00878000
  873. TRT PTY1,TRTAB STAR IN FILE TYPE? 00879000
  874. BZ *+8 SKIP IF NOT 00880000
  875. OI 0(XR3),FSTY SET FLAG IF SO 00881000
  876. TRT PMO1,TRTAB STAR IN FILE MODE? 00882000
  877. BZ *+8 SKIP IF NOT 00883000
  878. OI 0(XR3),FSMO SET FLAG IF SO 00884000
  879. SPACE 00885000
  880. MVI TRTAB+C'*',0 DON'T FIND A STAR ANYMORE 00886000
  881. C XR2,PLPTR IS THIS THE FIRST INPUT FILE? 00887000
  882. BE INLUPNS GO IF NOT 00888000
  883. OI CFLAGS,FS OTHERWISE, SET 'COMBINED' FLAG 00889000
  884. SPACE 00890000
  885. SPACE 00891000
  886. * COME HERE TO CHECK FOR EQUAL SIGN. 00892000
  887. INLUPNS EQU * 00893000
  888. MVI TRTAB+C'=',8 CATCH ='S 00894000
  889. TRT PNA1(18),TRTAB SEARCH FOR ='S 00895000
  890. BZ INLUPR GO IF NONE 00896000
  891. * THERE IS AN EQUAL SIGN SOMEWHERE IN THE NAME. WE NOW FIND IT. 00897000
  892. INLUPEQ EQU * 00898000
  893. C XR2,PLPTR IS THIS FIRST INPUT FILE? 00899000
  894. BE ERILC YES -- EQUAL SIGN ILLEGAL 00900000
  895. TRT PNA1,TRTAB EQUAL SIGN IN NAME? 00901000
  896. BZ *+8 SKIP IF NOT 00902000
  897. OI 0(XR3),FENA SET FLAG 00903000
  898. TRT PTY1,TRTAB EQUAL SIGN IN TYPE? 00904000
  899. BZ *+8 SKIP IF NOT 00905000
  900. OI 0(XR3),FETY SET FLAG 00906000
  901. TRT PMO1,TRTAB EQUAL SIGN IN MODE? 00907000
  902. BZ *+8 SKIP IF NOT 00908000
  903. OI 0(XR3),FEMO SET FLAG 00909000
  904. SPACE 00910000
  905. * COME HERE WHEN FINISHED PROCESSING ONE INPUT FILE NAME, TO CHECK 00911000
  906. * FOR NEXT 00912000
  907. INLUPR EQU * 00913000
  908. LA XR3,1(,XR3) POINT TO NEXT FLAG BYTE 00914000
  909. LA XR2,PNEXT1 POINT TO NEXT FILE NAME 00915000
  910. B INLUP GO PROCESS IT 00916000
  911. SPACE 00917000
  912. * COME HERE AT END OF INPUT FILE NAME PROCESSING 00918000
  913. INLUPE EQU * 00919000
  914. MVI 0(XR3),X'FF' SET X'FF' TO LAST FLAG BYTE 00920000
  915. CLI INFLAGS,X'FF' WERE THERE ANY INPUT FILES? 00921000
  916. BE ERNOIN NO INPUT FILES SPECIFIED 00922000
  917. TM OPF1,OP1DEFO IS DEFAULT OUTPUT FILEID USED? 00923000
  918. BZ OUTF GO IF NOT 00924000
  919. MVI OUTFLAGS,FE SET ALL = FLAGS IN OUTFLAGS 00925000
  920. LA R1,=3CL8'=' SET OUTPUT FILEID OF '= = =' 00926000
  921. SH R1,=H'8' MAKE IT INTO A PLIST PTR 00927000
  922. ST R1,POUPL1 SAVE AS OUTPUT PLIST PTR 00928000
  923. B OUTCK 00929000
  924. SPACE 00930000
  925. * AT THIS POINT, REGISTER XR2 IS A PLIST1 POINTER FOR THE OUTPUT 00931000
  926. * FILE NAME. 00932000
  927. OUTF EQU * 00933000
  928. ST XR2,POUPL1 STORE OUTPUT PLIST1 PTR 00934000
  929. MVI TRTAB+C'*',4 RECOGNIZE *'S 00935000
  930. MVI TRTAB+C'=',0 DON'T CATCH ='S 00936000
  931. TRT PNA1(18),TRTAB SEARCH FOR ILLEGAL CHARS 00937000
  932. BNZ ERILC GO IF ANY 00938000
  933. CLI PMO1+2,C' ' MORE THAN TWO CHARS IN FMODE? @VA04194 00939000
  934. BNE ERFM ERROR IF THERE ARE @VA04194 00940000
  935. MVI TRTAB+C'=',8 CATCH ='S 00941000
  936. TRT PNA1(18),TRTAB ANY ='S? 00942000
  937. BZ OUTCR GO IF NONE 00943000
  938. SPACE 00944000
  939. OUTEQ EQU * 00945000
  940. TRT PNA1,TRTAB CHECK FOR ='S IN FILE NAME 00946000
  941. BZ *+8 SKIP IF NONE 00947000
  942. OI OUTFLAGS,FENA SET FLAG IF SO 00948000
  943. TRT PTY1,TRTAB CHECK FILE TYPE 00949000
  944. BZ *+8 00950000
  945. OI OUTFLAGS,FETY SET FLAG 00951000
  946. TRT PMO1,TRTAB CHECK FILE MODE 00952000
  947. BZ *+8 00953000
  948. OI OUTFLAGS,FEMO 00954000
  949. SPACE 00955000
  950. * IF A STAR WAS SPECIFIED IN THE FIRST INPUT FILE IN THE SAME 00956000
  951. * PLACE THAT AN EQUAL WAS SPECIFIED IN THE OUTPUT FILE, THEN WE 00957000
  952. * DEFAULT TO 'MULTIPLE' OUTPUT FILE MODE. 00958000
  953. OUTCK EQU * 00959000
  954. IC R0,INFLAGS GET FIRST INPUT FILE FLAGS 00960000
  955. IC R1,OUTFLAGS GET OUTPUT FILE FLAGS 00961000
  956. N R1,=AL1(0,0,0,FE) MASK OUT 'EQUAL' BITS 00962000
  957. SRL R1,3 SHIFT 'EQUAL' BITS TO 'STAR' *00963000
  958. POSITIONS 00964000
  959. NR R1,R0 'AND' THE FIELDS TOGETHER 00965000
  960. BZ *+8 SKIP IF NO MATCHES 00966000
  961. OI OPF2,OP2MULT SET 'MULTIPLE' MODE FLAG 00967000
  962. SPACE 00968000
  963. * END OF FILE NAME PROCESSING 00969000
  964. OUTCR EQU * 00970000
  965. LA XR2,8(,XR2) ADVANCE XR2 TO FIRST OPTION TOKN 00971000
  966. TM OPF1,OP1DEFO DEFAULT OUTPUT FILENAME USED? 00972000
  967. BO *+8 SKIP IF SO 00973000
  968. LA XR2,24(,XR2) IF NOT, SKIP OVER OUTPUT FILE 00974000
  969. * PROCESS OPTION LIST. 00975000
  970. CLI 0(XR2),X'FF' ANY OPTIONS SPECIFIED? 00976000
  971. BE ENDOP GO IF NOT 00977000
  972. MVC STEMP(7),1(XR2) COPY FROM AFTER INITIAL '(' 00978000
  973. MVI STEMP+7,C' ' FILL IN FINAL BLANK 00979000
  974. CLI STEMP,C' ' DOES INITIAL ( HAVE AN OPTION? 00980000
  975. BNE OP1 GO PROCESS IT IF SO 00981000
  976. SPACE 00982000
  977. * COME HERE TO PROCESS EACH NEW OPTION. 00983000
  978. OPLUP EQU * 00984000
  979. LA XR2,8(,XR2) POINT TO NEXT OPTION TOKEN 00985000
  980. CLI 0(XR2),X'FF' END OF OPTION LIST? 00986000
  981. BE ENDOP GO IF SO 00987000
  982. CLI 0(XR2),C')' RIGHT PAREN? 00988000
  983. BE OPRPAR GO IF YES 00989000
  984. MVC STEMP(8),0(XR2) COPY OPTION INTO STEMP 00990000
  985. SPACE 00991000
  986. * AT THIS POINT, 'STEMP' CONTAINS THE OPTION 00992000
  987. OP1 EQU * 00993000
  988. LA R1,STEMP+7 WE SEARCH FOR FINAL NON-BLANK 00994000
  989. LA XR3,8 MAX 8 CHARS 00995000
  990. CLI 0(R1),C' ' IS THIS A BLANK? 00996000
  991. BCTR R1,0 DECREMENT ADDRESS 00997000
  992. BCTR XR3,0 DECREMENT CHAR COUNT 00998000
  993. BE *-8 LOOP IF A BLANK 00999000
  994. SPACE 01000000
  995. * AT THIS POINT, XR3 CONTAINS OPTION (LENGTH - 1). 01001000
  996. * WE NOW SEARCH THROUGH THE OPTION NAME CONTROL BLOCKS FOR THIS OPTION 01002000
  997. * NAME. 01003000
  998. USE OPSECT,XR 01004000
  999. * THESE CONTROL BLOCKS ARE GENERATED BY THE OPTAB MACRO AT LOCATION 01005000
  1000. * OPTAB. 01006000
  1001. LA XR,OPTAB POINT TO FIRST BLOCK 01007000
  1002. LA R14,OPSLEN LENGTH OF A BLOCK 01008000
  1003. LA R15,OPTEND-OPSLEN END OF CONTROL BLOCKS 01009000
  1004. B OPFLUP ENTER SEARCH LOOP 01010000
  1005. SPACE 01011000
  1006. OPCLC CLC STEMP(0),OPNAME LENGTH FILLED IN BY EX 01012000
  1007. OPCLI CLI OPMIN,0 OPERAND FILLED IN BY EX 01013000
  1008. SPACE 01014000
  1009. * SEARCH LOOP 01015000
  1010. CNOP 0,8 01016000
  1011. OPFLUP EQU * 01017000
  1012. EX XR3,OPCLI WERE ENOUGH CHARS SPECIFIED *01018000
  1013. FOR THIS OPTION? 01019000
  1014. BH OPLEND SKIP IF NOT 01020000
  1015. EX XR3,OPCLC IS THIS THE OPTION? 01021000
  1016. BE OPFIND LOOP IF IT IS NOT 01022000
  1017. SPACE 01023000
  1018. OPLEND EQU * 01024000
  1019. BXLE XR,R14,OPFLUP LOOP BACK FOR NEXT 01025000
  1020. SPACE 01026000
  1021. B ERILO ILLEGAL OPTION 01027000
  1022. SPACE 01028000
  1023. * COME HERE WHEN OPTION FOUND 01029000
  1024. OPFIND EQU * 01030000
  1025. SPACE 01031000
  1026. * WE COMPUTE THE NUMBER OF THIS OPTION IN THE TABLE BY DIVIDING THE 01032000
  1027. * LENGTH OF A TABLE ENTRY INTO THE DISPLACEMENT INTO THE TABLE. 01033000
  1028. LR R1,XR CURRENT TABLE ADDRESS 01034000
  1029. LA R0,OPTAB START OF TABLE 01035000
  1030. SR R1,R0 DISPLACEMENT INTO TABLE 01036000
  1031. SR R0,R0 FOR DIVISION 01037000
  1032. D R0,=A(OPSLEN) DIVIDE BY LENGTH OF TABLE ENTRY 01038000
  1033. SPACE 01039000
  1034. * AT THIS POINT, THE QUOTIENT IS IN R1. 01040000
  1035. LH R15,NOPS GET NUMBER OF OPTIONS SO FAR 01041000
  1036. LA R15,1(,R15) ADD 1 01042000
  1037. STH R15,NOPS 01043000
  1038. STC R1,OPBYTES-1(R15) SAVE THIS OPTION VALUE 01044000
  1039. L R15,OPADD GET BRANCH ADDRESS FOR OPTION *01045000
  1040. HANDLER 01046000
  1041. BR R15 GO HANDLE THE OPTION 01047000
  1042. SPACE 2 01048000
  1043. EJECT 01049000
  1044. * PROCESS TYPE AND NOTYPE OPTIONS. 01050000
  1045. @TYPE EQU * 01051000
  1046. OI OPF1,OP1TYPE SET FLAG 01052000
  1047. SPACE 01053000
  1048. @NOTYPE EQU * 01054000
  1049. B OPLUP 01055000
  1050. EJECT 01056000
  1051. EJECT 01062000
  1052. * HANDLE OLDDATE AND NEWDATE OPTIONS. 01063000
  1053. @OLDDATE EQU * 01064000
  1054. OI OPF1,OP1OLDD SET FLAG 01065000
  1055. SPACE 01066000
  1056. @NEWDATE EQU * 01067000
  1057. B OPLUP 01068000
  1058. EJECT 01069000
  1059. * HANDLE LRECL OPTION 01070000
  1060. @LRECL EQU * 01071000
  1061. LA XR2,8(,XR2) POINT TO NEXT OPTION FIELD 01072000
  1062. BAL RR,GETNUM GET NUMERIC LRECL 01073000
  1063. C R1,=A(X'FFFF') TOO BIG? 01074000
  1064. BH ERARG ILLEGAL ARGUMENT 01075000
  1065. ST R1,LRECL OTHERWISE SAVE VALUE 01076000
  1066. B OPLUP GO FOR NEXT OPTION 01077000
  1067. EJECT 01078000
  1068. * HANDLE RECFM OPTION 01079000
  1069. @RECFM EQU * 01080000
  1070. LA XR2,8(,XR2) POINT TO SUB-FIELD 01081000
  1071. CLI 1(XR2),C' ' MORE THAN 1 CHAR? 01082000
  1072. BNE ERARG ILLEGAL IF YES 01083000
  1073. MVC RECFM,0(XR2) COPY THE FIELD 01084000
  1074. CLI RECFM,C'F' IS IT 'F'? 01085000
  1075. BE OPLUP OK IF IT IS 01086000
  1076. CLI RECFM,C'V' IS IT 'V'? 01087000
  1077. BE OPLUP GO IF IT IS 01088000
  1078. B ERARG ILLEGAL SUB-ARGUMENT 01089000
  1079. EJECT 01090000
  1080. * HANDLE 'EBCDIC', 'TRANS', 'UPCASE' AND 'LOWCASE' OPTIONS. 01091000
  1081. @EBCDIC EQU * 01092000
  1082. OI OPF3,OP3EBCD SET FLAG 01093000
  1083. B OPLUP GO FOR NEXT OPTION 01094000
  1084. SPACE 2 01095000
  1085. @TRANS EQU * 01096000
  1086. OI OPF3,OP3TRAN SET 'TRANS' FLAG 01097000
  1087. B OPLUP 01098000
  1088. SPACE 2 01099000
  1089. @UPCASE EQU * 01100000
  1090. OI OPF3,OP3UPCA SET 'UPCASE' FLAG 01101000
  1091. B OPLUP 01102000
  1092. SPACE 2 01103000
  1093. @LOWCASE EQU * 01104000
  1094. OI OPF3,OP3LOCA SET 'LOWCASE' FLAG 01105000
  1095. B OPLUP 01106000
  1096. EJECT 01107000
  1097. * HANDLE 'FROM' OPTION 01108000
  1098. @FROM EQU * 01109000
  1099. LA XR2,8(,XR2) POINT TO FIRST SUB-FIELD 01110000
  1100. BAL RR,GETNUM GET NUMERIC FIELD 01111000
  1101. ST R1,FROMN STORE RESULT 01112000
  1102. B OPLUP GO FOR NEXT OPTION 01113000
  1103. EJECT 01114000
  1104. * HANDLE 'FRLABEL' 01115000
  1105. @FRLABEL EQU * 01116000
  1106. LA XR2,8(,XR2) POINT TO LABEL 01117000
  1107. MVC FRL,0(XR2) COPY 8 BYTE FIELD 01118000
  1108. OI OPF1,OP1FRL SET FLAG TO INDICATE 01119000
  1109. * COMPUTE (LENGTH OF LABEL) -1 01120000
  1110. LA XR,8(,XR2) POINT BEYOND END OF LABEL 01121000
  1111. BCTR XR,0 DECREMENT POINTER 01122000
  1112. CLI 0(XR),C' ' IS IT A BLANK? 01123000
  1113. BE *-6 LOOP BACK IF NOT 01124000
  1114. SR XR,XR2 XR CONTAINS (LENGTH - 1) 01125000
  1115. STH XR,FRLL STORE IN WORK FIELD 01126000
  1116. B OPLUP GO FOR NEXT OPTION 01127000
  1117. EJECT 01128000
  1118. * HANDLE 'FOR' OPTION 01129000
  1119. @FOR EQU * 01130000
  1120. LA XR2,8(,XR2) POINT TO FIRST SUB-FIELD 01131000
  1121. BAL RR,GETNUM GET NUMERIC FIELD 01132000
  1122. ST R1,FORN STORE RESULT 01133000
  1123. B OPLUP GO FOR NEXT OPTION 01134000
  1124. EJECT 01135000
  1125. * HANDLE 'TOLABEL' 01136000
  1126. @TOLABEL EQU * 01137000
  1127. LA XR2,8(,XR2) POINT TO LABEL FIELD 01138000
  1128. MVC TOL,0(XR2) COPY 8 BYTE FIELD 01139000
  1129. OI OPF1,OP1TOL SET FLAG TO INDICATE 01140000
  1130. * COMPUTE (LENGTH OF LABEL) - 1 01141000
  1131. LA XR,8(,XR2) POINT BEYOND END OF LABEL 01142000
  1132. BCTR XR,0 DECREMENT POINTER 01143000
  1133. CLI 0(XR),C' ' IS IT A BLANK? 01144000
  1134. BE *-6 LOOP BACK IF NOT 01145000
  1135. SR XR,XR2 XR CONTAINS (LENGTH - 1) 01146000
  1136. STH XR,TOLL STORE IN WORK FIELD 01147000
  1137. B OPLUP GO FOR NEXT OPTION 01148000
  1138. EJECT 01149000
  1139. * HANDLE TRUNC AND NOTRUNC OPTIONS 01150000
  1140. @TRUNC EQU * 01151000
  1141. OI OPF1,OP1TRUNC SET FLAG TO INDICATE TRUNC 01152000
  1142. SPACE 01153000
  1143. @NOTRUNC EQU * 01154000
  1144. B OPLUP GO FOR NEXT OPTION 01155000
  1145. EJECT 01156000
  1146. * HANDLE 'FILL' OPTION 01157000
  1147. @FILL EQU * 01158000
  1148. LA XR2,8(,XR2) POINT TO FILL CHAR 01159000
  1149. CLI 2(XR2),C' ' MORE THAN TWO CHARS SPECIFIED? 01160000
  1150. BNE ERARG ERROR IF SO 01161000
  1151. IC R1,0(XR2) GET FIRST CHAR OF FILL 01162000
  1152. CLI 1(XR2),C' ' ONLY ONE CHAR SPECIFIED? 01163000
  1153. BE *+12 USE THAT CHAR IF SO 01164000
  1154. BAL RR,GETHEX GET HEX FOR 2 CHARACTERS 01165000
  1155. B ERARG ERROR RETURN FROM GETHEX 01166000
  1156. STC R1,FILLC STORE AS FILL CHARACTER 01167000
  1157. B OPLUP GO FOR NEXT OPTION 01168000
  1158. EJECT 01169000
  1159. EJECT 01193000
  1160. * HANDLE 'PACK' AND 'UNPACK' OPTIONS 01194000
  1161. @PACK EQU * 01195000
  1162. OI OPF2,OP2PACK SET 'PACK' OPTION FLAG 01196000
  1163. B OPLUP GO FOR NEXT OPTION 01197000
  1164. SPACE 2 01198000
  1165. @UNPACK EQU * 01199000
  1166. OI OPF2,OP2UNPA SET 'UNPACK' OPTION FLAG 01200000
  1167. B OPLUP GO FOR NEXT OPTION 01201000
  1168. EJECT 01202000
  1169. * HANDLE 'REPLACE', 'OVLY', 'APPEND' AND 'NEWFILE' OPTIONS 01203000
  1170. @REPLACE EQU * 01204000
  1171. OI OPF2,OP2REPL SET 'REPLACE' FLAG 01205000
  1172. B OPLUP GO FOR NEXT OPTION 01206000
  1173. SPACE 2 01207000
  1174. @OVLY EQU * 01208000
  1175. OI OPF2,OP2OVLY SET 'OVLY' FLAG 01209000
  1176. B OPLUP 01210000
  1177. SPACE 2 01211000
  1178. @APPEND EQU * 01212000
  1179. OI OPF2,OP2APPE SET 'APPEND' FLAG 01213000
  1180. B OPLUP 01214000
  1181. SPACE 2 01215000
  1182. * 'NEWFILE' FLAG WILL BE SET LATER AS THE DEFAULT. 01216000
  1183. @NEWFILE EQU * 01217000
  1184. OI OPF2,OP2NEWF SET 'NEWFILE' FLAG 01218000
  1185. B OPLUP GO FOR NEXT OPTION 01219000
  1186. EJECT 01220000
  1187. * HANDLE 'SPECS' AND 'NOSPECS' OPTIONS 01221000
  1188. @SPECS EQU * 01222000
  1189. OI OPF1,OP1SPECS SET SPECS FLAG 01223000
  1190. SPACE 2 01224000
  1191. @NOSPECS EQU * 01225000
  1192. B OPLUP GO FOR NEXT OPTION 01226000
  1193. EJECT 01227000
  1194. * HANDLE 'PROMPT' AND 'NOPROMPT' OPTIONS 01228000
  1195. @NOPROMP EQU * 01229000
  1196. OI OPF1,OP1NOPR SET NOPROMPT FLAG 01230000
  1197. SPACE 2 01231000
  1198. @PROMPT EQU * 01232000
  1199. B OPLUP GO FOR NEXT OPTION 01233000
  1200. EJECT 01234000
  1201. * HANDLE 'SINGLE' OPTION @VA05078 01235000
  1202. @SINGLE EQU * 01236000
  1203. NI OPF2,X'FF'-OP2MULT TURN OFF 'MULTIPLE' FLAG 01237000
  1204. B OPLUP GO FOR NEXT OPTION 01238000
  1205. EJECT 01239000
  1206. * COME HERE IF A RIGHT PAREN IS FOUND IN THE OPTION LIST. 01240000
  1207. OPRPAR EQU * 01241000
  1208. CLI 8(XR2),X'FF' IS THIS THE LAST OPTION? 01242000
  1209. BE ENDOP FINISHED WITH OPTIONS IF SO 01243000
  1210. SPACE 01244000
  1211. * OTHERWISE, WE HAVE AN ERROR SITUATION 01245000
  1212. MVC STEMP(2),0(XR2) COPY RIGHT PAREN INTO STEMP 01246000
  1213. MVC STEMP+2(6),8(XR2) COPY NEXT OPTION INTO STEMP 01247000
  1214. B ERILO GO TYPE ERROR MESSAGE 01248000
  1215. SPACE 01249000
  1216. * COME HERE AFTER ALL OPTIONS HAVE BEEN PROCESSED. 01250000
  1217. ENDOP EQU * 01251000
  1218. * IF REPLACE, OVLY AND APPEND WERE NOT SPECIFIED, THEN WE SET NEWFILE 01252000
  1219. * FLAG. 01253000
  1220. TM OPF2,OP2REPL+OP2OVLY+OP2APPE+OP2NEWF 01254000
  1221. BNZ ENDOP0 ONE WAS SPECIFIED 01255000
  1222. OI OPF2,OP2NEWF SET NEWFILE FLAG 01256000
  1223. L R1,POUPL1 POINT TO OUTPUT NAME PLIST 01257000
  1224. USE PLIST1,R1 01258000
  1225. CLC PNA1(24),=3CL8'=' OUTPUT NAME ALL ='S? 01259000
  1226. BNE *+8 SKIP IF NOT 01260000
  1227. XI OPF2,OP2NEWF+OP2REPL OTHERWISE, NEWF OFF AND REPL ON 01261000
  1228. ENDOP0 EQU * 01262000
  1229. SPACE 2 01263000
  1230. TM OPF2,OP2MULT IS 'MULTIPLE' MODE IN EFFECT? 01264000
  1231. BZ ENDOP1 SKIP CHECKING IF NOT 01265000
  1232. SPACE 01266000
  1233. * IN MULTIPLE MODE, IT IS ILLEGAL FOR *'S TO APPEAR IN ANY @VA05078 01267000
  1234. * FILE NA/TY/MO SPECIFICATION EXCEPT THAT FOR THE FIRST INPUT FILE. 01268000
  1235. * WE HAVE SET THE FLAG FS IN CFLAGS TO INDICATE WHETHER THE USER HAS 01269000
  1236. * ENTERED SUCH AN ASTERISK. 01270000
  1237. TM CFLAGS,FS ILLEGAL ASTERISK? 01271000
  1238. BZ ENDOP1 GO FOR NEXT OPTION IF NOT 01272000
  1239. SPACE 01273000
  1240. * OTHERWISE, WE GO BACK AND SEARCH OUR FLAG BYTES FOR THE ILLEGAL 01274000
  1241. * SPECIFICATION, SO THAT WE CAN TYPE IT OUT IN THE ERROR MESSAGE. 01275000
  1242. L XR2,PLPTR POINT TO 'COPY' PLIST 01276000
  1243. LA XR,INFLAGS POINT TO FIRST FLAG BYTE 01277000
  1244. USE PLIST1,XR2 01278000
  1245. SPACE 01279000
  1246. ENDOPM EQU * 01280000
  1247. LA XR2,PNEXT1 POINT TO NEXT FILE SPEC 01281000
  1248. LA XR,1(,XR) POINT TO NEXT FLAG BYTE 01282000
  1249. TM 0(XR),FS STAR SPECIFIED? 01283000
  1250. BZ ENDOPM LOOP IF NOT 01284000
  1251. B ERMST OTHERWISE, GO TYPE MESSAGE 01285000
  1252. SPACE 5 01286000
  1253. * IF BOTH 'TOLABEL' AND 'FRLABEL' WERE SPECIFIED, WE CHECK FOR ILLEGAL 01287000
  1254. * SITUATIONS. 01288000
  1255. ENDOP1 EQU * 01289000
  1256. TM OPF1,OP1FRL+OP1TOL BOTH 'FRLABEL' AND 'TOLABEL'? 01290000
  1257. BNO ENDOP2 GO IF NOT BOTH 01291000
  1258. LH XR,TOLL GET (LEN - 1) OF TOLABEL 01292000
  1259. B *+10 SKIP DUMMY CLC INSTRUCTION 01293000
  1260. CLC TOL(0),FRL LENGTH FILLED IN BY EX P3090 01294000
  1261. EX XR,*-6 COMPARE 'TOLABEL' WITH 'FRLABEL' 01295000
  1262. BNE ENDOP2 UNEQUAL -- NOTHING TO DO 01296000
  1263. SPACE 01297000
  1264. * OTHERWISE, IT'S ONE OF TWO POSSIBLE ERRORS. WE MUST DECIDE WHICH SO 01298000
  1265. * THAT WE CAN GIVE A PROPER ERROR MESSAGE. 01299000
  1266. CH XR,FRLL COMPARE LENGTHS OF LABELS 01300000
  1267. BE ERLAE BOTH LABELS ARE EQUAL 01301000
  1268. BL ERLAS 'FRL' IS SUBSTRING OF 'TOL' 01302000
  1269. SPACE 01303000
  1270. ENDOP2 EQU * 01304000
  1271. * CHECK FOR CONFLICTS IN OPTIONS. 01305000
  1272. * WE DO THIS BY GETTING THE CODE BYTES FOR THE OPTIONS AND CHECKING 01306000
  1273. * EACH PAIR AGAINST THE 'CONFTAB' OPTION CONFLICT LIST. 01307000
  1274. SR XR2,XR2 OPTION COUNTER (OUTSIDE LOOP) 01308000
  1275. LA R15,CONFEND-2 END OF CONFTAB CONFLICT TABLE 01309000
  1276. LA R14,2 LENGTH OF CONFTAB ELEMENT 01310000
  1277. SPACE 01311000
  1278. * OUTER LOOP. COME HERE TO PROCESS NEW OPTION. 01312000
  1279. CF1 EQU * 01313000
  1280. LA XR2,1(,XR2) POINT TO NEXT OPTION 01314000
  1281. CH XR2,NOPS END OF OPTION LIST? 01315000
  1282. BH CFEND YES -- END OF CONFLICT TEST 01316000
  1283. LR XR3,XR2 INITIALIZE INNER LOOP REG 01317000
  1284. SPACE 01318000
  1285. * THE INNER LOOP, USING REGISTER XR3, COMPARE ALL OPTION BYTES WITH 01319000
  1286. * THE OPTION BYTE POINTED TO BY THE OUTER LOOP REGISTER, XR2. 01320000
  1287. CF2 EQU * 01321000
  1288. LA XR3,1(,XR3) POINT TO NEXT OPTION BYTE 01322000
  1289. CH XR3,NOPS END OF OPTION LIST? 01323000
  1290. BH CF1 YES -- RETURN TO OUTER LOOP 01324000
  1291. SR R0,R0 01325000
  1292. IC R0,OPBYTES-1(XR2) GET OUTER LOOP OPTION 01326000
  1293. SR R1,R1 01327000
  1294. IC R1,OPBYTES-1(XR3) GET INNER LOOP OPTION BYTE 01328000
  1295. CR R0,R1 EQUAL OPTION BYTES? 01329000
  1296. BE ERDOP DUPLICATE OPTION 01330000
  1297. SPACE 01331000
  1298. * OTHERWISE, WE ARRANGE THE TWO OPTION BYTES IN HALFWORD FORM, SO 01332000
  1299. * THAT THE ONE ON THE LEFT IS LOWER. 01333000
  1300. BL *+8 SKIP IF FIRST LOWER 01334000
  1301. SLL R1,8 SHIFT SECOND BYTE LEFT 01335000
  1302. BH *+8 SKIP IF FIRST HIGHER 01336000
  1303. SLL R0,8 SHIFT FIRST BYTE LEFT 01337000
  1304. AR R0,R1 FORM HALFWORD 01338000
  1305. LA R1,CONFTAB POINT TO CONFLICT TABLE 01339000
  1306. CH R0,0(,R1) CONFLICTING BYTES? 01340000
  1307. BE ERCONF YES -- GO TYPE ERROR MESSAGE 01341000
  1308. BXLE R1,R14,*-8 LOOP THROUGH TABLE 01342000
  1309. B CF2 GO BACK TO INNER LOOP 01343000
  1310. SPACE 2 01344000
  1311. * COME HERE WHEN OUTER LOOP IS COMPLETED. 01345000
  1312. CFEND EQU * 01346000
  1313. EJECT 01347000
  1314. * IF PACK OR UNPACK OPTION WAS SPECIFIED, THEN WE DO NOT ALLOW @VA11777 01348000
  1315. * ANY MULTIPLE INPUT FILE, IN THE SENSE OF APPENDING (ALTHOUGH, OF 01349000
  1316. * COURSE, THE MULTIPLE OUTPUT FILE MODE MAY BE IN EFFECT). SO @VA05078 01350000
  1317. * WE CHECK FOR THIS. 01351000
  1318. TM OPF2,OP2PACK+OP2UNPA ANY OF THESE IN EFFECT?@VA11777 01352000
  1319. BZ SPRS GO IF NOT 01353000
  1320. CLI INFLAGS+1,X'FF' MULTIPLE INPUT FILE SPEC? 01354000
  1321. BNE ERGUP ERROR IF SO 01355000
  1322. TM INFLAGS,FS ANY *'S IN INPUT FILE SPEC? 01356000
  1323. BZ SPRS WE'RE THROUGH IF NOT 01357000
  1324. TM OPF2,OP2MULT OTHERWISE, WE'D BETTER BE MULT 01358000
  1325. BO SPRS OK IF YES 01359000
  1326. B ERGUP ERROR IF NOT 01360000
  1327. * OPTION TABLE 01361000
  1328. OPTAB TABLE TYPE,1, *01362000
  1329. NOTYPE,3, *01363000
  1330. NEWDATE,4, *01364000
  1331. OLDDATE,4, *01365000
  1332. RECFM,3, *01366000
  1333. EBCDIC,2,UPCASE,2,LOWCASE,2,TRANS,3, *01367000
  1334. LRECL,2, *01368000
  1335. FROM,2,FRLABEL,3, *01369000
  1336. FOR,3,TOLABEL,3, *01370000
  1337. TRUNC,3, *01371000
  1338. NOTRUNC,4, *01372000
  1339. FILL,2, *01373000
  1340. PROMPT,2,NOPROMPT,4, *01374000
  1341. PACK,2,UNPACK,3, *01376000
  1342. SPECS,2,NOSPECS,4, *01377000
  1343. REPLACE,3, *01378000
  1344. OVLY,2, *01379000
  1345. APPEND,2, *01380000
  1346. NEWFILE,4, *01381000
  1347. SINGLE,2 01383000
  1348. OPTEND EQU * TABLE END 01384000
  1349. EJECT 01385000
  1350. * CONFLICT TABLE 01386000
  1351. CONFTAB CONFLICT (TYPE,NOTYPE), *01387000
  1352. (NEWDATE,OLDDATE), *01388000
  1353. (APPEND,NEWDATE,OLDDATE,RECFM,LRECL,NEWFILE,OVLY, *01389000
  1354. REPLACE), *01390000
  1355. (TRUNC,NOTRUNC), *01391000
  1356. (SPECS,NOSPECS), P1109*01392000
  1357. (PROMPT,NOPROMPT), *01393000
  1358. (PACK,TRUNC,LRECL,RECFM,SPECS,OVLY,APPEND, @VA11777*01398000
  1359. EBCDIC,TRANS,UPCASE,LOWCASE), @VA11777*01399000
  1360. (UNPACK,TRUNC,LRECL,RECFM,SPECS,OVLY,APPEND, @VA11777*01400000
  1361. PACK,EBCDIC,TRANS,UPCASE,LOWCASE), @VA11777*01401000
  1362. (REPLACE,OVLY,NEWFILE), *01402000
  1363. (FROM,PACK,UNPACK), @VA11777*01403000
  1364. (FRLABEL,FROM,PACK,UNPACK), @VA11777*01404000
  1365. (FOR,PACK,UNPACK), @VA11777*01405000
  1366. (TOLABEL,FOR,PACK,UNPACK), @VA11777*01406000
  1367. (OVLY,NEWFILE) 01407000
  1368. CONFEND EQU * END OF CONFLICT TABLE 01408000
  1369. * READ 'SPECS' LIST FROM TERMINAL, IF THE OPTION WAS SPECIFIED, AND 01409000
  1370. * SET UP CONTROL BLOCKS. 01410000
  1371. SPRS EQU * 01411000
  1372. TM OPF1,OP1SPECS 'SPECS' SPECIFIED? 01412000
  1373. BZ SPRE GO IF NOT 01413000
  1374. LA SPR,SPECSB-SPBLEN POINT TO SPECS CTL BLOCKS 01414000
  1375. LA R1,SPECST POINT TO TEMP STRING STORAGE 01415000
  1376. ST R1,SPECSTE INITIALIZE POINTER 01416000
  1377. TM OPF1,OP1NOPR WAS 'NOPROMPT' SPECIFIED 01417000
  1378. BZ SPRI NO -- GO TYPE MESSAGE 01418000
  1379. SPACE 01419000
  1380. * RETURN HERE FROM SPRI 01420000
  1381. SPR1 EQU * 01421000
  1382. SPACE 01422000
  1383. * SET UP 'WAITRD' PLIST 01423000
  1384. MVI CRPLIST+12,C'T' NO UPCASE OR BLANK FILL 01424000
  1385. LA R1,CRPLIST POINT TO WAITRD PLIST 01425000
  1386. SVC 202 READ A LINE 01426000
  1387. LA XR,STRING-1 POINT TO DATA AREA 01427000
  1388. L R1,CRPLIST+12 LENGTH OF TERMINAL LINE 01428000
  1389. LA R1,0(R1,XR) END OF TERMINAL INPUT LINE 01429000
  1390. ST R1,SPECTMP STORE IN TEMPORARY 01430000
  1391. SPACE 01431000
  1392. * COME HERE TO PROCESS NEXT SPECIFICATION 01432000
  1393. SPRLUP EQU * 01433000
  1394. LA XR,1(,XR) POINT TO NEXT INPUT CHAR 01434000
  1395. C XR,SPECTMP END OF INPUT? 01435000
  1396. BH SPREND FINISHED IF SO 01436000
  1397. CLI 0(XR),C' ' BLANK? 01437000
  1398. BE SPRLUP SKIP IT 01438000
  1399. CLC =C'++',0(XR) CONTINUATION INDICATOR? 01439000
  1400. BE SPR1 GO READ NEW LINE IF YES 01440000
  1401. LA SPR,SPNEXT POINT TO NEXT SPEC CTL BLOCK 01441000
  1402. CLI SPINDISP,X'FF' ARE WE OUT OF CONTROL BLOCKS? 01442000
  1403. BE ERTMS TOO MANY SPECIFICATIONS 01443000
  1404. CLI 0(XR),X'80' FIRST CHAR NON-ALPHAMERIC? 01444000
  1405. BL SPRLS GO HANDLE IT IF SO 01445000
  1406. CLI 0(XR),C'H' FIRST CHAR AN H? 01446000
  1407. BE SPRLH HANDLE HEX STRING IF SO 01447000
  1408. CLI 0(XR),X'88' FIRST CHAR A SMALL H? 01448000
  1409. BE SPRLH HANDLE HEX STRING IF SO 01449000
  1410. SPACE 01450000
  1411. * OTHERWISE, THE FIRST FIELD IS IN THE FORM NN-MM, AND WE MUST CONVERT 01451000
  1412. * THESE TWO NUMBERS INTO INTERNAL FORM. 01452000
  1413. LR XR2,XR SAVE POINTER 01453000
  1414. SPACE 01454000
  1415. * WE FIND THE HYPHEN SEPARATING THE TWO FIELDS. 01455000
  1416. SPACE 01456000
  1417. SPRLN EQU * 01457000
  1418. LA XR,1(,XR) GET NEXT CHAR 01458000
  1419. C XR,SPECTMP END OF INPUT TERM LINE 01459000
  1420. BH ERILS ILLEGAL SPECIFICATION 01460000
  1421. CLI 0(XR),C'-' HYPHEN? 01461000
  1422. BNE SPRLN LOOP IF NOT 01462000
  1423. SPACE 01463000
  1424. * AT THIS POINT, XR POINTS TO THE HYPHEN. WE CHANGE IT 01464000
  1425. * TEMPORARILY TO A BLANK, SO THAT THE NUMBER CONVERTER WON'T BE 01465000
  1426. * CONFUSED BY IT. 01466000
  1427. MVI 0(XR),C' ' CHANGE - TO BLANK 01467000
  1428. BAL RR,GETNUMS GET NUMBER 01468000
  1429. MVI 0(XR),C'-' RESTORE HYPHEN 01469000
  1430. BCTR R1,0 STORE (FIRST COL)-1 01470000
  1431. ST R1,SPINDISP STORE FIRST FIELD IN CTL BLOCK 01471000
  1432. SPACE 01472000
  1433. * WE NOW CONVERT THE SECOND NUMBER IN THE FIELD. 01473000
  1434. SPRLN2 EQU * 01474000
  1435. LA XR,1(,XR) POINT TO NEXT CHAR 01475000
  1436. C XR,SPECTMP END OF INPUT LINE? 01476000
  1437. BH ERILS ERROR IF SO 01477000
  1438. CLI 0(XR),C' ' BLANK? 01478000
  1439. BE SPRLN2 THEN SKIP IT 01479000
  1440. LR XR2,XR SAVE POINTER TO BEG OF FIELD 01480000
  1441. SPACE 01481000
  1442. * WE FIND THE END OF THE SECOND NUMBER, AND THEN WE CONVERT IT TO 01482000
  1443. * INTERNAL FORM. 01483000
  1444. SPRLN3 EQU * 01484000
  1445. LA XR,1(,XR) POINT TO NEXT CHAR 01485000
  1446. C XR,SPECTMP END OF LINE? 01486000
  1447. BH ERILS ERROR IF SO 01487000
  1448. CLI 0(XR),C' ' BLANK? 01488000
  1449. BNE SPRLN3 NO -- LOOP BACK 01489000
  1450. BAL RR,GETNUMS CONVERT NUMBER TO INTERNAL FORM 01490000
  1451. C R1,SPINDISP LOWER THAN FIRST SPEC? 01491000
  1452. BL ERILS ERROR IF SO 01492000
  1453. ST R1,SPLAST SAVE VALUE IN CTL BLOCK 01493000
  1454. B SPRT GO GET NEXT NUMBER 01494000
  1455. SPACE 2 01495000
  1456. * COME HERE FOR A STRING SPECIFICATION. 01496000
  1457. SPRLS EQU * 01497000
  1458. MVC SPECC,0(XR) SAVE DELIMITER 01498000
  1459. LR XR2,XR COPY POINTER 01499000
  1460. SPACE 01500000
  1461. * FIND END OF STRING 01501000
  1462. SPRLS2 EQU * 01502000
  1463. LA XR,1(,XR) GET NEXT CHAR 01503000
  1464. C XR,SPECTMP END OF INPUT LINE? 01504000
  1465. BH ERILS ERROR IF SO 01505000
  1466. CLC SPECC,0(XR) HAVE WE FOUND DELIMITER? 01506000
  1467. BNE SPRLS2 LOOP IF NOT 01507000
  1468. SPACE 01508000
  1469. LR R1,XR POINT TO END OF STRING 01509000
  1470. SR R1,XR2 01510000
  1471. BCTR R1,0 R1 CONTAINS LENGTH 01511000
  1472. LTR R1,R1 ANY STRING? 01512000
  1473. BNP ERILS ZERO LENGTH ILLEGAL 01513000
  1474. SPACE 01514000
  1475. L R15,SPECSTE POINT TO CURRENT END OF STRING *01515000
  1476. STORAGE 01516000
  1477. ST R15,SPINDISP SAVE ADDRESS IN CONTROL BLOCK 01517000
  1478. OI SPINDISP,X'80' SET 'STRING' FLAG 01518000
  1479. ST R1,SPLAST SAVE LENGTH IN CONTROL BLOCK 01519000
  1480. LA R14,1(R1,R15) POINT TO END OF STRING STORAGE 01520000
  1481. C R14,SPECSTM WILL WE EXCEED STRING STORAGE? 01521000
  1482. BNL ERSPECSX GO IF YES 01522000
  1483. ST R14,SPECSTE SAVE NEW POINTER 01523000
  1484. BCTR R1,0 DECREMENT LENGTH FOR EX 01524000
  1485. B *+10 SKIP OVER MVC 01525000
  1486. MVC 0(0,R15),1(XR2) LENGTH FILLED IN BY EX 01526000
  1487. EX R1,*-6 MOVE STRING INTO STORAGE AREA 01527000
  1488. B SPRT GO GET NEXT NUMBER 01528000
  1489. SPACE 2 01529000
  1490. * COME HERE WHEN 'FROM' TARGET IS HEX FIELD 01530000
  1491. SPRLH EQU * 01531000
  1492. LR XR2,XR SAVE POINTER TO 'H' 01532000
  1493. CLI 1(XR),C' ' NEXT CHAR A BLANK? 01533000
  1494. BE ERILS ILLEGAL IF SO 01534000
  1495. C XR,SPECTMP END OF BUFFER? 01535000
  1496. BE ERILS ERROR IF SO 01536000
  1497. L XR3,SPECSTE POINT TO CURRENT END OF STRING *01537000
  1498. STORAGE 01538000
  1499. ST XR3,SPINDISP STORE AS DISPLACEMENT IN CTL BLK 01539000
  1500. OI SPINDISP,X'80' SET 'STRING' FLAG 01540000
  1501. BCTR XR2,0 XR2 -> 2 BYTES BEFORE FIRST DIG 01541000
  1502. SPACE 01542000
  1503. * COME HERE TO GET NEXT HEX DIGIT PAIR 01543000
  1504. SPRLH1 EQU * 01544000
  1505. LA XR2,2(,XR2) POINT TO NEXT HEX DIGIT PAIR 01545000
  1506. C XR2,SPECSTM END OF BUFFER? 01546000
  1507. BE ERILS ERROR IF SO 01547000
  1508. BAL RR,GETHEX GET HEX VALUE 01548000
  1509. B ERILS ERROR RETURN FROM GETHEX 01549000
  1510. C XR3,SPECSTM ARE WE EXCEEDING STRING STORAGE? 01550000
  1511. BNL ERSPECSX STOP HERE IF WE ARE 01551000
  1512. STC R1,0(XR3) STORE CHAR IN STRING BUFFER 01552000
  1513. LA XR3,1(,XR3) POINT TO NEXT STRING STORAGE CHR 01553000
  1514. CLI 2(XR2),C' ' END OF HEX STRING? 01554000
  1515. BNE SPRLH1 LOOP BACK IF NOT 01555000
  1516. SPACE 01556000
  1517. * COME HERE AT END OF HEX STRING 01557000
  1518. LR R1,XR3 COPY CURRENT STRING STORAGE PTR 01558000
  1519. S R1,SPECSTE LENGTH OF STRING 01559000
  1520. ST R1,SPLAST STORE AS LENGTH IN CTL BLK 01560000
  1521. ST XR3,SPECSTE STORE NEW END OF STOR BUFFER 01561000
  1522. LA XR,2(,XR2) RESET XR2 TO END OF HEX FIELD 01562000
  1523. SPACE 2 01563000
  1524. * WE NOW FIND AND CONVERT THE NUMBER REPRESENTING THE DISPLACEMENT 01564000
  1525. * INTO THE OUTPUT BUFFER. 01565000
  1526. SPRT EQU * 01566000
  1527. LA XR,1(,XR) GET NEXT CHAR 01567000
  1528. C XR,SPECTMP END OF INPUT LINE? 01568000
  1529. BH ERILS YES -- ERROR 01569000
  1530. CLI 0(XR),C' ' BLANK? 01570000
  1531. BE SPRT YES -- SKIP IT 01571000
  1532. LR XR2,XR SAVE POINTER TO FIRST CHAR 01572000
  1533. SPACE 01573000
  1534. * FIND END OF NUMBER AND CONVERT IT TO INTERNAL FORM. 01574000
  1535. SPRT1 EQU * 01575000
  1536. LA XR,1(,XR) GET NEXT CHAR 01576000
  1537. C XR,SPECTMP END OF INPUT LINE? 01577000
  1538. BH SPRT2 END OF LOOP IF YES 01578000
  1539. CLI 0(XR),C' ' BLANK? 01579000
  1540. BNE SPRT1 LOOP IF NOT 01580000
  1541. SPACE 01581000
  1542. SPRT2 EQU * 01582000
  1543. MVI 0(XR),C' ' CHANGE END OF FIELD TO BLANK 01583000
  1544. BAL RR,GETNUMS GET NUMERIC FIELD 01584000
  1545. BCTR R1,0 DECREMENT COLUMN NUMBER 01585000
  1546. ST R1,SPOUDISP SAVE AS OUTPUT DISPLACEMENT 01586000
  1547. SPACE 01587000
  1548. * WE SAVE THE LARGEST OUTPUT BUFFER DISPLACEMENT IN SPECMAX. 01588000
  1549. C R1,SPECMAX LARGER THAN LARGEST SO FAR? 01589000
  1550. BL *+8 SKIP IF NOT 01590000
  1551. ST R1,SPECMAX STORE IT IF YES 01591000
  1552. B SPRLUP GO FOR NEXT SPEC 01592000
  1553. SPACE 3 01593000
  1554. * COME HERE WHEN OUT OF SPECIFICATIONS 01594000
  1555. SPREND EQU * 01595000
  1556. MVI SPNEXT,X'FF' SIGNAL END OF SPECS 01596000
  1557. CLI SPECSB,X'FF' ANY SPECS SPECIFIED? 01597000
  1558. BE ERNS NO -- THIS IS AN ERROR 01598000
  1559. SPACE 01599000
  1560. SPRE EQU * 01600000
  1561. EJECT 01601000
  1562. * SET UP TRANSLATE TABLE, IN CASE IT'S GOING TO BE NEEDED. 01602000
  1563. SR XR,XR 01603000
  1564. LA R14,1 01604000
  1565. LA R15,255 01605000
  1566. SPACE 01606000
  1567. * INITIALIZE EACH BYTE TO ITSELF. 01607000
  1568. STC XR,TRTAB(XR) STORE BYTE IN TABLE 01608000
  1569. BXLE XR,R14,*-4 LOOP THROUGH TABLE 01609000
  1570. SPACE 01610000
  1571. * SET SPECIAL 026 TO 029 CONVERSIONS, IF 'EBCDIC' OPTION SPECIFIED. 01611000
  1572. TM OPF3,OP3EBCD 'EBCDIC' OPTION SPECIFIED? 01612000
  1573. BNO SETTR1 SKIP CODE IF NOT 01613000
  1574. MVI TRTAB+C'<',C')' < TO ) 01614000
  1575. MVI TRTAB+C'&&',C'+' & TO + 01615000
  1576. MVI TRTAB+C'%',C'(' % TO ( 01616000
  1577. MVI TRTAB+C'#',C'=' # TO = 01617000
  1578. MVI TRTAB+C'@',C'''' @ TO ' 01618000
  1579. MVI TRTAB+C'''',C':' ' TO : 01619000
  1580. SPACE 2 01620000
  1581. * SET 'LOWCASE' CONVERSIONS, IF SPECIFIED 01621000
  1582. SETTR1 EQU * 01622000
  1583. TM OPF3,OP3LOCA 'LOWCASE' SPECIFIED? 01623000
  1584. BZ SETTR2 SKIP IF NOT 01624000
  1585. XC TRTAB+C'A'(9),BLANKS TRANSLATE A-I 01625000
  1586. XC TRTAB+C'J'(9),BLANKS TRANSLATE J-R 01626000
  1587. XC TRTAB+C'S'(8),BLANKS TRANSLATE S-Z 01627000
  1588. SPACE 01628000
  1589. * SET 'UPCASE' CONVERSIONS, IF SPECIFIED 01629000
  1590. SETTR2 EQU * 01630000
  1591. TM OPF3,OP3UPCA 'UPCASE' OPTION SPECIFIED? 01631000
  1592. BZ SETTR3 SKIP IF NOT 01632000
  1593. XC TRTAB+X'81'(9),BLANKS TRANSLATE SMALL A-I 01633000
  1594. XC TRTAB+X'91'(9),BLANKS TRANSLATE SMALL J-R 01634000
  1595. XC TRTAB+X'A2'(8),BLANKS TRANSLATE SMALL S-Z 01635000
  1596. SPACE 01636000
  1597. SETTR3 EQU * 01637000
  1598. EJECT 01638000
  1599. * READ TRANSLATE TABLE FROM TERMINAL, IF DESIRED 01639000
  1600. RTR EQU * 01640000
  1601. TM OPF3,OP3TRAN 'TRANSLAT' OPTION SPECIFIED? 01641000
  1602. BZ RTREX SKIP IF NOT 01642000
  1603. SR XR3,XR3 INDICATE WHETHER *01643000
  1604. A NULL LIST IS ENTERED 01644000
  1605. TM OPF1,OP1NOPR 'NOPROMPT' OPTION SPECIFIED? 01645000
  1606. BZ RTRI GO TYPE PROMPT IF NOT 01646000
  1607. SPACE 01647000
  1608. RTR1 EQU * 01648000
  1609. MVI CRPLIST+12,C'T' NO UPCASE OR BLANK FILL 01649000
  1610. LA R1,CRPLIST POINT TO 'WAITRD' PLIST 01650000
  1611. SVC 202 READ A LINE FROM THE TERMINAL 01651000
  1612. LA XR2,STRING-1 POINT TO JUST BEFORE LINE 01652000
  1613. L XR,CRPLIST+12 GET LENGTH OF LINE 01653000
  1614. LA XR,0(XR,XR2) XR -> LAST CHARACTER IN LINE 01654000
  1615. SPACE 01655000
  1616. * COME HERE TO GET NEXT TRANSLATE PAIR 01656000
  1617. RTRL EQU * 01657000
  1618. LA XR2,1(,XR2) POINT TO NEXT CHAR IN BUFFER 01658000
  1619. CLI 0(XR2),C' ' BLANK? 01659000
  1620. BE *-8 SKIP IT IF SO 01660000
  1621. CR XR2,XR END OF BUFFER? 01661000
  1622. BH RTRE WE'RE FINISHED IF SO 01662000
  1623. BE ERTRS ERROR IF LAST CHAR OF BUFFER 01663000
  1624. CLC =C'++',0(XR2) CONTINUATION SPECIFIED? 01664000
  1625. BE RTR1 GO DO ANOTHER READ, IF SO 01665000
  1626. SR R1,R1 01666000
  1627. IC R1,0(XR2) GET CHARACTER 01667000
  1628. CLI 1(XR2),C' ' IS NEXT CHAR A BLANK? 01668000
  1629. BE *+12 THEN USE THE CHARACTER IF SO 01669000
  1630. BAL RR,GETHEX OTHERWISE, CONVERT TO HEX 01670000
  1631. B ERTRS ERROR RETURN FROM GETHEX 01671000
  1632. LA XR3,TRTAB(R1) POINT TO SPOT IN TRANSLATE TAB 01672000
  1633. LA XR2,1(,XR2) SKIP OVER THIS FIELD 01673000
  1634. LA XR2,1(,XR2) FIND FIRST NON-BLANK 01674000
  1635. CLI 0(XR2),C' ' BLANK? 01675000
  1636. BE *-8 THEN SKIP IT 01676000
  1637. CR XR2,XR END OF BUFFER? 01677000
  1638. BH ERTRS ERROR IF SO 01678000
  1639. BL *+8 SKIP IF NOT AT END 01679000
  1640. MVI 1(XR2),C' ' FORCE NEXT CHAR BLANK 01680000
  1641. IC R1,0(XR2) GET FIRST CHAR IN FIELD 01681000
  1642. CLI 1(XR2),C' ' NEXT CHAR A BLANK? 01682000
  1643. BE *+12 THEN USE CHARACTER IF SO 01683000
  1644. BAL RR,GETHEX GET HEX FIELD IF NOT 01684000
  1645. B ERTRS ERROR RETURN FROM GETHEX 01685000
  1646. STC R1,0(XR3) STORE CHARACTER IN TRANSLATE TAB 01686000
  1647. LA XR2,1(,XR2) INCREMENT STRING POINTER 01687000
  1648. B RTRL LOOP BACK FOR NEXT 01688000
  1649. SPACE 01689000
  1650. * COME HERE WHEN FINISHED 01690000
  1651. RTRE EQU * 01691000
  1652. LTR XR3,XR3 WERE THERE ANY TRANSLATIONS? 01692000
  1653. BZ ERNT ERROR IF NOT 01693000
  1654. SPACE 01694000
  1655. RTREX EQU * 01695000
  1656. * PHASE IN -- INITIALIZATION PHASE 01696000
  1657. IN PHBEG 01697000
  1658. CODE FPT POINT TO FIRST INPUT FILE 01698000
  1659. CODE CKIC CHECK FOR ILLEGAL CHAR IN FILEID 01699000
  1660. CODE FFFST FIND FIRST FST FOR FILE 01700000
  1661. CODE SKFST SKIP IF FST EXISTS 01701000
  1662. CODE ERNIF ERROR -- NO INPUT FILE NAME 01702000
  1663. CODE MRWP MAKE RDBUF/WRBUF PLIST 01703000
  1664. CODE FPT2 EXTRA FIRST FILE PROCESSING 01704000
  1665. CODE TACT TEST IF FILE ALREADY ACTIVE (ER) 01705000
  1666. MING EQU * 01710000
  1667. TM OPF2,OP2OVLY+OP2MULT+OP2APPE MULT OUT,APPE,OVLY @VA06259 01711000
  1668. BNZ MINGPO YES. ALREADY HAVE LRECL & RECFM @VA06259 01712000
  1669. CLI RECFM,0 RECFM SPECIFIED? @VA05624 01713000
  1670. BE MINGIN2 NO, LOOP NECESSARY @VA05624 01714000
  1671. CLC LRECL,=F'0' LRECL SPECIFIED? @VA05624 01715000
  1672. BE MINGIN2 NO, LOOP NECESSARY @VA05624 01716000
  1673. MINGPO CODE GOPO ENTER PHASE PO @VA05624 01717000
  1674. B MRE GO BUILD RESTART PHASE @VA05624 01718000
  1675. MINGIN2 CODE GOIN2 ENTER PHASE IN2 @VA05624 01719000
  1676. IN PHEND 01720000
  1677. EJECT 01721000
  1678. *IN2 PHASE IN2 -- INITIALIZATION FOR SINGLE OUTPUT MODE 01722000
  1679. IN2 PHBEG @VA05624 01723000
  1680. CLI RECFM,0 RECFM SPECIFIED? @VA05624 01724000
  1681. BNE MIN2LR YES, DON'T MODIFY BUT SET LRECL @VA05624 01725000
  1682. MVI RECFM,C' ' SIGNAL PH PO TO USE ANYWAY @VA05624 01726000
  1683. CODE CFMA FIND 'BEST' RECFM @VA05624 01727000
  1684. CLC LRECL,=F'0' LRECL SPECIFIED? @VA05624 01728000
  1685. BNE MIN2S YES, DON'T MODIFY @VA05624 01729000
  1686. MIN2LR MVC LRECL,=F'-1' SIGNAL PH PO TO USE ANYWAY @VA05624 01730000
  1687. CODE CRLA FIND LARGEST LRECL @VA05624 01731000
  1688. MIN2S CODE NVPT NEXT 'VERTICAL' FILE @VA05624 01732000
  1689. CODE FNFST GET NEXT FST @VA05624 01733000
  1690. CODE SKNFST SKIP IF NOT FOUND @VA05624 01734000
  1691. CODE GOIN2 SET LRECL AND/OR RECFM @VA05624 01735000
  1692. CODE NHPT NEXT 'HORIZONTAL' FILE @VA05624 01736000
  1693. CODE SKFND SKIP IF MORE INPUT @VA05624 01737000
  1694. CODE GOIN3 ALL DONE, GO RESTART INPUT @VA05624 01738000
  1695. CODE SUBE MUST REPLACE = @VA05624 01739000
  1696. CODE FFFST FIRST 'HORIZONTAL' FILE @VA05624 01740000
  1697. CODE CKIC CHECK FOR ILLEGAL CHARACTERS @VA05624 01741000
  1698. CODE GOIN2 SET LRECL AND/OR RECFM @VA05624 01742000
  1699. IN2 PHEND @VA05624 01743000
  1700. SPACE 2 01744000
  1701. IN3 PHBEG @VA05624 01745000
  1702. CODE FPT FIRST INPUT FILE @VA05624 01746000
  1703. CODE FFFST FIRST 'HORIZONTAL' FILE @VA05624 01747000
  1704. CODE MRWP SET READ PARAMETERS @VA05624 01748000
  1705. CODE FPT2 ADDITIONAL FIRST FILE STUFF @VA05624 01749000
  1706. CODE GOPO GO SETUP OUTPUT @VA05624 01750000
  1707. B MPO GO DO OUTPUT @VA05624 01751000
  1708. IN3 PHEND @VA05624 01752000
  1709. EJECT 01753000
  1710. * PHASE RE - RESTART PHASE (MULTIPLE MODE ONLY) 01754000
  1711. RE PHBEG 01755000
  1712. CODE FPT POINT TO FIRST INPUT FILE 01756000
  1713. CODE FNFST FIND NEXT FST FOR FILE 01757000
  1714. CODE SKFST SKIP IF FST EXISTS 01758000
  1715. CODE EXIT EXIT IF IT DOES NOT 01759000
  1716. CODE MRWP MAKE RDBUF/WRBUF PLIST 01760000
  1717. CODE FPT2 EXTRA FIRST FILE PROCESSING 01761000
  1718. CODE TACT TEST IF FILE ALREADY ACTIVE 01762000
  1719. CODE GOPO ENTER PHASE PO 01765000
  1720. RE PHEND 01766000
  1721. EJECT 01767000
  1722. * PHASE PO -- PHASE TO PROCESS OUTPUT FILE NAME 01768000
  1723. PO PHBEG 01769000
  1724. CODE OPT POINT TO OUTPUT FILE 01770000
  1725. CODE SUBE SUBSTITUTE FOR EQUAL SIGNS 01771000
  1726. CODE CKIC CHECK FOR ILLEGAL CHAR IN FILEID 01772000
  1727. CODE FWFST FIND FST FOR FILE (IF ANY) 01773000
  1728. CODE SOMODE SET CORRECT OUTPUT FILE MODE 01774000
  1729. CODE MRWP MAKE RDBUF/WRBUF PLIST 01775000
  1730. CODE TRW TEST IF OUTPUT DISK IS RW 01776000
  1731. CLI RECFM,0 RECFM OPTION SPECIFIED? 01777000
  1732. CODE CFMS,NE USE SPECIFIED RECFM IF SO 01778000
  1733. CLC LRECL,=F'0' LRECL OPTION SPECIFIED? 01779000
  1734. CODE CRLS,NE USE SPECIFIED LRECL 01780000
  1735. TM OPF2,OP2NEWF NEW OUTPUT FILE? 01781000
  1736. BO MPON GO HANDLE IT 01782000
  1737. TM OPF2,OP2APPE APPEND OPTION? 01783000
  1738. BO MPOA GO HANDLE IT 01784000
  1739. TM OPF2,OP2OVLY OVLY OPTION? 01785000
  1740. BO MPOV GO HANDLE IT 01786000
  1741. B MPOR OTHERWISE, IT'S REPLACE 01787000
  1742. SPACE 5 01788000
  1743. * NEW FILE OPTION OF PHASE PO 01789000
  1744. MPON EQU * 01790000
  1745. CODE SKNFST SKIP IF NO FST 01791000
  1746. CODE ERNX ERROR -- NEW FILE ALREADY EXISTS 01792000
  1747. SPACE 3 01793000
  1748. * REPLACE OPTION OF PHASE PO 01794000
  1749. MPOR EQU * 01795000
  1750. CODE WTEMP USE CMSUT FILEID IN OUTPUT *01796000
  1751. PLIST 01797000
  1752. CLI RECFM,0 RECFM SPECIFIED? 01798000
  1753. CODE CFMI,E COPY INPUT FILE RECFM IF NOT 01799000
  1754. CLC LRECL,=F'0' LRECL SPECIFIED? 01800000
  1755. CODE CRLI,E COPY INPUT FILE LRECL IF NOT 01801000
  1756. B MPOPE GO FINISH PHASE PO 01802000
  1757. SPACE 5 01803000
  1758. * OVERLAY OPTION OF PHASE PO 01804000
  1759. MPOV EQU * 01805000
  1760. CODE SKFST SKIP IF FST EXISTS 01806000
  1761. CODE ERNVF ERROR - OVERLAY FILE NOT EXIST 01807000
  1762. CODE TACT TEST IF FILE ALREADY ACTIVE (ER) 01808000
  1763. CODE WTEMP USE CMSUT FILEID IN OUTPUT *01809000
  1764. PLIST 01810000
  1765. CODE FFFST @VA06129 01811000
  1766. CODE VPT POINT TO OVERLAY FILE 01812000
  1767. CODE MRWP MAKE RDBUF/WRBUF PLIST 01813000
  1768. B MPOPE GO FINISH PHASE PO 01814000
  1769. SPACE 5 01815000
  1770. * APPEND OPTION OF PHASE PO 01816000
  1771. MPOA EQU * 01817000
  1772. CODE TACT ERROR IF FILE ALREADY ACTIVE 01818000
  1773. CODE SKNFST SKIP IF FST DOESN'T EXIST 01819000
  1774. CODE APITEM SET ITEM NUMBER FOR APPEND 01820000
  1775. CODE SKFST SKIP IF FST EXISTS 01821000
  1776. CODE CFMI COPY INPUT FILE RECFM 01822000
  1777. CODE SKFST SKIP IF FST EXISTS 01823000
  1778. CODE CRLI COPY INPUT FILE LRECL 01824000
  1779. B MPOPE GO FINISH PHASE PO 01825000
  1780. SPACE 5 01826000
  1781. * FINISH UP PHASE PO 01827000
  1782. MPOPE EQU * 01828000
  1783. TM OPF1,OP1TYPE TYPE OPTION SPECIFIED? 01829000
  1784. CODE IOTYPE,O TYPE NAMES OF FILES IF SO 01830000
  1785. CODE SFIT SAVE ITEM # OF FIRST RECORD 01831000
  1786. CODE GOPC ENTER PRE-COPY PHASE 01832000
  1787. PO PHEND 01833000
  1788. EJECT 01834000
  1789. * PHASE PC -- PRE-COPY PHASE. 01835000
  1790. * THIS PHASE WILL BE ENTERED AFTER EACH NEW INPUT FILE IS IDENTIFIED. 01836000
  1791. PC PHBEG 01837000
  1792. TM OPF2,OP2PACK 'PACK' OPTION SPECIFIED? 01838000
  1793. CODE PCPACK,O PERFORM BUFFER COMPUTATIONS IFSO 01839000
  1794. TM OPF2,OP2UNPA 'UNPACK' OPTION SPECIFIED? 01840000
  1795. CODE PCUNPA,O READ FILE HEADER BUFFER IF SO 01841000
  1796. CODE PCSET SET UP I/O BUFFERS 01842000
  1797. TM OPF2,OP2PACK 'PACK' OPTION SPECIFIED? 01843000
  1798. CODE PCPAB,O SET UP PACK BUFFERS IF SO 01844000
  1799. TM OPF2,OP2UNPA 'UNPACK' OPTION SPECIFIED? 01845000
  1800. CODE PCUPB,O SET UN UNPACK BUFFERS IF SO 01846000
  1801. CLC FROMN,=F'0' ANY 'FROM' NUMBER SPECIFIED? 01847000
  1802. CODE SKIPN,NE SKIP TO FROM NUMBER 01848000
  1803. TM OPF1,OP1FRL ANY FRLABEL SPECIFIED? 01849000
  1804. CODE SKIPL,O SKIP TO FRLABEL IF SO 01850000
  1805. CLC FORN,=F'0' ANY 'FOR' NUMBER SPECIFIED? 01851000
  1806. CODE SETFOR,NE SET UP FOR 'FOR' NUMBER IF SO 01852000
  1807. CODE GOCO ENTER PHASE CO -- COPY PHASE 01853000
  1808. PC PHEND 01854000
  1809. EJECT 01855000
  1810. * PHASE CO -- COPY PHASE 01856000
  1811. CO PHBEG 01857000
  1812. CODE IBUFF INITIALIZE OUTPUT BUFFER IF NECC 01858000
  1813. TM OPF2,OP2OVLY OVERLAY FILE? 01859000
  1814. CODE RDOVLY,O READ OVERLAY FILE INTO OUTPUT *01860000
  1815. BUFFER, IF SO (EOF -> PHCL) 01861000
  1816. CLC FORN,=F'0' ANY 'FOR' NUMBER SPECIFIED? 01862000
  1817. CODE CKFORN,NE CHECK TO SEE IF IT'S BEEN *01863000
  1818. REACHED (FOUND -> PHEO) 01864000
  1819. TM OPF2,OP2UNPA 'UNPACK' OPTION SPECIFIED? 01865000
  1820. CODE RDIN,Z IF NOT, READ CURRENT INPUT *01866000
  1821. FILE (EOF -> PHEO) 01867000
  1822. TM OPF1,OP1SPECS INPUT BUFFER = OUTPUT BUFFER? 01868000
  1823. CODE SVE,NO SET VBUFEND IF SO 01869000
  1824. TM OPF1,OP1TOL 'TOLABEL' SPECIFIED? 01870000
  1825. CODE CKTOL,O CHECK 'TOLABEL' IF SO (FOUND *01871000
  1826. -> PHEO) 01872000
  1827. TM OPF1,OP1SPECS 'SPECS' OPTION SPECIFIED? 01873000
  1828. CODE COPSP,O COPY INPUT BUFFER TO OUTPUT *01874000
  1829. BUFFER ACCORDING TO SPECS 01875000
  1830. TM OPF1,OP1TRUNC 'TRUNC' OPTION SPECIFIED? 01876000
  1831. CODE TRUNC,O TRUNCATE OUTPUT BUFFER IF SO 01877000
  1832. TM OPF3,OP3EBCD+OP3TRAN+OP3UPCA+OP3LOCA ANY TRANSLATION? 01878000
  1833. CODE TRANS,NZ TRANSLATE OUTPUT BUFFER IF SO 01879000
  1834. TM OPF2,OP2PACK 'PACK' OPTION SPECIFIED? 01882000
  1835. CODE PACK,O PACK THE DATA IF SO 01883000
  1836. TM OPF2,OP2UNPA 'UNPACK' OPTION SPECIFIED? 01884000
  1837. CODE UNPACK,O UNPACK THE DATA IF SO 01885000
  1838. TM OPF2,OP2PACK 'PACK' OPTION SPECIFIED? 01886000
  1839. CODE WROUT,Z WRITE WRPLIST IF NOT 01887000
  1840. CODE GOCO LOOP BACK TO PHASE CO 01888000
  1841. CO PHEND 01889000
  1842. EJECT 01890000
  1843. TM OPF2,OP2OVLY 'OVLY' OPTION SPECIFIED? @VA03971 01891000
  1844. BZ MCVE NO; THEN DON'T BOTHER WITH PHCV @VA03971 01892000
  1845. SPACE 1 01893000
  1846. * PHASE CV -- SPECIAL COPY PHASE FOR 'OVLY' OPTION 01894000
  1847. * (COPIES REMAINDER OF OVERLAY FILE, IN CASE A PREMATURE 01895000
  1848. * EOF OCCURRED ON THE LAST (OR ONLY) INPUT FILE.) 01896000
  1849. SPACE 1 01897000
  1850. CV PHBEG @VA03971 01898000
  1851. CODE IBUFF INIT. OUTPUT BUFFER IF NECESSARY @VA03971 01899000
  1852. CODE RDOVLY READ OVERLAY FILE INTO OUTPUT @VA03971*01900000
  1853. BUFFER (EOF -> PHCL) 01901000
  1854. TM OPF1,OP1SPECS INPUT BUFFER = OUTPUT BUFFER? @VA03971 01902000
  1855. BO CVNOSPEC NO; SKIP @VA03971 01903000
  1856. CODE SVE YES; SET VBUFEND @VA03971 01904000
  1857. B CVTRUNC @VA03971 01905000
  1858. CVNOSPEC CODE COPSP NO; COPY INPUT BUFFER TO OUTPUT @VA03971*01906000
  1859. BUFFER ACCORDING TO 'SPECS' OPT. 01907000
  1860. CVTRUNC TM OPF1,OP1TRUNC 'TRUNC' OPTION SPECIFIED? @VA03971 01908000
  1861. CODE TRUNC,O TRUNCATE OUTPUT BUFFER IF SO @VA03971 01909000
  1862. TM OPF3,OP3EBCD+OP3TRAN+OP3UPCA+OP3LOCA ANY TRANSL?@VA03971 01910000
  1863. CODE TRANS,NZ TRANSLATE OUTPUT BUFFER IF SO @VA03971 01911000
  1864. CODE WROUT WRITE WR P-LIST @VA03971 01912000
  1865. CODE GOCV LOOP BACK TO PHASE CV @VA03971 01913000
  1866. CV PHEND @VA03971 01914000
  1867. EJECT 01915000
  1868. * PHASE EO -- ENTERED WHEN EOF REACH ON INPUT FILE (OR 'FOR' 01916000
  1869. * SPECIFICATION IS FILLED). 01917000
  1870. EO PHBEG 01918000
  1871. CODE FINI FINIS INPUT FILE 01919000
  1872. TM OPF2,OP2PACK 'PACK' OPTION SPECIFIED? 01920000
  1873. CODE EOPACK,O FINISH UP WITH OUTPUT FILE, IFSO 01921000
  1874. TM OPF2,OP2MULT MULTIPLE FILE MODE? 01922000
  1875. BO MEOM GO IF YES 01923000
  1876. SPACE 01924000
  1877. * OTHERWISE, SINGLE FILE MODE 01925000
  1878. CODE NVPT POINT TO NEXT 'VERTICAL' INPUT *01926000
  1879. FILE 01927000
  1880. CODE FNFST FIND NEXT FST 01928000
  1881. CODE SKNFST SKIP IF NO FST FOUND 01929000
  1882. CODE GONI IF FOUND, ENTER NEXT INPUT PHASE 01930000
  1883. SPACE 01931000
  1884. * OTHERWISE, GET NEXT 'HORIZONTAL' INPUT FILE 01932000
  1885. MEOM EQU * 01933000
  1886. CODE NHPT GET NEXT 'HORIZONTAL' FILE @VA03971 01934000
  1887. CODE SKFND SKIP IF THERE IS ONE @VA03971 01935000
  1888. TM OPF2,OP2OVLY 'OVLY' OPTION SPECIFIED? @VA03971 01936000
  1889. BZ EONOVLY NO; SKIP @VA03971 01937000
  1890. CODE SETCV SET UP FOR AND ENTER PHASE CV @VA03971 01938000
  1891. B EOSUBE @VA03971 01939000
  1892. EONOVLY CODE GOCL ENTER CLOSING PHASE @VA03971 01940000
  1893. EOSUBE EQU * @VA03971 01941000
  1894. CODE SUBE SUBSTITUTE FOR = SIGNS 01942000
  1895. CODE FFFST FIND FIRST FST FOR FILE, IF ANY 01943000
  1896. TM OPF2,OP2MULT MULTIPLE OUTPUT? @VA05624 01944000
  1897. BO CDCKIC YES, CKIC MUST BE DONE @VA05624 01945000
  1898. CLI RECFM,C' ' RECFM SPECIFIED @VA05624 01946000
  1899. BE CDSKFST NO, CKIC ALREADY DONE @VA05624 01947000
  1900. CLC LRECL,=F'-1' LRECL SPECIFIED? @VA05624 01948000
  1901. BE CDSKFST NO, CKIC ALREADY DONE @VA05624 01949000
  1902. CDCKIC CODE CKIC CHECK FOR ILLEGAL CHAR IN FILEID @VA05624 01950000
  1903. CDSKFST CODE SKFST SKIP IF FST EXISTS @VA05624 01951000
  1904. CODE ERNIF ERROR -- NO INPUT FILE 01952000
  1905. CODE GONI IF FOUND, ENTER NEXT INPUT PHASE 01953000
  1906. EO PHEND 01954000
  1907. EJECT 01955000
  1908. * PHASE NI -- PROCESS NEXT INPUT FILE NAME 01956000
  1909. NI PHBEG 01957000
  1910. CODE MRWP MAKE RDBUF/WRBUF PLIST 01958000
  1911. CODE TACT ERROR IF FILE ALREADY ACTIVE 01959000
  1912. TM OPF1,OP1TYPE TYPE OPTION SPECIFIED? 01960000
  1913. CODE NITYPE,O TYPE NAME OF NEXT INPUT FILE 01961000
  1914. TM OPF2,OP2OVLY OVERLAY FILE SPECIFIED? 01962000
  1915. CODE OVBK,O BACKSPACE OVERLAY FILE IF SO 01963000
  1916. CODE GOPC ENTER PRE-COPY PHASE 01964000
  1917. NI PHEND 01965000
  1918. EJECT 01966000
  1919. * PHASE CL -- CLOSING PHASE 01967000
  1920. * THIS PHASE IS ENTERED WHEN: 01968000
  1921. * 1. EOF ON OVERLAY FILE 01969000
  1922. * 2. NO MORE 'HORIZONTAL' FILE NAMES. 01970000
  1923. CL PHBEG 01971000
  1924. CODE FINO FINIS OUTPUT FILE @VA03972 01972000
  1925. TM OPF2,OP2OVLY WAS 'OVLY' SPECIFIED? @VA03972 01973000
  1926. BZ CLTOL NO; SKIP @VA03972 01974000
  1927. CODE FINV FINIS OVERLAY FILE @VA03972 01975000
  1928. CODE FINI FINIS INPUT FILE @VA03972 01976000
  1929. CLTOL TM OPF1,OP1TOL WAS 'TOLABEL' SPECIFIED? @VA03972 01977000
  1930. CODE CKOR,O CHECK IF ANY RECORDS AT ALL @VA03972*01978000
  1931. WERE COPIED TO THE OUTPUT FILE 01979000
  1932. TM OPF1,OP1OLDD 'OLDDATE' SPECIFIED? 01980000
  1933. CODE SDATE,O GO CHANGE DATE IF SO 01981000
  1934. TM OPF2,OP2REPL+OP2OVLY REPLACE OR OVERLAY? 01982000
  1935. CODE ERASEO,NZ ERASE OLD OUTPUT FILE IF SO 01983000
  1936. TM OPF2,OP2NEWF+OP2REPL+OP2OVLY NEW OR REPLACE OR OVLY? 01984000
  1937. CODE RENAME,NZ RENAME TEMP FILE TO NEW NAME, *01985000
  1938. IF SO 01986000
  1939. TM OPF2,OP2MULT MULTIPLE FILE MODE? @VA05078 01987000
  1940. BO MCLM GO IF YES 01988000
  1941. CODE EXIT EXIT FROM DMSCPY IF SINGLE 01989000
  1942. B MCLE 01990000
  1943. MCLM EQU * 01991000
  1944. CODE GORE ENTER PHASE RE -- RESTART FOR *01992000
  1945. MULTIPLE FILE MODE 01993000
  1946. CL PHEND 01994000
  1947. * START COPYING PROCESS BY ENTERING INITIALIZATION PHASE 01995000
  1948. PHASE IN 01996000
  1949. LTORG 01997000
  1950. DS 0H 01998000
  1951. ORG DMSCPY+X'1000' 01999000
  1952. ORG 02000000
  1953. EJECT 02001000
  1954. SPACE 5 02002000
  1955. * COME HERE TO GO TO THE NEXT PHASE BYTE OPERATION. 02003000
  1956. NEXT EQU * 02004000
  1957. LA CDR,1(,CDR) POINT TO NEXT OPERATION BYTE 02005000
  1958. SPACE 02006000
  1959. * COME HERE WHEN CDR POINTS TO THE NEXT PHASE OPERATION BYTE 02007000
  1960. GO EQU * 02008000
  1961. SR R15,R15 02009000
  1962. IC R15,0(CDR) GET NEXT PHASE BYTE 02010000
  1963. CH R15,=AL2(ROUTMAX) LARGER THAN MAXIMUM? 02011000
  1964. BH ERUNX UNEXPECTED ERROR 02012000
  1965. AR R15,R15 MULTIPLY BY 4 02013000
  1966. AR R15,R15 02014000
  1967. L R15,ROUTAB(R15) LOAD BRANCH ADDRESS 02015000
  1968. BR R15 GO TO IT 02016000
  1969. EJECT 02017000
  1970. * THE FOLLOWING MACRO GENERATES THE ROUTINE BRANCH TABLE. IT GETS 02018000
  1971. * THE NAMES FROM THE 'CODE' MACROS, AND SO MUST BE PLACED AFTER ALL 02019000
  1972. * SUCH MACROS. 02020000
  1973. ROUTINES 02021000
  1974. EJECT 02022000
  1975. * THE FOLLOWING MACRO GENERATES THE ROUTINES WHICH ARE USED TO 02023000
  1976. * CHANGE TO A NEW PHASE. 02024000
  1977. GOGEN 02025000
  1978. EJECT 02026000
  1979. * SET UP POINTERS FOR FIRST INPUT FILE 02027000
  1980. $$FPT EQU * 02028000
  1981. LA XR,FIPLIST2 POINT TO PLIST2 FOR FIRST *02029000
  1982. INPUT FILE 02030000
  1983. USE PLIST2,XR 02031000
  1984. ST XR,PPLIST2 CURRENT PLIST2 02032000
  1985. LA XR2,RDPLIST USE RDPLIST AS CURRENT PLIST3 02033000
  1986. ST XR2,PPLIST3 SAVE POINTER TO IT 02034000
  1987. LA XR2,INFLAGS CURRENT FLAG BYTE 02035000
  1988. ST XR2,PFLG 02036000
  1989. L XR2,PLPTR FIRST PLIST1 IS 'COPY' PLIST 02037000
  1990. ST XR2,PPLIST1 STORE IT 02038000
  1991. SPACE 02039000
  1992. * WE CAN SIMPLY COPY THE INPUT FILE NA/TY/MO FROM PLIST1 TO PLIST2, 02040000
  1993. * SINCE NO = SIGNS ARE POSSIBLE IN THAT NAME. 02041000
  1994. USE PLIST1,XR2 02042000
  1995. MVC PNA2(18),PNA1 COPY FIELDS 02043000
  1996. NEXT GO FOR NEXT OPERATION 02044000
  1997. EJECT 02045000
  1998. * MAKE A COSMETIC CALL TO 'STATE' TO CHECK FOR ILLEGAL CHARS IN THE 02046000
  1999. * THE SPECIFIED FILEID, AND TO CHECK FOR ILLEGAL FILEMODE. 02047000
  2000. $$CKIC EQU * 02048000
  2001. L XR,PPLIST2 POINT TO CURRENT PLIST2 02049000
  2002. USE PLIST2,XR 02050000
  2003. MVC STPLIST+8(18),PNA2 COPY FILEID TO STATE PLIST 02051000
  2004. CLI STPLIST+8+16,C'*' IF AN ASTERICK IS SPECIFIED @VA00958 02052000
  2005. BNE MODEOK THE MODE NUMBER MUST @VA00958 02053000
  2006. MVI STPLIST+8+17,C' ' BE A BLANK @VA00958 02054000
  2007. MODEOK EQU * 02055000
  2008. LA R1,STPLIST POINT TO STATE PLIST 02056000
  2009. SVC 202 CALL 'STATE' 02057000
  2010. DC AL4(CKICER) TO CKICER ON ERROR 02058000
  2011. USE PLIST2,R1 @VA04333 02059000
  2012. L R15,PSTFST GET ADDRESS OF FST @VA04333 02060000
  2013. ST R15,PFSTAC AND SAVE FOR LATER USE @VA04333 02061000
  2014. SPACE 02062000
  2015. CKICN EQU * 02063000
  2016. NEXT 02064000
  2017. SPACE 02065000
  2018. * IF RC = 1 OR 28, THEN THE CONDITION IS 'FILE NOT FOUND', WHICH WE 02066000
  2019. * IGNORE (STATE DOES NOT TYPE A MESSAGE IN THIS CASE.) ON OTHER 02067000
  2020. * RETURN CODES, THEN AN ILLEGAL CHAR, ETC, WAS FOUND, AND STATE HAS 02068000
  2021. * TYPED OUT A DIAGNOSTIC MESSAGE. WE SIMPLY PASS THE RETURN CODE BACK 02069000
  2022. * TO THE USER. 02070000
  2023. * HOWEVER IF THE RETURN CODE FROM STATE IS 36 ( DISK NOT @VA09572 02070250
  2024. * ACCESSED) WE WILL PUT OUT THE APPROPRIATE MESSAGE AND EXIT. @VA09572 02070500
  2025. SPACE 02070750
  2026. CKICER EQU * 02071000
  2027. XC PFSTAC,PFSTAC CLEAR STATE FST ADDRESS @VA04333 02072000
  2028. CH R15,=H'36' WAS DISK NOT ACCESSED? @VA09572 02072350
  2029. BE ERROR36 GIVE MSG @VA09572 02072700
  2030. CH R15,=H'1' RC = 1? 02073000
  2031. BE CKINPUT CHECK FOR INPUT FILE @VA07488 02074100
  2032. CH R15,=H'28' RC = 28? 02075000
  2033. BE CKINPUT CHECK FOR INPUT FILE @VA07488 02076100
  2034. STC R15,RC STORE RETURN CODE 02077000
  2035. B EXIT AND TAKE ERROR EXIT 02078000
  2036. EJECT 02079000
  2037. CKINPUT EQU * @VA07488 02079100
  2038. LA R6,OUTFLAGS GET OUTFLAG ADDRESS @VA07488 02079200
  2039. USE PLIST2,XR2 @VA07488 02079300
  2040. CL R6,PFLG IS FLAG POINTER FOR INPUT @VA07488 02079400
  2041. BE CKICN NO-FILE IS OUTPUT IGNOR CC @VA07488 02079500
  2042. LA XR,INPUT SET UP FOR ERROR MSG @VA07488 02079600
  2043. B ERNF GO TO ERROR RTN. @VA07488 02079700
  2044. * GET FIRST FST FOR SPECIFIED FILE 02080000
  2045. $$FFFST EQU * 02081000
  2046. L XR2,PPLIST2 POINT TO CURRENT PLIST2 02082000
  2047. USE PLIST2,XR2 02083000
  2048. GETFST PLIST2,F,ERR=FFFSTER GET FIRST FST FOR PLIST2 FILE 02084000
  2049. LR XR,R0 SAVE ADT POINTER IN XR 02085000
  2050. USE ADTSECT,XR 02086000
  2051. MVC PHYP(8),ADTCHBA COPY TWO FIELDS FROM ADT FOR *02087000
  2052. LATER USE IN GETTING NEXT FST 02088000
  2053. L R15,ADTCFST GET NEW FST DISPLACEMENT@VA05129 02089000
  2054. ST R1,PFST SAVE FST POINTER 02090000
  2055. ST XR,PADT SAVE ADT POINTER 02091000
  2056. NEXT @VA05659 02092000
  2057. SPACE 02093000
  2058. * COME HERE IF THERE IS NO FST 02094000
  2059. FFFSTER EQU * 02095000
  2060. MVC PHYP(8),=D'0' ZERO OUT FST FIELD 02096000
  2061. XC PFST,PFST 02097000
  2062. NEXT GO FOR NEXT OPERATION 02098000
  2063. EJECT 02099000
  2064. * SKIP IF FST EXISTS 02100000
  2065. $$SKFST EQU * 02101000
  2066. L XR,PPLIST2 POINT TO CURRENT PLIST2 02102000
  2067. USE PLIST2,XR 02103000
  2068. CLC PFST,=F'0' ANY FST FOUND? 02104000
  2069. BE SKFSTN GO IF NOT 02105000
  2070. SKIP 1 SKIP 1 OPERATION IF SO 02106000
  2071. SPACE 2 02107000
  2072. * COME HERE IF AN FST DOES NOT EXIST 02108000
  2073. SKFSTN EQU * 02109000
  2074. NEXT GET NEXT OPERATION (NO SKIP) 02110000
  2075. EJECT 02111000
  2076. * SKIP IF NO FST EXISTS 02112000
  2077. $$SKNFST EQU * 02113000
  2078. L XR,PPLIST2 POINT TO PLIST2 02114000
  2079. USE PLIST2,XR 02115000
  2080. CLC PFST,=F'0' ANY FST FOUND? 02116000
  2081. BNE SKNFSTS GO IF SO 02117000
  2082. SKIP 1 SKIP IF NOT 02118000
  2083. SPACE 2 02119000
  2084. * COME HERE IF AN FST EXISTS 02120000
  2085. SKNFSTS EQU * 02121000
  2086. NEXT NO SKIP IF FST EXISTS 02122000
  2087. EJECT 02123000
  2088. * HANDLE ERRORS ASSOCIATED WITH NO INPUT FILE EXISTING. 02124000
  2089. SPACE 02125000
  2090. * NO INPUT FILE EXISTS 02126000
  2091. $$ERNIF EQU * 02127000
  2092. LA XR,=CL8'INPUT' 02128000
  2093. B ERNF GO TYPE ERROR MESSAGE 02129000
  2094. SPACE 02130000
  2095. * NO OVERLAY FILE NAME 02131000
  2096. $$ERNVF EQU * 02132000
  2097. LA XR,=CL8'OVERLAY' 02133000
  2098. B ERNF 02134000
  2099. EJECT 02135000
  2100. * ADDITIONAL FIRST FILE PROCESSING 02136000
  2101. $$FPT2 EQU * 02137000
  2102. SPACE 02138000
  2103. * MAKE FIRST FILE THE CURRENT INPUT FILE 02139000
  2104. MVC CIPLIST2(8*PLEN2),FIPLIST2 02140000
  2105. SPACE 02141000
  2106. * WE SAVE THE FIRST FILE NAME IN A SPECIAL PLACE SO THAT IT CAN 02142000
  2107. * BE EASILY RETRIEVED LATER. IT IS USED IN THE SUBSTITUTION 02143000
  2108. * FOR =. 02144000
  2109. MVC FNA(18),RDFNAME 02145000
  2110. NEXT GO FOR NEXT OPERATION 02146000
  2111. EJECT 02147000
  2112. * TYPE MESSAGES ASSOCIATED WITH 'TYPE' OPTION 02148000
  2113. SPACE 02149000
  2114. * TYPE MESSAGE 'COPY FNAME TO/OVLY/APPEND FNAME (NEW/OLD FILE)' 02150000
  2115. $$IOTYPE EQU * 02151000
  2116. TM OPF2,OP2REPL+OP2NEWF REPLACE OR NEW FILE? 02152000
  2117. BZ *+8 SKIP IF NOT 02153000
  2118. LA XR2,=CL8'TO' TYPE 'TO' 02154000
  2119. TM OPF2,OP2OVLY OVERLAY OPTION? 02155000
  2120. BZ *+8 SKIP IF NOT 02156000
  2121. LA XR2,=CL8'OVERLAY' TYPE 'OVERLAY' 02157000
  2122. TM OPF2,OP2APPE APPEND OPTION? 02158000
  2123. BZ *+8 SKIP IF NOT 02159000
  2124. LA XR2,=CL8'APPEND' TYPE 'APPEND' 02160000
  2125. SPACE 02161000
  2126. LA R14,=C'OLD' TYPE '(OLD FILE)' 02162000
  2127. CLC PFST-PLIST2+OUPLIST2,=F'0' BUT DID THE FST EXIST? 02163000
  2128. BNE *+8 SKIP IF IT DID 02164000
  2129. LA R14,=C'NEW' OTHERWISE, IT'S '(NEW FILE)' 02165000
  2130. B FNTYPEIO GO TO TYPE MESSAGE 02166000
  2131. SPACE 3 02167000
  2132. * TYPE MESSAGE 'COPY FNAME' 02168000
  2133. $$NITYPE EQU * 02169000
  2134. B FNTYPENI GO TYPE MESSAGE 02170000
  2135. EJECT 02171000
  2136. * CREATE RDBUF/WRBUF PLIST -- FILL IN INFO FROM FST AND ADT 02172000
  2137. $$MRWP EQU * 02173000
  2138. L R1,PPLIST2 POINT TO PLIST2 02174000
  2139. USE PLIST2,R1 02175000
  2140. L XR,PPLIST3 POINT TO PLIST3 02176000
  2141. USE PLIST3,XR 02177000
  2142. XC PITEM3,PITEM3 ZERO OUT ITEM NO FIELD 02178000
  2143. L XR2,PFST POINT TO FST 02179000
  2144. LTR XR2,XR2 IS THERE ANY? 02180000
  2145. BZ MRWPNF NOTHING TO DO IF NOT 02181000
  2146. USE FSTSECT,XR2 02182000
  2147. MVC PNA3(16),FSTN COPY FILE NAME/TYPE FROM FST 02183000
  2148. MVC PMO3,FSTM COPY FILE MODE NUMBER 02184000
  2149. L XR3,PADT POINT TO ACTIVE DISK TABLE 02185000
  2150. USE ADTSECT,XR3 02186000
  2151. MVC PMO3(1),ADTM COPY MODE LETTER 02187000
  2152. MVC PFV3,FSTFV COPY RECFM 02188000
  2153. MVC PBUFFS3,FSTIL COPY LRECL 02189000
  2154. NEXT GO FOR NEXT OPERATION 02190000
  2155. SPACE 2 02191000
  2156. * COME HERE IF THERE IS NO FST POINTER 02192000
  2157. * IN THIS CASE, COPY INFO FROM PLIST2 02193000
  2158. MRWPNF EQU * 02194000
  2159. CLI PMO2+1,C' ' ANY FILEMODE DIGIT SPECIFIED? 02195000
  2160. BNE *+8 SKIP IF SO 02196000
  2161. MVI PMO2+1,C'1' OTHERWISE, DEFAULT TO 1 02197000
  2162. MVC PNA3(18),PNA2 COPY FILE NA/TY/MO FROM PLIST2 02198000
  2163. NEXT GO FOR NEXT OPERATION 02199000
  2164. EJECT 02200000
  2165. * TEST TO SEE WHETHER FILE IS ALREADY ACTIVE. ERROR OUT IF SO. 02201000
  2166. $$TACT EQU * 02202000
  2167. L XR,PFSTAC GET STATE FST ADDRESS @VA04333 02203000
  2168. USE FSTSECT,XR 02204000
  2169. LTR XR,XR ANY FST POINTER? 02205000
  2170. BZ TACT1 NO -> FILE CAN'T BE ACTIVE 02206000
  2171. TM FSTFB,FSTFAW IS FILE ACTIVE FOR OUTPUT? @VA04333 02207000
  2172. BNZ ERACT ERROR IF SO 02208000
  2173. SPACE 02209000
  2174. TACT1 EQU * 02210000
  2175. NEXT GO FOR NEXT OPERATION 02211000
  2176. EJECT 02212000
  2177. EJECT 02224000
  2178. * GET NEXT FST FOR FILE 02225000
  2179. $$FNFST EQU * 02226000
  2180. L XR2,PPLIST2 POINT TO PLIST2 02227000
  2181. USE PLIST2,XR2 02228000
  2182. SPACE 02229000
  2183. * IF THERE WERE NO ASTERISKS SPECIFIED IN THE FILEID AS TYPED IN, 02230000
  2184. * THEN WE DO NOT LOOK FOR THE NEXT FST. 02231000
  2185. L R1,PFLG POINT TO FLAG BYTE FOR FILEID 02232000
  2186. TM 0(R1),FS ANY ASTERISKS SPECIFIED? 02233000
  2187. BZ FNFSTER NO NEXT FST IF NOT 02234000
  2188. L XR,PADT GET PTR TO OLD ADT 02235000
  2189. USE ADTSECT,XR 02236000
  2190. SPACE 02237000
  2191. * RESET ADT POINTERS TO WHAT THEY WERE WHEN LAST FST WAS OBTAINED. 02238000
  2192. DMSEXS MVC,ADTCHBA(8),PHYP EXECUTE IN SYSTEM STATUS 02239000
  2193. GETFST PLIST2,N,ERR=FNFSTER,ADT=(XR) GET NEXT FST 02240000
  2194. LR XR,R0 SET NEW ADT POINTER 02241000
  2195. MVC PHYP(8),ADTCHBA SAVE NEW FST INFO 02242000
  2196. L R15,ADTCFST GET NEW FST DISPLACEMENT@VA05129 02243000
  2197. ST R1,PFST SAVE NEW FST POINTER 02244000
  2198. ST XR,PADT STORE NEW ADT POINTER 02245000
  2199. NEXT @VA05659 02246000
  2200. SPACE 2 02247000
  2201. * COME HERE IF NO NEXT FST 02248000
  2202. FNFSTER EQU * 02249000
  2203. MVC PHYP(8),=D'0' INDICATE NO FST 02250000
  2204. XC PFST,PFST 02251000
  2205. NEXT GO FOR NEXT OPERATION 02252000
  2206. EJECT 02253000
  2207. * POINT TO NEXT OUTPUT FILE 02254000
  2208. $$OPT EQU * 02255000
  2209. LA XR,OUPLIST2 POINT TO NEW PLIST2 02256000
  2210. USE PLIST2,XR 02257000
  2211. ST XR,PPLIST2 MAKE IT CURRENT PLIST2 02258000
  2212. LA XR2,WRPLIST POINT TO NEW PLIST3 02259000
  2213. ST XR2,PPLIST3 STORE POINTER TO IT 02260000
  2214. LA XR2,OUTFLAGS POINT TO OUTPUT FLAG BYTE 02261000
  2215. ST XR2,PFLG STORE FLAG BYTE POINTER 02262000
  2216. MVC PPLIST1,POUPL1 GET OUTPUT FILE NAME PLIST1 02263000
  2217. NEXT 02264000
  2218. EJECT 02265000
  2219. * COPY FILE NAME FROM PLIST1 TO PLIST2, SUBSTITUTING FOR = SIGNS 02266000
  2220. $$SUBE EQU * 02267000
  2221. L XR2,PPLIST2 POINT TO PLIST2 02268000
  2222. USE PLIST2,XR2 02269000
  2223. L XR,PPLIST1 POINT TO PLIST1 02270000
  2224. USE PLIST1,XR 02271000
  2225. MVC PNA2(18),PNA1 COPY FILE NAME/TYPE/MODE 02272000
  2226. L XR3,PFLG POINT TO FLAG BYTE FOR FILE 02273000
  2227. TM 0(XR3),FE ANY = SIGNS IN THIS FILE NAME? 02274000
  2228. BNZ SUBEN GO IF THERE ARE ANY 02275000
  2229. NEXT FINISHED IF NOT 02276000
  2230. SPACE 02277000
  2231. * COME HERE IF THERE ARE ANY EQUAL SIGNS. 02278000
  2232. * SUBSTITUTE IN FILE NAME, IF ANY. 02279000
  2233. SUBEN EQU * 02280000
  2234. TM 0(XR3),FENA = SIGN IN FILE NAME? 02281000
  2235. BZ SUBET GO IF NOT 02282000
  2236. MVC STEMP(8),PNA1 COPY NAME TO TEMP 02283000
  2237. LA R1,FNA SUBSTITUTION FIELD FOR = 02284000
  2238. BAL RR,SUBES MAKE SUBSTITUTION 02285000
  2239. MVC PNA2,STRING COPY SUBSTITUTED FIELD 02286000
  2240. SPACE 02287000
  2241. * SUBSTITUTE FOR FILE TYPE 02288000
  2242. SUBET EQU * 02289000
  2243. TM 0(XR3),FETY = SIGN IN FILE TYPE 02290000
  2244. BZ SUBEM GO IF NOT 02291000
  2245. MVC STEMP(8),PTY1 COPY TYPE TO TEMP 02292000
  2246. LA R1,FTY SUBSTITUTION FIELD 02293000
  2247. BAL RR,SUBES MAKE SUBSTITUTION 02294000
  2248. MVC PTY2,STRING COPY SUBSTITUTED FIELD 02295000
  2249. SPACE 02296000
  2250. * SUBSTITUTE FOR FILE MODE 02297000
  2251. SUBEM EQU * 02298000
  2252. TM 0(XR3),FEMO = SIGN IN FILE MODE? 02299000
  2253. BZ SUBEX 02300000
  2254. MVC STEMP(2),PMO1 COPY FILE MODE TO TEMP 02301000
  2255. LA R1,FMO POINT TO SUBSTITUTION FIELD 02302000
  2256. BAL RR,SUBES 02303000
  2257. MVC PMO2,STRING 02304000
  2258. SPACE 02305000
  2259. SUBEX EQU * 02306000
  2260. NEXT 02307000
  2261. EJECT 02308000
  2262. * SUBSTITUTION SUBROUTINE USED BY $$SUBE ROUTINE. 02309000
  2263. * STEMP CONTAINS THE STRING WHICH IS TO BE SCANNED, AND R1 POINTS TO 02310000
  2264. * THE FIELD TO BE SUBSTITUTED FOR = SIGNS. 02311000
  2265. * THE NEW STRING WILL BE CREATED IN 'STRING' FIELD. 02312000
  2266. SUBES EQU * 02313000
  2267. MVC STRING(9),BLANKS INITIALIZE OUTPUT FIELD 02314000
  2268. MVI STEMP+8,C' ' TO GUARANTEE BLANK TERMINATOR 02315000
  2269. LA R14,STRING-1 'TO' POINTER 02316000
  2270. LA R15,STEMP-1 'FROM' POINTER 02317000
  2271. SPACE 02318000
  2272. * COME HERE AFTER EACH SUBSTITUTION HAS BEEN MADE. 02319000
  2273. SUBES1 EQU * 02320000
  2274. LA R14,1(,R14) POINT TO NEXT TARGET CHAR 02321000
  2275. LA R15,1(,R15) POINT TO NEXT 'FROM' CHAR 02322000
  2276. MVC 0(1,R14),0(R15) COPY CHARACTER 02323000
  2277. CLI 0(R15),C' ' WAS IT A BLANK? 02324000
  2278. BE 0(,RR) LEAVE SUBROUTINE IF SO 02325000
  2279. CLI 0(R15),C'=' WAS IT AN = SIGN? 02326000
  2280. BNE SUBES1 LOOP BACK IF NOT 02327000
  2281. MVC 0(8,R14),0(R1) COPY SUBSTITUTION FIELD 02328000
  2282. MVI 8(R14),C' ' ENSURE TERMINATING BLANK 02329000
  2283. LA R14,1(,R14) FIND TERMINATING BLANK 02330000
  2284. CLI 0(R14),C' ' 02331000
  2285. BNE *-8 02332000
  2286. BCT R14,SUBES1 DECREMENT AND REENTER SCAN LOOP 02333000
  2287. EJECT 02334000
  2288. * FIND FST FOR OUTPUT FILE 02335000
  2289. $$FWFST EQU * 02336000
  2290. LA XR2,OUPLIST2 POINT TO PLIST2 FOR OUTPUT FILE 02337000
  2291. USE PLIST2,XR2 02338000
  2292. GETFST PLIST2,F,ERR=FWFSTER,MODE=W GET FST FOR OUTPUT FILE 02339000
  2293. LR XR,R0 SAVE ADT POINTER IN XR 02340000
  2294. USE ADTSECT,XR 02341000
  2295. MVC PHYP(8),ADTCHBA COPY TWO FIELDS FROM ADT 02342000
  2296. ST R1,PFST SAVE FST POINTER 02343000
  2297. ST XR,PADT SAVE ADT POINTER 02344000
  2298. USE FSTSECT,R1 02345000
  2299. CLI PMO2+1,C' ' WAS MODE NUMBER OF OUTPUT FILE *02346000
  2300. SPECIFIED? 02347000
  2301. BNE *+10 SKIP IF IT WAS 02348000
  2302. MVC PMO2+1(1),FSTM+1 USE MODE NUMBER IN FST FOR *02349000
  2303. EXISTING FILE 02350000
  2304. NEXT 02351000
  2305. SPACE 02352000
  2306. * COME HERE IF THERE IS NO FST 02353000
  2307. FWFSTER EQU * 02354000
  2308. MVC PHYP(8),=D'0' ZERO OUT FST FIELD 02355000
  2309. XC PFST,PFST 02356000
  2310. NEXT 02357000
  2311. EJECT 02358000
  2312. * SET CORRECT MODE NUMBER FOR OUTPUT FILEID. 02359000
  2313. $$SOMODE EQU * 02360000
  2314. LA XR2,OUPLIST2 POINT TO PLIST2 FOR OUTPUT FILE 02361000
  2315. USE PLIST2,XR2 02362000
  2316. CLI PMO2+1,C' ' IS MODE NUMBER A BLANK? 02363000
  2317. BNE *+10 SKIP IF NOT 02364000
  2318. MVC PMO2+1(1),RDFMODE+1 FORCE MODE NUMBER TO THAT OF *02365000
  2319. FIRST INPUT FILE 02366000
  2320. CLI PMO2+1,C'Y' IS MODE 'NUMBER' A Y? 02367000
  2321. BNE *+8 SKIP IF NOT 02368000
  2322. MVI PMO2+1,C'2' FORCE MODE NUMBER TO 2 02369000
  2323. NEXT 02370000
  2324. EJECT 02371000
  2325. * TEST IF DISK IS READ/WRITE. 02372000
  2326. $$TRW EQU * 02373000
  2327. L XR,PPLIST2 POINT TO PLIST2 02374000
  2328. USE PLIST2,XR 02375000
  2329. L XR,PPLIST3 POINT TO PLIST3 02376000
  2330. USE PLIST3,XR 02377000
  2331. GETADT PLIST3,ERR=ERDISK,MODE=W GET POINTER TO DISK 02378000
  2332. USE ADTSECT,R1 02379000
  2333. TM ADTFLG1,ADTFRW DISK READ/WRITE? 02380000
  2334. BZ ERDISK ERROR IF NOT 02381000
  2335. NEXT 02382000
  2336. EJECT 02383000
  2337. * COPY RECFM SPECIFIED IN OPTION LIST 02384000
  2338. $$CFMS EQU * 02385000
  2339. L XR,PPLIST2 POINT TO PLIST2 02386000
  2340. USE PLIST2,XR 02387000
  2341. L XR,PPLIST3 POINT TO PLIST3 02388000
  2342. USE PLIST3,XR 02389000
  2343. MVC PFV3(1),RECFM COPY RECFM 02390000
  2344. SPACE 3 02391000
  2345. EJECT 02392000
  2346. * COPY LRECL SPECIFIED IN OPTION LIST 02393000
  2347. $$CRLS EQU * 02394000
  2348. L XR,PPLIST2 POINT TO PLIST2 02395000
  2349. USE PLIST2,XR 02396000
  2350. L XR,PPLIST3 POINT TO PLIST3 02397000
  2351. USE PLIST3,XR 02398000
  2352. MVC PBUFFS3,LRECL COPY LRECL 02399000
  2353. NEXT 02400000
  2354. EJECT 02401000
  2355. * COPY LRECL TO SPECIFIED FROM CURRENT INPUT FILE 02402000
  2356. $$CFMA EQU * @VA05624 02403000
  2357. CLI RECFM,C'V' OUPTUT RECFM ALREAD 'V'? @VA05624 02404000
  2358. BE CFMAN YES, DON'T UPDATE @VA05624 02405000
  2359. L XR2,PPLIST2 ADDR OF CURR PLIST @VA05624 02406000
  2360. USE PLIST2,XR2 @VA05624 02407000
  2361. L XR3,PFST ADDRESS OF FST @VA05624 02408000
  2362. USE FSTSECT,XR3 @VA05624 02409000
  2363. MVC RECFM(1),FSTFV SUPPLY FROM INPUT REGARDLESS @VA05624 02410000
  2364. CFMAN NEXT @VA05624 02411000
  2365. SPACE 3 02412000
  2366. * COPY LARGEST LRECL TO SPECIFIED LIST 02413000
  2367. $$CRLA EQU * @VA05624 02414000
  2368. L XR2,PPLIST2 ADDR OF CURR PLIST2 @VA05624 02415000
  2369. USE PLIST2,XR2 @VA05624 02416000
  2370. L XR3,PFST ADDRESS OF FST @VA05624 02417000
  2371. USE FSTSECT,XR3 @VA05624 02418000
  2372. L XR3,FSTIL GET LRECL @VA05624 02419000
  2373. C XR3,LRECL LARGER THAN CURRENT @VA05624 02420000
  2374. BNH CRLAN NO, DON'T UPDATE @VA05624 02421000
  2375. ST XR3,LRECL YES, MAKE IT THE LARGER @VA05624 02422000
  2376. CRLAN NEXT @VA05624 02423000
  2377. EJECT 02424000
  2378. $$ERNX EQU * 02425000
  2379. B ERNX 02426000
  2380. EJECT 02427000
  2381. * USE CMSUT FILEID AS FILE NAME IN OUTPUT PLIST. 02428000
  2382. $$WTEMP EQU * 02429000
  2383. MVC WRFNAME(16),=CL16'COPYFILECMSUT1' @VM08876 02430000
  2384. SPACE 2 02431000
  2385. * NOTE THAT FILE MODE IS ALREADY IN WRPLIST. HOWEVER, WE FORCE THE 02432000
  2386. * MODE NUMBER TO 1 FOR THE CMSUT FILE. 02433000
  2387. MVI WRFMODE+1,C'1' 02434000
  2388. SPACE 02435000
  2389. * NOW WE ERASE THIS FILE IN CASE IT ALREADY EXISTS. 02436000
  2390. MVC ERPLIST+8(18),WRFNAME COPY NAME INTO ERASE PLIST 02437000
  2391. LA R1,ERPLIST 02438000
  2392. SVC 202 02439000
  2393. DC AL4(*+4) 02440000
  2394. NEXT 02441000
  2395. EJECT 02442000
  2396. * COPY INPUT FILE RECFM IN CASE IT WAS NOT SPECIFIED IN OPTION LIST. 02443000
  2397. $$CFMI EQU * 02444000
  2398. MVC WRFV(1),RDFV COPY RECFM 02445000
  2399. NEXT 02446000
  2400. SPACE 5 02447000
  2401. * COPY INPUT FILE LRECL IN CASE IT WAS NOT SPECIFIED IN OPTION LIST. 02448000
  2402. $$CRLI EQU * 02449000
  2403. MVC WRBUFFS,RDBUFFS 02450000
  2404. NEXT 02451000
  2405. EJECT 02452000
  2406. * SET UP POINTERS TO OVERLAY FILE 02453000
  2407. $$VPT EQU * 02454000
  2408. L XR,PPLIST2 POINT TO PLIST2 02455000
  2409. USE PLIST2,XR 02456000
  2410. LA R1,OVPLIST POINT TO OVERLAY PLIST 02457000
  2411. ST R1,PPLIST3 USE IT AS PLIST3 02458000
  2412. NEXT 02459000
  2413. EJECT 02460000
  2414. * SET ITEM NUMBER IN OUTPUT PLIST FOR 'APPEND' OPTION BY COPYING 02461000
  2415. * ITEM COUNT FROM THE FST FOR THE FILE. 02462000
  2416. $$APITEM EQU * 02463000
  2417. L XR,OUPLIST2+PFST-PLIST2 POINT TO FST FOR OUTPUT FILE 02464000
  2418. USE FSTSECT,XR 02465000
  2419. MVC WRITEM,FSTIC COPY OVER ITEM NUMBER 02466000
  2420. NEXT 02467000
  2421. EJECT 02468000
  2422. * WE SAVE THE ITEM NUMBER OF THE FIRST RECORD WHICH IS GOING TO GO 02469000
  2423. * INTO THE OUTPUT FILE. THIS WILL ALLOW US TO CHECK LATER TO SEE IF 02470000
  2424. * ANY RECORDS WERE COPIED INTO THE OUTPUT FILE. 02471000
  2425. $$SFIT EQU * 02472000
  2426. MVC OFREC,WRITEM COPY ITEM NUMBER 02473000
  2427. NEXT 02474000
  2428. EJECT 02475000
  2429. * PRELIMINARY BUFFER SIZE MANIPULATION FOR 'PACK' BUFFER OPERATION. 02476000
  2430. $$PCPACK EQU * 02477000
  2431. MVC WRBUFFS,=F'800' OUTPUT BUFFER SIZE IS 800 02478000
  2432. MVI WRFV,C'F' OUTPUT RECFM IS F 02479000
  2433. SPACE 02480000
  2434. * SET UP THE PACK FILE BUFFER HEADER 02481000
  2435. MVC PACKVER,=H'1' VERSION 1 OF 'PACK' FORMAT 02482000
  2436. MVC PACKCHAR,FILLC MOST IMPORTANT CHAR IS FILL CHAR 02483000
  2437. MVC PACKRECF,RDFV COPY RECFM OF INPUT FILE 02484000
  2438. MVC PACKLREC,RDBUFFS COPY LRECL OF INPUT FILE 02485000
  2439. NEXT 02486000
  2440. EJECT 02487000
  2441. * PRELIMINARY BUFFER SIZE MANIPULATION FOR THE 'UNPACK' OPERATION. 02488000
  2442. * WE DON'T KNOW THE SIZE OF THE OUTPUT FILE UNTIL WE READ IN 02489000
  2443. * THE PACK FILE BUFFER HEADER FROM THE PACKED FILE. WE DO THIS NOW BY 02490000
  2444. * READING THE FIRST FEW BYTES OF THE FIRST BLOCK OF THE FILE INTO 02491000
  2445. * THE BUFFER HEADER AREA IN THE WORK AREA. 02492000
  2446. $$PCUNPA EQU * 02493000
  2447. CLC RDBUFFS,=F'800' INPUT LRECL = 800? 02494000
  2448. BNE ERILP NOT PACKED FORMAT IF NOT 02495000
  2449. CLI RDFV,C'F' INPUT RECFM = F? 02496000
  2450. BNE ERILP NOT PACKED IF NOT 02497000
  2451. SPACE 02498000
  2452. * READ PACKED FILE BUFFER HEADER INTO WORK AREA 02499000
  2453. * WE READ A WHOLE 800 BYTE RECORD INTO A GETMAINED AREA. WE GETMAIN 02500000
  2454. * 880 BYTES SO THAT IF THE OUTPUT FILE HAS RECFM 80, WE WON'T HAVE 02501000
  2455. * DO A GETMAIN/FREEMAIN LATER. 02502000
  2456. CLC BUFLEN,=F'0' HAS A BUFFER BEEN ALLOCATED? 02503000
  2457. BP PCUNPA1 THEN IT'S ALREADY 880 BYTES LONG 02504000
  2458. GETMAIN R,LV=880 ALLOCATE BUFFER 02505000
  2459. MVC BUFLEN,=F'880' SET BUFFER LENGTH 02506000
  2460. ST R1,BUFAD STORE BUFFER ADDRESS 02507000
  2461. SPACE 02508000
  2462. PCUNPA1 EQU * 02509000
  2463. MVC RDBUFFA,BUFAD COPY BUFFER ADDRESS INTO PLIST 02510000
  2464. LA R1,RDPLIST POINT TO INPUT PLIST 02511000
  2465. SVC 202 READ FILE BUFFER HEADER 02512000
  2466. DC AL4(*+4) ERROR RETURN @VA04664 02513000
  2467. SPACE 02514000
  2468. CKRW RD CHECK FOR READ ERROR 02515000
  2469. L R1,BUFAD OUTPUT BUFFER ADDRESS 02516000
  2470. MVC PACKFHB(PACKBL),0(R1) COPY PACKED FILE BUFFER HEADER 02517000
  2471. CLC PACKVER,=H'1' IS THIS VERSION 1 PACKED FORMAT 02518000
  2472. BNE ERILP NOT PACKED FORMAT IF NOT 02519000
  2473. CLI PACKRECF,C'F' SEE IF HEADER IS FOR F FILE @VA13261 02519150
  2474. BE RECFMOK RECFM IS VALID, CONTINUE UNPACK @VA13261 02519300
  2475. CLI PACKRECF,C'V' SEE IF HEADER IS FOR V FILE @VA13261 02519450
  2476. BNE ERILP NOT PACKED FORMAT IF NOT F OR V @VA13261 02519600
  2477. RECFMOK EQU * @VA13261 02519750
  2478. MVC WRFV,PACKRECF GET RECFM OF OUTPUT FILE 02520000
  2479. MVC WRBUFFS,PACKLREC GET LRECL OF OUTPUT FILE 02521000
  2480. NEXT 02522000
  2481. EJECT 02523000
  2482. * SET UP I/O BUFFERS AND INITIALIZE OUTPUT BUFFER TO FILL CHARACTER. 02524000
  2483. $$PCSET EQU * 02525000
  2484. TM OPF1,OP1SPECS 'SPECS' OPTION SPECIFIED? 02526000
  2485. BO PCSETS GO IF YES 02527000
  2486. TM OPF2,OP2PACK+OP2UNPA 'PACK' OR 'UNPACK' SPECIFIED? 02528000
  2487. BNZ PCSETT GO HANDLE IT IF YES 02529000
  2488. SPACE 02530000
  2489. * OTHERWISE, ONLY ONE BUFFER IS NEED FOR BOTH INPUT AND OUTPUT. 02531000
  2490. * THE SIZE OF THIS BUFFER IS MAX SIZE OF INPUT, OUTPUT AND OVERLAY 02532000
  2491. * BUFFER SIZES, AND 256. 02533000
  2492. L R0,RDBUFFS GET SIZE OF INPUT BUFFER 02534000
  2493. C R0,WRBUFFS COMPARE TO OUTPUT BUFFER SIZE 02535000
  2494. BH *+8 SKIP IF LOWER 02536000
  2495. L R0,WRBUFFS USE OUTPUT BUFFER SIZE 02537000
  2496. C R0,OVBUFFS COMPARE TO OVERLAY BUFFER SIZE 02538000
  2497. BH *+8 SKIP IF HIGHER 02539000
  2498. L R0,OVBUFFS USE OVERLAY BUFFER SIZE 02540000
  2499. CH R0,=H'256' 256 MINIMUM 02541000
  2500. BH *+8 SKIP IF GREATER 02542000
  2501. LA R0,256 USE 256 02543000
  2502. ST R0,BUFNEED BUFFER SIZE NEEDED 02544000
  2503. ST R0,OBUFLEN SAVE OUTPUT BUFFER LENGTH 02545000
  2504. XC OBUFAD,OBUFAD NO OUTPUT BUFFER DISPLACEMENT 02546000
  2505. B PCSETC GO ALLOCATE BUFFER 02547000
  2506. SPACE 3 02548000
  2507. * COME HERE IF 'SPECS' OPTION WAS SPECIFIED. IN THIS CASE 02549000
  2508. * THERE ARE SEPARATE INPUT AND OUTPUT BUFFERS, AND THE OUTPUT BUFFER 02550000
  2509. * LIES AT THE END OF THE INPUT BUFFER. 02551000
  2510. SPACE 02552000
  2511. * THE SIZE OF THE OUTPUT BUFFER IS THE MAXIMUM OF: 02553000
  2512. * 1. THE OUTPUT LRECL 02554000
  2513. * 2. OVERLAY LRECL 02555000
  2514. * 3. MAX(OUTPUT BUFFER DISPLACEMENT SPEC)+MAX(INPUT LRECL,130) 02556000
  2515. * 4. 256 02557000
  2516. PCSETS EQU * 02558000
  2517. L R0,RDBUFFS GET INPUT LRECL 02559000
  2518. CH R0,=H'130' GREATER THAN 130? 02560000
  2519. BH *+8 SKIP IF IT IS 02561000
  2520. LA R0,130 OTHERWISE, USE 130 02562000
  2521. A R0,SPECMAX ADD MAX OUTPUT BUFFER DISPLACE- *02563000
  2522. MENT SPEC 02564000
  2523. C R0,OVBUFFS COMPARE TO OVERLAY LRECL 02565000
  2524. BH *+8 SKIP IF ALREADY GREATER 02566000
  2525. L R0,OVBUFFS USE IT 02567000
  2526. C R0,WRBUFFS COMPARE WITH OUTPUT LRECL 02568000
  2527. BH *+8 SKIP IF ALREADY GREATER 02569000
  2528. L R0,WRBUFFS OTHERWISE USE IT 02570000
  2529. CH R0,=H'256' GREATER THAN 256 02571000
  2530. BH *+8 SKIP IF IT IS 02572000
  2531. LA R0,256 OTHERWISE USE 256 02573000
  2532. ST R0,OBUFLEN SAVE OUTPUT BUFFER LENGTH 02574000
  2533. SPACE 02575000
  2534. * AND NOW, THE TOTAL BUFFER SIZE NEED IS THE MAXIMUM OF: 02576000
  2535. * 1. C(R0) + INPUT LRECL 02577000
  2536. * 2. 512 02578000
  2537. A R0,RDBUFFS ADD INPUT LRECL 02579000
  2538. CH R0,=H'512' COMPARE WITH 512 02580000
  2539. BH *+8 SKIP IF GREATER 02581000
  2540. LA R0,512 02582000
  2541. ST R0,BUFNEED SAVE BUFFER SIZE NEEDED 02583000
  2542. MVC OBUFAD,RDBUFFS SAVE OUTPUT BUFFER DISPLACEMENT 02584000
  2543. B PCSETC GO ALLOCATE BUFFER 02585000
  2544. SPACE 2 02586000
  2545. * COME HERE IF 'PACK' OR 'UNPACK' OPTION IS SPECIFIED. IN THIS CASE, 02587000
  2546. * THE SIZE OF THE NEEDED BUFFER IS THE SUM OF THE SIZES OF THE 02588000
  2547. * INPUT AND OUTPUT BUFFERS. 02589000
  2548. PCSETT EQU * 02590000
  2549. L R0,RDBUFFS GET SIZE OF INPUT BUFFER 02591000
  2550. L R1,WRBUFFS GET SIZE OF OUTPUT BUFFER 02592000
  2551. ST R0,OBUFAD STORE DISPLACEMENT OF OUTPUT BUF 02593000
  2552. ST R1,OBUFLEN STORE LENGTH OF OUTPUT BUFFER 02594000
  2553. AR R0,R1 COMPUTE SUM 02595000
  2554. ST R0,BUFNEED BUFFER SIZE NEEDED 02596000
  2555. B PCSETC GO ALLOCATE BUFFER 02597000
  2556. SPACE 3 02598000
  2557. * COME HERE WHEN THE NEEDED BUFFER SIZE HAS BEEN DETERMINED, AND PLACED 02599000
  2558. * IN LOCATION 'BUFNEED'. IN ADDTION, THE DISPLACEMENT OF THE OUTPUT 02600000
  2559. * BUFFER IS LOCATION 'OBUFAD' -- IT WILL EQUAL EITHER 0 (TO INDICATE 02601000
  2560. * THATE THE INPUT AND OUTPUT BUFFERS ARE THE SAME) OR INPUT LRECL 02602000
  2561. * (TO INDICATE THAT THE OUTPUT BUFFER LIES AT THE END OF THE INPUT 02603000
  2562. * BUFFER). 02604000
  2563. SPACE 02605000
  2564. * THE PROCEDURE IS TO CHECK TO SEE WHETHER WE HAVE ALREADY ALLOCATED 02606000
  2565. * A LARGE ENOUGH BUFFER. IF WE HAVE THEN WE SIMPLY USE IT. OTHERWISE, 02607000
  2566. * WE FREEMAIN THE OLD BUFFER AND GETMAIN A NEW BUFFER. 02608000
  2567. PCSETC EQU * 02609000
  2568. L R0,BUFLEN GET SIZE OF EXISTING BUFFER 02610000
  2569. C R0,BUFNEED IS IT GREATER THAN WE NEED? 02611000
  2570. BNL PCSETO IT'S BIG ENOUGH 02612000
  2571. L R1,BUFAD GET OLD BUFFER ADDRESS 02613000
  2572. LTR R1,R1 IS THERE AN OLD BUFFER? 02614000
  2573. BZ PCSETG NO FREEMAIN IF NOT 02615000
  2574. FREEMAIN R,LV=(0),A=(1) FREEMAIN THE OLD BUFFER 02616000
  2575. SPACE 02617000
  2576. PCSETG EQU * 02618000
  2577. L R0,BUFNEED GET SIZE OF NEEDED BUFFER 02619000
  2578. ST R0,BUFLEN SAVE AS NEW BUFFER LENGTH 02620000
  2579. GETMAIN R,LV=(0) ALLOCATE THE BUFFER 02621000
  2580. LA R1,0(,R1) CLEAR ANY HIGH BYTE 02622000
  2581. ST R1,BUFAD STORE BUFFER ADDRESS 02623000
  2582. SPACE 02624000
  2583. PCSETO EQU * 02625000
  2584. L R1,BUFAD 02626000
  2585. A R1,OBUFAD ADD OUTPUT BUFFER DISPLACEMENT 02627000
  2586. ST R1,OBUFAD AND SAVE OUTPUT BUFFER ADDRESS 02628000
  2587. LM R14,R15,OBUFAD GET BUFFER ADDRESS/LENGTH 02629000
  2588. SR R0,R0 02630000
  2589. L R1,FILLC LOAD FILL CHARACTER AND 0 LEN 02631000
  2590. MVCL R14,R0 INITIALIZE BUFFER TO FILL CHAR 02632000
  2591. EJECT 02633000
  2592. * WE NOW DETERMINE WHETHER IT WILL BE NECESSARY TO INITIALIZE THE 02634000
  2593. * BUFFER TO THE FILL CHARACTER AFTER EACH WRBUF OPERATION. THIS 02635000
  2594. * IS DETERMINED ACCORDING TO THE FOLLOWING TABLE: 02636000
  2595. SPACE 02637000
  2596. * INPUT OVLY OUTPUT 'SPECS' INIT EACH 02638000
  2597. * RECFM RECFM RECFM SPECIFIED? TIME? 02639000
  2598. * ----- ----- ------ ---------- --------- 02640000
  2599. * F FN F Y N 02641000
  2600. * F FN F N N 02642000
  2601. * F FN V Y N 02643000
  2602. * F FN V N N 02644000
  2603. * F V F Y Y 02645000
  2604. * F V F N Y 02646000
  2605. * F V V Y Y 02647000
  2606. * F V V N N 02648000
  2607. * V FN F Y Y 02649000
  2608. * V FN F N Y 02650000
  2609. * V FN V Y Y 02651000
  2610. * V FN V N N 02652000
  2611. * V V F Y Y 02653000
  2612. * V V F N Y 02654000
  2613. * V V V Y Y 02655000
  2614. * V V V N N 02656000
  2615. SPACE 02657000
  2616. * WHERE: 02658000
  2617. * F = FIXED RECFM 02659000
  2618. * V = VARIABLE RECFM 02660000
  2619. * FN = FIXED RECFM OR NONE (IF NO OVERLAY FILE) 02661000
  2620. * Y = YES 02662000
  2621. * N = NO 02663000
  2622. SPACE 02664000
  2623. SR R1,R1 02665000
  2624. CLI RDFV,C'V' INPUT RECFM = V? 02666000
  2625. BNE *+8 SKIP IF NOT 02667000
  2626. LA R1,B'00001000' ADD 1 IN FIRST COL IF SO 02668000
  2627. CLI OVFV,C'V' OVERLAY FILE RECFM = V? 02669000
  2628. BNE *+8 SKIP IF NOT 02670000
  2629. LA R1,B'00000100'(,R1) ADD 1 IN SECOND COL IF SO 02671000
  2630. CLI WRFV,C'V' OUTPUT RECFM = V? 02672000
  2631. BNE *+8 SKIP IF NOT 02673000
  2632. LA R1,B'00000010'(,R1) ADD 1 IN THIRD COL IF SO 02674000
  2633. TM OPF1,OP1SPECS 'SPECS' OPTION SPECIFIED? 02675000
  2634. BO *+8 SKIP IF SO 02676000
  2635. LA R1,B'00000001'(,R1) ADD 1 IN FOURTH COL IF NOT 02677000
  2636. L R0,=BL.32'0000111011101110' LOAD FUNCTION BITS (5TH COL) 02678000
  2637. SLL R0,16(R1) SHIFT FCN BIT INTO SIGN POSITION 02679000
  2638. MVI BINBYTE,0 SAY 'NO INITIALIZATION' 02680000
  2639. LTR R0,R0 BUT IS FCN BIT A 1? 02681000
  2640. BZ *+8 SKIP IF IT ISN'T @VA09465 02682000
  2641. MVI BINBYTE,X'FF' THEN MUST INITIALIZE 02683000
  2642. TM OPF2,OP2PACK+OP2UNPA PACK OR UNPACK SPECIFIED? 02684000
  2643. BZ *+8 SKIP IF NOT 02685000
  2644. MVI BINBYTE,0 IF SO, DON'T INITIALIZE 02686000
  2645. SPACE 02687000
  2646. * INITIALIZE THE BUFFER ADDRESSES IN THE THREE RDBUF/WRBUF PLISTS. 02688000
  2647. MVC RDBUFFA,BUFAD INPUT FILE PLIST 02689000
  2648. MVC WRBUFFA,OBUFAD OUTPUT FILE PLIST 02690000
  2649. MVC OVBUFFA,OBUFAD OVERLAY FILE PLIST 02691000
  2650. NEXT 02692000
  2651. EJECT 02693000
  2652. * INITIALIZE BUFFER POINTERS FOR 'PACK' OPERATION. 02694000
  2653. $$PCPAB EQU * 02695000
  2654. L R1,OBUFAD GET ADDRESS OF BUFFER ADDRESS 02696000
  2655. MVC 0(PACKBL,R1),PACKFHB COPY PACK FILE HEADER BUFFER *02697000
  2656. INTO OUTPUT FILE BUFFER 02698000
  2657. LA R1,PACKBL(,R1) POINT TO FIRST AVAILABLE BYTE 02699000
  2658. ST R1,PACKBUF STORE AS CURRENT BUFFER POINTER 02700000
  2659. LA R1,800-PACKBL COMPUTE NUMBER OF BYTES LEFT 02701000
  2660. ST R1,PACKLEFT STORE INTO FIELD 02702000
  2661. MVC PKCC(1),FILLC INITIALIZE PKCC 02703000
  2662. MVC PKCC+1(1),FILLC 02704000
  2663. NEXT 02705000
  2664. SPACE 4 02706000
  2665. * INITIALIZE BUFFER POINTERS FOR 'UNPACK' OPERATION. 02707000
  2666. $$PCUPB EQU * 02708000
  2667. MVC RDITEM,=H'1' SET ITEM NUMBER FOR INPUT FILE. 02709000
  2668. LA R1,RDPLIST POINT TO INPUT PLIST 02710000
  2669. SVC 202 READ FIRST BLOCK FROM INPUT FILE 02711000
  2670. DC AL4(*+4) ERROR RETURN @VA04664 02712000
  2671. CKRW RD CHECK FOR READ ERROR 02713000
  2672. L R1,RDBUFFA GET ADDRESS OF INPUT BUFFER 02714000
  2673. LA R1,PACKBL(,R1) POINT BEYOND PACK FILE HEADER 02715000
  2674. ST R1,PACKBUF STORE AS NEXT BYTE IN BUFFER 02716000
  2675. LA R1,800-PACKBL COMPUTE BYTES LEFT IN BUFFER 02717000
  2676. ST R1,PACKLEFT STORE AS NUMBER OF BYTES LEFT 02718000
  2677. NEXT 02719000
  2678. EJECT 02720000
  2679. * SKIP TO 'FROM' NUMBER ON INPUT FILE 02721000
  2680. $$SKIPN EQU * 02722000
  2681. L R0,FROMN GET FROM NUMBER 02723000
  2682. BCTR R0,0 REDUCE BY 1 02724000
  2683. STH R0,RDITEM AND STORE AS ITEM NUMBER 02725000
  2684. L XR,CIPLIST2+PFST-PLIST2 POINT TO FST FOR CURRENT INPUT 02726000
  2685. USE FSTSECT,XR 02727000
  2686. CLC FSTIC,RDITEM COMPARE REQUESTED SIZE WITH *02728000
  2687. NUMBER OF ITEMS IN FILE 02729000
  2688. BNH ERNFN GO IF 'FROM' NUMBER IS TOO HIGH 02730000
  2689. NEXT 02731000
  2690. EJECT 02732000
  2691. * SKIP TO 'FRLABEL' 02733000
  2692. $$SKIPL EQU * 02734000
  2693. SR XR,XR ITEM NUMBER 02735000
  2694. L XR2,RDBUFFA INPUT BUFFER ADDRESS 02736000
  2695. LH XR3,FRLL GET FRLABEL (LENGTH - 1) 02737000
  2696. SPACE 02738000
  2697. * COME HERE TO DO EACH NEW RDBUF 02739000
  2698. SKIPLL EQU * 02740000
  2699. LA XR,1(,XR) INCREMENT ITEM NUMBER 02741000
  2700. STH XR,RDITEM SAVE IN OUTPUT PLIST 02742000
  2701. LA R1,RDPLIST POINT TO OUTPUT PLIST 02743000
  2702. SVC 202 READ A RECORD 02744000
  2703. DC AL4(*+4) 02745000
  2704. CKRW RD,EOF=ERNFL CHECK RETURN CODE 02746000
  2705. C XR3,RDRET COMPARE LABEL LENGTH WITH *02747000
  2706. LENGTH OF RECORD READ 02748000
  2707. BH SKIPLL NO MATCH IF RECORD IS SHORTER 02749000
  2708. EX XR3,SKIPLC COMPARE LABEL WITH RECORD 02750000
  2709. BNE SKIPLL LOOP IF NOT 02751000
  2710. SPACE 02752000
  2711. * COME HERE WHEN MATCH FOUND 02753000
  2712. SKIPLS EQU * 02754000
  2713. BCTR XR,0 REDUCE ITEM NUMBER 02755000
  2714. STH XR,RDITEM STORE ITEM NUMBER IN PLIST 02756000
  2715. NEXT 02757000
  2716. SPACE 02758000
  2717. SKIPLC CLC FRL(0),0(XR2) LENGTH FILLED IN BY EX 02759000
  2718. EJECT 02760000
  2719. * PRELIMINARY SETUP CODE FOR 'FOR' NUMBER. 02761000
  2720. * WE COMPUTE THE RECORD NUMBER OF THE LAST RECORD TO BE READ. 02762000
  2721. $$SETFOR EQU * 02763000
  2722. L R1,FORN GET 'FOR' NUMBER 02764000
  2723. AH R1,RDITEM ADD CURRENT ITEM NUMBER 02765000
  2724. ST R1,FOREND SAVE AS FINAL VALUE 02766000
  2725. NEXT 02767000
  2726. EJECT 02768000
  2727. * INITIALIZE OUTPUT BUFFER TO FILL CHARACTER, IF NECESSARY 02769000
  2728. $$IBUFF EQU * 02770000
  2729. L R1,OBUFAD GET ADDRESS OF OUTPUT BUFF P3090 02771000
  2730. LA R1,1(,R1) POINT TO BUFFER+1 P3090 02772000
  2731. ST R1,VBUFEND STORE AS VARIABLE BUFFER P3090*02773000
  2732. END, IN CASE NECESSARY P3090 02774000
  2733. CLI BINBYTE,0 BUFFER INITIALIZATION NECESSARY? 02775000
  2734. BE IBUFFN GO IF NOT 02776000
  2735. LM R14,R15,OBUFAD LOAD BUFFER ADDRESS/LENGTH 02777000
  2736. SR R0,R0 02778000
  2737. L R1,FILLC GET FILL CHARACTER 02779000
  2738. MVCL R14,R0 INITIALIZE BUFFER 02780000
  2739. SPACE 02781000
  2740. IBUFFN EQU * 02782000
  2741. NEXT 02783000
  2742. EJECT 02784000
  2743. * READ OVERLAY FILE INTO OUTPUT BUFFER 02785000
  2744. $$RDOVLY EQU * 02786000
  2745. LH R1,OVITEM GET OVERLAY ITEM NUMBER 02787000
  2746. LA R1,1(,R1) INCREMENT 02788000
  2747. STH R1,OVITEM 02789000
  2748. LA R1,OVPLIST GET OVERLAY PLIST ADDRESS 02790000
  2749. SVC 202 READ OVERLAY FILE 02791000
  2750. DC AL4(*+4) 02792000
  2751. CKRW RD,EOF=RDOVLYE CHECK RETURN CODE 02793000
  2752. L R1,OVRET GET NO BYTES READ 02794000
  2753. A R1,OBUFAD ADD TO OUTPUT BUFFER ADDRESS 02795000
  2754. ST R1,VBUFEND SAVE AS VARIABLE BUFFER END 02796000
  2755. NEXT 02797000
  2756. SPACE 02798000
  2757. * END OF FILE ON OVERLAY FILE 02799000
  2758. RDOVLYE EQU * 02800000
  2759. PHASE CL ENTER CLOSING PHASE 02801000
  2760. EJECT 02802000
  2761. * CHECK TO SEE IF 'FOR' NUMBER HAS BEEN REACHED. 02803000
  2762. $$CKFORN EQU * 02804000
  2763. CLC RDITEM,FOREND+2 HAS IT BEEN REACHED? 02805000
  2764. BNL CKFORNE GO IF IT HAS 02806000
  2765. NEXT 02807000
  2766. SPACE 02808000
  2767. * IT IT'S BEEN REACHED, ENTER PHASE EO 02809000
  2768. CKFORNE EQU * 02810000
  2769. PHASE EO 02811000
  2770. EJECT 02812000
  2771. * READ INPUT FILE INTO INPUT BUFFER 02813000
  2772. $$RDIN EQU * 02814000
  2773. LH R1,RDITEM GET INPUT ITEM NUMBER 02815000
  2774. LA R1,1(,R1) INCREMENT 02816000
  2775. STH R1,RDITEM AND STORE 02817000
  2776. LA R1,RDPLIST POINT TO INPUT PLIST 02818000
  2777. SVC 202 02819000
  2778. DC AL4(*+4) 02820000
  2779. CKRW RD,EOF=RDINE CHECK RETURN CODE 02821000
  2780. NEXT 02822000
  2781. SPACE 02823000
  2782. * ENTER PHASE EO ON EOF ON INPUT FILE. 02824000
  2783. RDINE EQU * 02825000
  2784. PHASE EO 02826000
  2785. EJECT 02827000
  2786. * IF INPUT AND OUTPUT BUFFERS ARE THE SAME, THEN SET VBUFEND ACCORDING 02828000
  2787. * TO INPUT FILE RECORD SIZE. 02829000
  2788. $$SVE EQU * 02830000
  2789. L R1,RDRET GET SIZE OF INPUT RECORD 02831000
  2790. A R1,BUFAD ADD BUFFER ADDRESS 02832000
  2791. C R1,VBUFEND IS IT BEYOND EXISTING VBUFEND? 02833000
  2792. BL *+8 DON'T SET IT IF NOT 02834000
  2793. ST R1,VBUFEND SET NEW VBUFEND 02835000
  2794. NEXT 02836000
  2795. EJECT 02837000
  2796. * CHECK WHETHER 'TOLABEL' HAS BEEN REACHED. 02838000
  2797. $$CKTOL EQU * 02839000
  2798. LH XR3,TOLL GET LABEL (LENGTH - 1) 02840000
  2799. C XR3,RDRET COMPARE LABEL LENGTH WITH *02841000
  2800. LENGTH OF RECORD READ 02842000
  2801. BH CKTOLN NO MATCH IF RECORD IS SHORTER 02843000
  2802. L R1,RDBUFFA POINT TO INPUT BUFFER 02844000
  2803. EX XR3,CKTOLC COMPARE LABEL WITH RECORD 02845000
  2804. BNE CKTOLN GO IF NO MATCH 02846000
  2805. PHASE EO ENTER PHASE EO IF A MATCH 02847000
  2806. SPACE 02848000
  2807. CKTOLN EQU * 02849000
  2808. NEXT 02850000
  2809. SPACE 02851000
  2810. CKTOLC CLC TOL(0),0(R1) LENGTH FILLED IN BY EX 02852000
  2811. EJECT 02853000
  2812. * COPY DATA FROM INPUT BUFFER TO OUTPUT BUFFER ACCORDING TO 'SPECS' 02854000
  2813. * SPECIFICATIONS. 02855000
  2814. $$COPSP EQU * 02856000
  2815. LA SPR,SPECSB-SPBLEN POINT TO 'SPECS' CTL BLOCK 02857000
  2816. SPACE 02858000
  2817. * COME HERE TO HANDLE NEXT SPECIFICATION. 02859000
  2818. COPSPL EQU * 02860000
  2819. LA SPR,SPNEXT GET NEXT SPEC BLOCK 02861000
  2820. CLI 0(SPR),X'FF' END OF SPECIFICATIONS? 02862000
  2821. BE COPSPE GO IF YES 02863000
  2822. LM R0,R1,SPINDISP GET INPUT BUFFER DISPS 02864000
  2823. LTR R0,R0 BUT WAS IT A CONSTANT STRING? 02865000
  2824. BM COPSPO GO IF IT WAS 02866000
  2825. TM OPF3,OP3PHCV ARE WE IN PHASE CV? @VA03971 02867000
  2826. BO COPSPL YES; IGNORE COLUMN PAIR SPECS @VA03971 02868000
  2827. C R0,RDRET BEG COL > INPUT BUFFER LENGTH? 02869000
  2828. BNL COPSPL SKIP SPECIFICATION IF NOT 02870000
  2829. C R1,RDRET END COL > INPUT BUFFER LENGTH? 02871000
  2830. BL *+8 SKIP IF NOT 02872000
  2831. L R1,RDRET OTHERWISE, TRUNCATE SPEC 02873000
  2832. SR R1,R0 GET LENGTH OF SPEC 02874000
  2833. A R0,RDBUFFA R0 -> 'FROM' ADDRESS 02875000
  2834. SPACE 02876000
  2835. COPSPO EQU * 02877000
  2836. L R14,SPOUDISP GET DISPLACEMENT INTO OUTPUT BUF 02878000
  2837. A R14,OBUFAD ADD BUFFER ADDRESS 02879000
  2838. LR R15,R1 'TO' LENGTH = 'FROM' LENGTH 02880000
  2839. MVCL R14,R0 MOVE STRING 02881000
  2840. C R14,VBUFEND COMPARE WITH VARIABLE BUFFER END 02882000
  2841. BL *+8 SKIP IF LESS 02883000
  2842. ST R14,VBUFEND OTHERWISE, SET NEW VALUE 02884000
  2843. B COPSPL GO FOR NEXT SPECIFICATION 02885000
  2844. SPACE 02886000
  2845. COPSPE EQU * 02887000
  2846. NEXT 02888000
  2847. EJECT 02889000
  2848. * 'TRUNC' OPTION SPECIFIED -- REMOVE FILL CHARACTERS FROM END 02890000
  2849. $$TRUNC EQU * 02891000
  2850. L R1,VBUFEND GET BUFFER END 02892000
  2851. SPACE 02893000
  2852. TRUNCL EQU * 02894000
  2853. BCTR R1,0 BACKSPACE POINTER 02895000
  2854. C R1,OBUFAD BEGINNING OF OUTPUT BUFFER? 02896000
  2855. BE TRUNCE STOP THERE IF SO 02897000
  2856. CLC FILLC(1),0(R1) IS IT A FILL CHAR? 02898000
  2857. BE TRUNCL LOOP BACK IF NOT 02899000
  2858. SPACE 02900000
  2859. TRUNCE EQU * 02901000
  2860. LA R1,1(,R1) INCREMENT TO GET NEW VBUFEND 02902000
  2861. ST R1,VBUFEND AND STORE VALUE 02903000
  2862. NEXT 02904000
  2863. EJECT 02905000
  2864. * TRANSLATE OUTPUT BUFFER USING TRANSLATE TABLE 02906000
  2865. $$TRANS EQU * 02907000
  2866. L XR,OBUFAD GET ADDRESS OF OUTPUT BUFFER 02908000
  2867. LA R0,256 MAXIMUM NO BYTES PER TRANSLATE 02909000
  2868. L R1,VBUFEND END OF BUFFER 02910000
  2869. SR R1,XR R1 <- BUFFER LENGTH 02911000
  2870. SPACE 02912000
  2871. TRANSL EQU * 02913000
  2872. LTR R1,R1 ANYTHING LEFT TO TRANSLATE? 02914000
  2873. BZ TRANSE FINISHED IF NOT 02915000
  2874. LR R15,R1 GET LENGTH REMAINING 02916000
  2875. CR R15,R0 COMPARE WITH 256 02917000
  2876. BL *+6 SKIP IF LOWER 02918000
  2877. LR R15,R0 USE 256 (MAXIMUM) 02919000
  2878. SR R1,R15 REDUCE LENGTH REMAINING 02920000
  2879. BCTR R15,0 REDUCE FOR EX 02921000
  2880. EX R15,TRANSM TRANSLATE CHARS 02922000
  2881. AR XR,R0 INCREASE TRANSLATE TARGET ADDR 02923000
  2882. B TRANSL AND LOOP BACK 02924000
  2883. SPACE 02925000
  2884. TRANSM TR 0(0,XR),TRTAB LENGTH FILLED IN BY EX 02926000
  2885. SPACE 02927000
  2886. TRANSE EQU * 02928000
  2887. NEXT 02929000
  2888. EJECT 02930000
  2889. EJECT 02954000
  2890. * PERFORM 'PACK' OPERATION. 02955000
  2891. $$PACK EQU * 02956000
  2892. L XR,RDBUFFA POINT TO INPUT BUFFER 02957000
  2893. L R15,RDRET GET INPUT BUFFER SIZE 02958000
  2894. LA R15,0(XR,R15) POINT TO BYTE BEYOND END OF BUF 02959000
  2895. ST R15,PKBXE SAVE AS END-OF-BUFFER PTR 02960000
  2896. BCTR R15,0 SUBTRACT 2 02961000
  2897. BCTR R15,0 02962000
  2898. ST R15,PKBXE2 SAVE AS END-OF-BUFFER MINUS 2 02963000
  2899. BCTR R15,0 SUBTRACT 1 MORE 02964000
  2900. ST R15,PKBXE3 SAVE AS END-OF-BUFFER MINUS 3 02965000
  2901. BCTR R15,0 02966000
  2902. ST R15,PKBXE4 SAVE AS END-OF-BUFFER MINUS 4 02967000
  2903. SPACE 5 02968000
  2904. * MAIN RETURN POINT IN PACK LOOP, TO DECIDE WHAT TO DO NEXT. 02969000
  2905. PACKR EQU * 02970000
  2906. ST XR,PKBX SAVE CURRENT INPUT BUF POINTER 02971000
  2907. C XR,PKBXE COMPARE WITH END OF BUFFER PTR 02972000
  2908. BNL PACKE GO IF WE'VE REACHED THE END 02973000
  2909. CLC 0(1,XR),PKCC IS NEXT CHAR BLANK (FILL CHAR)? 02974000
  2910. BE PACKB GO PACK BLANKS IF SO 02975000
  2911. C XR,PKBXE2 ARE WE 2 BYTES FROM END? 02976000
  2912. BNE PACKR1 SKIP TEST IF NOT 02977000
  2913. CLC 0(1,XR),1(XR) LAST TWO BYTES OF BUF EQUAL? 02978000
  2914. BE PACKS GO PACK SPECIAL CHARS IF SO 02979000
  2915. SPACE 02980000
  2916. PACKR1 EQU * 02981000
  2917. C XR,PKBXE3 AT LEAST 3 CHARS FROM END? 02982000
  2918. BH PACKD PACK DATA IF NOT 02983000
  2919. CLC 0(2,XR),1(XR) 3 CHARS EQUAL? 02984000
  2920. BE PACKS PACK SPECIAL CHARS IF SO 02985000
  2921. SPACE 3 02986000
  2922. * COME HERE TO PACK 'DATA' -- I.E., NON-EQUAL CHARACTERS. WE MUST FIND 02987000
  2923. * THE END OF THIS DATA AREA. THIS WILL BE EITHER END OF RECORD OR 02988000
  2924. * CONSECUTIVE CHARACTERS. 02989000
  2925. PACKD EQU * 02990000
  2926. MVI PKFLAG,PKDAF SET 'DATA' FLAG 02991000
  2927. LA R14,1 INCREMENT BY 1 FOR BXLE 02992000
  2928. L R15,PKBXE2 LOOP UNTIL END OF BUF-2 02993000
  2929. BCTR XR,0 DECREMENT POINTER FOR LOOP 02994000
  2930. B PACKDLB ENTER LOOP 02995000
  2931. SPACE 02996000
  2932. CNOP 0,8 DOUBLE-WORD ALIGN FOR SPEED 02997000
  2933. PACKDL EQU * 02998000
  2934. CLC 0(1,XR),1(XR) NEXT TWO CHARS IDENTICAL? 02999000
  2935. BE PACKDLE GO IF SO 03000000
  2936. SPACE 03001000
  2937. PACKDLB EQU * 03002000
  2938. BXLE XR,R14,PACKDL LOOP THROUGH BUFFER 03003000
  2939. L XR,PKBXE POINT TO END OF BUFFER 03004000
  2940. B PACKF GO PACK DATA 03005000
  2941. SPACE 03006000
  2942. * COME HERE IF TWO EQUAL CHARACTERS ARE FOUND. 03007000
  2943. PACKDLE EQU * 03008000
  2944. CLC 0(1,XR),PKCC ARE THEY BLANKS? (FILL CHARS?) 03009000
  2945. BE PACKF GO IF YES 03010000
  2946. CLC 0(1,XR),2(XR) ARE THREE CHARS EQUAL? 03011000
  2947. BNE PACKDLB RE-ENTER LOOP IF NOT 03012000
  2948. C XR,PKBXE3 ARE THEY THE LAST 3 CHARS OF REC 03013000
  2949. BE PACKF PACK AS SPECIAL CHARS IF SO 03014000
  2950. CLC 0(1,XR),3(XR) ARE FOUR CHARS EQUAL? 03015000
  2951. BNE PACKDLB RE-ENTER SEARCH LOOP IF NOT 03016000
  2952. C XR,PKBXE4 ARE WE WITHING 4 BYTES OF END? 03017000
  2953. BH PACKDLB YES -- 4 BYTES NOT AVAILABLE 03018000
  2954. B PACKF OTHERWISE, WE STOP SCAN 03019000
  2955. SPACE 2 03020000
  2956. * COME HERE TO PACK BLANKS (FILL CHARACTERS) INTO OUTPUT BUFFER. 03021000
  2957. PACKB EQU * 03022000
  2958. MVI PKFLAG,0 SET FILL CHAR FLAGS (NONE) 03023000
  2959. B PACKBS 03024000
  2960. SPACE 03025000
  2961. * COME HERE TO PACK NON-FILL HCARACTER 03026000
  2962. PACKS EQU * 03027000
  2963. MVI PKFLAG,PKFFF+PKSCF SET 'SPECIAL CHAR' FLAG 03028000
  2964. SPACE 03029000
  2965. PACKBS EQU * 03030000
  2966. LR R14,XR COPY INPUT BUFFER POINTER 03031000
  2967. L R15,PKBXE POINT TO END OF INPUT BUFFER 03032000
  2968. SR R15,R14 GET LENGTH OF INPUT BUF REMAINNG 03033000
  2969. IC R1,0(XR) GET CHAR WE'RE LOOKING FOR 03034000
  2970. SLL R1,24 PUT INTO LEFTMOST BYTE OF R1 03035000
  2971. CLCL R14,R0 FIND FIRST NON-EQUAL CHARACTER 03036000
  2972. LR XR,R14 RESTORE POINTER TO CURRENT CHAR 03037000
  2973. SPACE 03038000
  2974. * AT THIS POINT, PACKFLAG INDICATES WHAT KIND OF SEARCH (BLANKS, 03039000
  2975. * SPECIAL CHARS, DATA) WE HAVE BEEN MAKING, AND XR POINTS TO THE END OF 03040000
  2976. * THAT FIELD. IN ADDITION, PKBX POINTS TO THE BEGINNING OF THAT FIELD. 03041000
  2977. PACKF EQU * 03042000
  2978. LR XR2,XR COPY END OF FIELD PTR 03043000
  2979. S XR2,PKBX XR2 CONTAINS LENGTH OF FIELD. 03044000
  2980. BCTR XR2,0 LENGTH OF FIELD MINUS 1 03045000
  2981. CH XR2,=AL2(PKFFF-1) CAN WE FIT LENGTH INTO FLAG BYT? 03046000
  2982. BNH *+8 SKIP IF WE CAN 03047000
  2983. OI PKFLAG,PKFFF OTHERWISE, SET SPECIAL FLAGS 03048000
  2984. CH XR2,=H'255' CAN IT FIT INTO ONE BYTE? 03049000
  2985. BNH *+8 SKIP IF IT CAN 03050000
  2986. OI PKFLAG,PKELF OTHERWISE, SET EXTRA LONG FLAG 03051000
  2987. CLI RDFV,C'F' IS INPUT FILE FIXED FORMAT? 03052000
  2988. BE PACKF1 THEN DON'T USE END OF REC FLAG 03053000
  2989. C XR,PKBXE ARE WE AT END OF RECORD? 03054000
  2990. BL PACKF1 SKIP IF WE ARE NOT 03055000
  2991. OI PKFLAG,PKFFF+PKERF ELSE, SET END OF RECORD FLAG 03056000
  2992. SPACE 03057000
  2993. PACKF1 EQU * 03058000
  2994. SPACE 03059000
  2995. * AT THIS POINT, THE FLAGS IN THE FLAG BYTE ARE DETERMINED. 03060000
  2996. TM PKFLAG,PKFFF WILL WE NEED MORE THAN 1 BYTE? 03061000
  2997. BO PACKF2 GO IF WE WILL 03062000
  2998. IC R0,PKFLAG GET FLAG BYTE 03063000
  2999. OR R0,XR2 OR IN LENGTH-1 03064000
  3000. BAL RR,PACKP1 PUT INTO PACK FILE 03065000
  3001. B PACKT AND GO FINISH PACKING FIELD 03066000
  3002. SPACE 03067000
  3003. * MORE THAN ONE BYTE WILL BE NECESSARY. 03068000
  3004. PACKF2 EQU * 03069000
  3005. IC R0,PKFLAG GET FLAG BYTE 03070000
  3006. BAL RR,PACKP1 PUT IT INTO THE PACK FILE 03071000
  3007. TM PKFLAG,PKELF EXTRA LONG FLAG SET? 03072000
  3008. BZ PACKF3 GO IF NOT 03073000
  3009. LR R0,XR2 GET LENGTH FIELD 03074000
  3010. SRL R0,8 MOVE LEFT BYTE RIGHT 1 03075000
  3011. BAL RR,PACKP1 AND PACK IT INTO OUTPUT 03076000
  3012. SPACE 03077000
  3013. PACKF3 EQU * 03078000
  3014. LR R0,XR2 GET LENGTH FIELD 03079000
  3015. BAL RR,PACKP1 PUT 2ND BYTE INTO PACK FILE 03080000
  3016. SPACE 03081000
  3017. * COME HERE WHEN THE FLAG AND LENGTH BYTE(S) HAVE BEEN PLACED INTO PACK 03082000
  3018. * FILE. AT THIS POINT, PKFLAG CONTAINS THE FLAG BYTE, XR POINTS TO 03083000
  3019. * THE BYTE BEYOND THE END OF THE FIELD, AND PKBX POINTS TO THE FIRST 03084000
  3020. * BYTE OF THE FIELD. 03085000
  3021. PACKT EQU * 03086000
  3022. LA XR2,1(,XR2) RE-INCREMENT TO GET FIELD LENGTH 03087000
  3023. TM PKFLAG,PKDAF+PKSCF FILL CHARACTER FIELD? 03088000
  3024. BZ PACKR NOTHING TO DO IF SO 03089000
  3025. TM PKFLAG,PKDAF DATA FIELD? 03090000
  3026. BO PACKTD FO IF IT IS 03091000
  3027. SPACE 03092000
  3028. * OTHERWISE, IT'S A SPECIAL CHARACTER FIELD. 03093000
  3029. LR R1,XR POINT TO END OF FIELD 03094000
  3030. BCTR R1,0 BACK UP ONE BYTE 03095000
  3031. IC R0,0(R1) GET THE SPECIAL CHAR 03096000
  3032. BAL RR,PACKP1 PUT IT INTO OUTPUT FILE 03097000
  3033. B PACKR GO INTO MAIN PACK LOOP 03098000
  3034. SPACE 2 03099000
  3035. * COME HERE TO COPY THE DATA FIELD FROM THE INPUT FILE TO THE 03100000
  3036. * PACKED FILE. 03101000
  3037. PACKTD EQU * 03102000
  3038. L R0,PKBX POINT TO BEGINNING OF FIELD 03103000
  3039. LR R1,XR2 R1 CONTAINS LENGTH OF FIELD 03104000
  3040. LM R14,R15,PACKBUF GET CURRENT ADDR/LENGTH OF REST *03105000
  3041. OF CURRENT PACK BUFFER. 03106000
  3042. LR XR3,R15 COPY LENGTH REMAINING 03107000
  3043. CR R1,R15 IS THERE ENOUGH SPACE REMAINING? 03108000
  3044. BH *+6 SKIP IF THERE IS NOT 03109000
  3045. LR R15,R1 OUTPUT LENGTH = INPUT LENGTH 03110000
  3046. SR XR3,R15 NEW LENGTH REMAINING IN PACK BF 03111000
  3047. ST XR3,PACKLEFT SAVE IT 03112000
  3048. MVCL R14,R0 MOVE DATA 03113000
  3049. ST R14,PACKBUF STORE NEW END OF PACK BUFFER 03114000
  3050. ST R0,PKBX STORE NEW CURRENT INPUT PTR 03115000
  3051. LR XR2,R1 SAVE LENGTH REMAINING TO COPY 03116000
  3052. CLC PACKLEFT,=F'0' OUTPUT BUFFER FULL? 03117000
  3053. BNE *+8 SKIP IF NOT 03118000
  3054. BAL RR,PACKW IF SO, THEN GO WRITE IT OUT. 03119000
  3055. LTR XR2,XR2 ANY MORE INPUT BUFFER TO COPY? 03120000
  3056. BZ PACKR RE-ENTER MAIN LOOP IF NOT 03121000
  3057. B PACKTD GO COPY IT IF SO 03122000
  3058. SPACE 2 03123000
  3059. * COME HERE WHEN PACKING OPERATION IS COMPLETED. 03124000
  3060. PACKE EQU * 03125000
  3061. NEXT 03126000
  3062. SPACE 5 03127000
  3063. * THE FOLLOWING SUBROUTINE PUTS ONE CHARACTER INTO THE PACK FILE BUFF. 03128000
  3064. PACKP1 EQU * 03129000
  3065. STM R14,R12,12(R13) SAVE REGISTERS 03130000
  3066. LM R14,R15,PACKBUF GET ADDR/LEN OF REST OF PACKBUF 03131000
  3067. STC R0,0(R14) STORE CHARACTER INTO PACK BUFF 03132000
  3068. LA R14,1(,R14) INCREMENT BUFFER ADDR PTR 03133000
  3069. BCTR R15,0 DECREMENT LEN REMAINING PTR 03134000
  3070. STM R14,R15,PACKBUF STORE NEW VALUES 03135000
  3071. LTR R15,R15 ANY SPACE REMAINING? 03136000
  3072. BNZ *+8 SKIP IF SO 03137000
  3073. BAL RR,PACKW IF NOT, WRITE BUFFER OUT 03138000
  3074. LM R14,R12,12(R13) RESTORE REGISTERS 03139000
  3075. BR RR RETURN TO CALLER 03140000
  3076. SPACE 5 03141000
  3077. * THE FOLLOWING SUBROUTINE WRITES OUT A RECORD OF THE PACK BUFFER. 03142000
  3078. PACKW EQU * 03143000
  3079. LH R1,WRITEM INCREMENT ITEM NUMBER 03144000
  3080. LA R1,1(,R1) 03145000
  3081. STH R1,WRITEM 03146000
  3082. LA R1,WRPLIST POINT TO WRBUF PLIST 03147000
  3083. SVC 202 WRITE OUT A RECORD 03148000
  3084. DC AL4(*+4) ERROR RETURN @VA04664 03149000
  3085. CKRW WR CHECK RETURN CODE 03150000
  3086. MVC PACKBUF,WRBUFFA RE-INITIALIZE PACKBUF 03151000
  3087. MVC PACKLEFT,=F'800' RE-INITIALIZE PACKLEN 03152000
  3088. BR RR RETURN TO CALLER 03153000
  3089. EJECT 03154000
  3090. * PERFORM UNPACK OPERATION 03155000
  3091. $$UNPACK EQU * 03156000
  3092. L R1,WRBUFFA POINT TO OUTPUT BUFFER 03157000
  3093. ST R1,PKBX INITIALIZE CURRENT POINTER 03158000
  3094. A R1,OBUFLEN ADD LENGTH OF OUTPUT BUFFER 03159000
  3095. ST R1,PKBXE SAVE AS END OF BUFFER 03160000
  3096. BAL RR,UNPAG1 GET FIRST FLAG BYTE FOR RECORD 03161000
  3097. STC R0,PKFLAG STORE AS FLAG BYTE 03162000
  3098. CLI PKFLAG,X'FF' IS IT END OF FILE FLAG? 03163000
  3099. BNE UNPAL1 GO IF IT ISN'T 03164000
  3100. PHASE EO OTHERWISE, ENTER PHASE EO 03165000
  3101. SPACE 2 03166000
  3102. * COME HERE TO GET THE NEXT FLAG BYTE FOR THE FIELD. 03167000
  3103. UNPAL EQU * 03168000
  3104. BAL RR,UNPAG1 GET NEXT FLAG BYTE 03169000
  3105. STC R0,PKFLAG STORE AS FLAG BYTE 03170000
  3106. CLI PKFLAG,X'FF' END OF FILE FLAG? 03171000
  3107. BNE *+8 SKIP IF NOT 03172000
  3108. BAL RR,ERUPX IMPOSSIBLE CONDITION IF SO 03173000
  3109. SPACE 03174000
  3110. UNPAL1 EQU * 03175000
  3111. TM PKFLAG,PKFFF IS FIELD LENGTH IN FLAG BYTE? 03176000
  3112. BO UNPAL2 GO IF IT ISN'T 03177000
  3113. LR XR2,R0 COPY FLAG BYTE 03178000
  3114. N XR2,=AL1(0,0,0,B'01111111') TURN OFF HIGH BIT FLAG 03179000
  3115. XR R0,XR2 LET R0 CONTAINS ONLY FLAGS 03180000
  3116. STC R0,PKFLAG AND STORE AS NEW FLAG BYTE 03181000
  3117. B UNPAT GO DETERMINE TYPE OF FIELD 03182000
  3118. SPACE 03183000
  3119. * COME HERE IF THE REAL LENGTH IS IN SUBSEQUENT BYTES IN PACKED FIELD. 03184000
  3120. UNPAL2 EQU * 03185000
  3121. BAL RR,UNPAG1 GET FIRST (OR ONLY) LENGTH BYTE 03186000
  3122. LR XR2,R0 COPY IT TO XR2 03187000
  3123. TM PKFLAG,PKELF IS IT AN EXTRA-LONG FIELD? 03188000
  3124. BZ UNPAT WE'RE FINISHED IF NOT 03189000
  3125. SLL XR2,8 OTHERWISE SHIFT LEFT FIRST BYTE 03190000
  3126. BAL RR,UNPAG1 GO GET SECOND BYTE FROM FILE 03191000
  3127. AR XR2,R0 AND ADD IT TO GET TOTAL LENGTH 03192000
  3128. SPACE 2 03193000
  3129. * AT THIS POINT, PKFLAG CONTAINS THE FLAGS INDICATING THE TYPE OF 03194000
  3130. * FIELD, AND XR2 CONTAINS THE LENGTH OF THE FIELD. 03195000
  3131. UNPAT EQU * 03196000
  3132. LA XR2,1(,XR2) INCREMENT XR2 TO GET REAL LENGTH 03197000
  3133. TM PKFLAG,PKDAF+PKSCF IS IT A BLANK (FILL CHAR) FIELD? 03198000
  3134. BZ UNPAB GO HANDLE IT IF IT IS 03199000
  3135. TM PKFLAG,PKDAF IS IT A DATA FIELD? 03200000
  3136. BO UNPAD GO HANDLE IT IF IT IS 03201000
  3137. TM PKFLAG,PKSCF IS IT SPECIAL (NON-FILL) CHAR? 03202000
  3138. BO UNPAS GO HANDLE IT 03203000
  3139. BAL RR,ERUPX IMPOSSIBLE CONDITION 03204000
  3140. SPACE 03205000
  3141. * THE FIELD IS BLANK (FILL CHARACTERS) 03206000
  3142. UNPAB EQU * 03207000
  3143. IC R0,PACKCHAR GET FILL CHARACTER 03208000
  3144. B UNPABS GO PROPOGATE IT 03209000
  3145. SPACE 03210000
  3146. * COME HERE IF THE FIELD IS SPECIAL CHARACTER 03211000
  3147. UNPAS EQU * 03212000
  3148. BAL RR,UNPAG1 GO GET SPECIAL CHAR FROM PACK BF 03213000
  3149. SPACE 03214000
  3150. * PROPOGATE THE CHARACTER IN R0 FOR THE LENGTH IN XR2 03215000
  3151. UNPABS EQU * 03216000
  3152. LR R1,R0 COPY OVER CHARACTER 03217000
  3153. SLL R1,24 MOVE INTO LEFT-MOST BYTE 03218000
  3154. L R14,PKBX GET CURRENT OUTBUF PTR 03219000
  3155. LR R15,XR2 GET LENGTH OF FIELD 03220000
  3156. MVCL R14,R0 PROPOGATE CHARACTER FOR FIELD 03221000
  3157. ST R14,PKBX STORE NEW FIELD PTR 03222000
  3158. B UNPALE GO FOR NEXT FIELD 03223000
  3159. SPACE 2 03224000
  3160. UNPAD EQU * 03225000
  3161. CLC PACKLEFT,=F'0' PACKED BUFFER EMPTY? 03226000
  3162. BNE *+8 SKIP IF NOT 03227000
  3163. BAL RR,UNPAR READ A RECORD IF IT IS 03228000
  3164. LM R0,R1,PACKBUF GET ADDR/LEN LEFT 03229000
  3165. L R14,PKBX CURRENT OUTPUT BUFFER PTR 03230000
  3166. LR R15,XR2 LENGTH TO BE COPIED 03231000
  3167. CR R1,R15 COMPARE LENGTHS 03232000
  3168. BH *+6 SKIP IF OUTPUT BUFFER LONG ENUF 03233000
  3169. LR R15,R1 SET LENGTHS EQUAL 03234000
  3170. SR XR2,R15 03235000
  3171. MVCL R14,R0 COPY DATA TO UNPACKED FILE 03236000
  3172. STM R0,R1,PACKBUF STORE NEW PACKED BUFFERS PTRS 03237000
  3173. ST R14,PKBX STORE NEW OUTPUT BUFFER PTR 03238000
  3174. LTR XR2,XR2 ANY MORE TO MOVE? 03239000
  3175. BP UNPAD LOOP BACK IF THERE IS 03240000
  3176. SPACE 03241000
  3177. * WE COME HERE AFTER WE'VE COPIED OVER THE FIELD. WE MAKE A TEENY 03242000
  3178. * LITTLE CHECK TO SEE IF WE'RE WIPING ANYTHING OUT. 03243000
  3179. UNPALE EQU * 03244000
  3180. L R14,PKBX CURRENT BUFFER POINTER 03245000
  3181. C R14,PKBXE BEYOND END OF BUFFER? 03246000
  3182. BNH *+8 SKIP IF NOT 03247000
  3183. BAL RR,ERUPX IMPOSSIBLE CONDITION IF SO 03248000
  3184. EJECT 03249000
  3185. * WE MUST NOW DECIDE WHETHER WE HAVE REACHED THE END OF THE END OF THE 03250000
  3186. * RECORD. IF SO, WE ARE FINISHED. IF NOT, WE RETURN TO UNPAL TO 03251000
  3187. * PROCESS THE NEXT FIELD OF THE RECORD. 03252000
  3188. * WE MAKE OUR DECISION BASED ON THREE FACTORS: 03253000
  3189. * 1. WHETHER THE OUTPUT FILE RECFM IS F OR V 03254000
  3190. * 2. WHETHER THE END-OF-RECORD FLAG IS SET IN THE LAST FLAG 03255000
  3191. * BYTE 03256000
  3192. * 3. WHETHER WE ARE AT THE END OF THE OUTPUT BUFFER. 03257000
  3193. * 03258000
  3194. * THE DECISION IS MADE ACCORDING TO THE FOLLOWING TABLE: 03259000
  3195. * 03260000
  3196. * F OR V EOR FLG END OF BUF WHERE TO GO 03261000
  3197. * ------- -------- ---------- ----------- 03262000
  3198. * F 1 NO IMPOSSIBLE 03263000
  3199. * F 1 YES IMPOSSIBLE 03264000
  3200. * F 0 NO UNPAL 03265000
  3201. * F 0 YES WE'RE THRU 03266000
  3202. * V 1 NO WE'RE THRU 03267000
  3203. * V 1 YES WE'RE THRU 03268000
  3204. * V 0 NO UNPAL 03269000
  3205. * V 0 YES IMPOSSIBLE 03270000
  3206. SPACE 03271000
  3207. SR R1,R1 03272000
  3208. C R14,PKBXE ARE WE AT END OF BUFFER? 03273000
  3209. BL *+8 SKIP IF WE ARE NOT 03274000
  3210. LA R1,1 TURN ON BIT IF SO 03275000
  3211. TM PKFLAG,PKERF END OF REC FLAG SET? 03276000
  3212. BO *+8 SKIP IF SO 03277000
  3213. LA R1,2(,R1) TURN ON BIT IF NOT 03278000
  3214. CLI WRFV,C'V' OUTPUT RECFM V? 03279000
  3215. BNE *+8 SKIP IF NOT 03280000
  3216. LA R1,4(,R1) TURN ON BIT IF SO 03281000
  3217. IC R1,UNPALT(R1) GET BRANCH BYTE 03282000
  3218. B *+4(R1) BRANCH TO ROUTINE 03283000
  3219. B UNPAN WE'RE THRU 03284000
  3220. B UNPAL GO BACK FOR NEXT FIELD 03285000
  3221. BAL RR,ERUPX IMPOSSIBLE CONDITION 03286000
  3222. SPACE 03287000
  3223. UNPALT DC FL1'8,8,4,0,0,0,4,8' 03288000
  3224. SPACE 03289000
  3225. UNPAN EQU * 03290000
  3226. MVC VBUFEND,PKBX SET VARIABLE BUFFER END 03291000
  3227. NEXT 03292000
  3228. SPACE 2 03293000
  3229. * THIS SUBROUTINE GETS ONE BYTE FROM THE PACKED INPUT BUFFER. 03294000
  3230. UNPAG1 EQU * 03295000
  3231. STM R14,R12,12(R13) SAVE REGISTERS 03296000
  3232. CLC PACKLEFT,=F'0' INPUT BUFFER EXHAUSTED? 03297000
  3233. BNE *+8 SKIP IF NOT 03298000
  3234. BAL RR,UNPAR IF SO, READ ANOTHER RECORD 03299000
  3235. LM R14,R15,PACKBUF GET BUFFER PTR/LEN 03300000
  3236. SR R0,R0 03301000
  3237. IC R0,0(R14) GET NEXT BYTE FROM BUFFER 03302000
  3238. LA R14,1(,R14) INCREMENT BUFFER POINTER 03303000
  3239. BCTR R15,0 DECREMENT BYTES LEFT 03304000
  3240. STM R14,R15,PACKBUF STORE NEW VALUES 03305000
  3241. LM R14,R15,12(R13) RESTORE REGISTERS 03306000
  3242. LM R1,R12,12+12(R13) 03307000
  3243. BR RR RETURN TO CALLER 03308000
  3244. SPACE 2 03309000
  3245. * THIS SUBROUTINE READS A PACKED INPUT RECORD. 03310000
  3246. UNPAR EQU * 03311000
  3247. LH R1,RDITEM INCREMENT ITEM NUMBER 03312000
  3248. LA R1,1(,R1) 03313000
  3249. STH R1,RDITEM 03314000
  3250. LA R1,RDPLIST POINT TO RDBUF PLIST 03315000
  3251. SVC 202 READ A RECORD 03316000
  3252. DC AL4(*+4) ERROR RETURN @VA04664 03317000
  3253. CKRW RD CHECK FOR ERROR CODE BAD 03318000
  3254. MVC PACKBUF,RDBUFFA RE-INITIALIZE BUFFER POINTER 03319000
  3255. MVC PACKLEFT,=F'800' 800 BYTES LEFT IN BUFFER 03320000
  3256. BR RR RETURN TO CALLER 03321000
  3257. EJECT 03322000
  3258. * WRITE TO OUTPUT FILE 03323000
  3259. $$WROUT EQU * 03324000
  3260. CLI WRFV,C'V' VARIABLE OUTPUT RECFM? 03325000
  3261. BNE WROUTG GO IF NOT 03326000
  3262. L R1,VBUFEND GET VARIABLE BUFFER END 03327000
  3263. S R1,OBUFAD GET LENGTH OF BUFFER 03328000
  3264. ST R1,WRBUFFS STORE IN WRBUF PLIST 03329000
  3265. SPACE 03330000
  3266. WROUTG EQU * 03331000
  3267. LH R1,WRITEM GET OUTPUT ITEM NUMBER 03332000
  3268. LA R1,1(,R1) INCREMENT 03333000
  3269. STH R1,WRITEM AND STORE 03334000
  3270. TM OPF2,OP2OVLY OVERLAY? @VA03023 03335000
  3271. BO AROUND YES, SKIP TEST @VA03023 03336000
  3272. CLI WRFV,C'V' IS OUTPUT VARIABLE? @VA03023 03337000
  3273. BE AROUND YES, SKIP TEST @VA03023 03338000
  3274. CLI RDFV,C'V' IS INPUT VARIABLE? @VA03023 03339000
  3275. BE AROUND YES, SKIP TEST @VA03023 03340000
  3276. TM RDPLIST+37,FSTITAV IS A RECORD AVAILABLE? @VA06024 03341000
  3277. BZ NEXT NO @VA03023 03342000
  3278. AROUND LA R1,WRPLIST POINT TO WRBUF PLIST @VA03023 03343000
  3279. SVC 202 03344000
  3280. DC AL4(*+4) 03345000
  3281. CKRW WR CHECK RETURN CODE 03346000
  3282. NEXT 03347000
  3283. EJECT 03348000
  3284. * FINIS INPUT FILE 03349000
  3285. $$FINI EQU * 03350000
  3286. MVC FIPLIST+8(18),RDFNAME PUT NAME IN FINIS PLIST 03351000
  3287. CLI FIPLIST+25,C'3' IS IT MODE 3? @VA03020 03352000
  3288. BNE GOFINI NO, CONTINUE @VA03020 03353000
  3289. TM OPF1,OP1OLDD HAS OLDDATE BEEN SPECIFIED? @VA03020 03354000
  3290. BZ NODATE NO, DONT GET DATE @VA07638 03355000
  3291. LA R1,FIPLIST POINT TO PLIST @VA03020 03356000
  3292. GETFST FIPLIST,ERR=FINIER GET FST FOR INPUT FILE @VA03020 03357000
  3293. USE FSTSECT,R1 @VA03020 03358000
  3294. TM OPF2,OP2MULT IN CASE OF MULT.OUTPUT FILS @VA09042 03358100
  3295. BO MULTFILE GET THE DATE FOR EACH ONE @VA09042 03358200
  3296. CLC FFSTD(4),=XL4'0' IF WE HAVE THE DATE ALREADY @VA09042 03358300
  3297. BNE NODATE DO NOT OVERLAY IT @VA09042 03358400
  3298. MULTFILE EQU * @VA09042 03358500
  3299. MVC FFSTD(4),FSTD GET DATE AND TIME @VA03020 03359000
  3300. MVC FFSTYR(2),FSTYR GET YEAR @VA03020 03360000
  3301. OI OPF3,OP3MODE3 PUT THE FLAG ON @VA03020 03361000
  3302. DROP R1 @VA03020 03362000
  3303. NODATE DS 0H @VA07638 03362075
  3304. LA XR2,CIPLIST2 POINT TO CURRENT PLIST2 @VA07638 03362150
  3305. USE PLIST2,XR2 ADDRESSABILITY @VA07638 03362225
  3306. L R15,PADT POINT TO ADT @VA07638 03362300
  3307. USE ADTSECT,R15 ADDRESSABILITY @VA07638 03362375
  3308. TM ADTFLG1,ADTFRW IS IT R/W DISK? @VA09043 03362385
  3309. BNO GOFINI IF IT IS NOT GOFINI @VA09043 03362395
  3310. L R15,ADTCFST POINT TO CURRENT FST @VA07638 03362450
  3311. SH R15,=H'40' BACK UP TO LAST ENTRY @VA07638 03362525
  3312. STCM R15,15,PHYP+4 SAVE IT @VA07638 03362600
  3313. LA XR2,FIPLIST2 POINT TO FIRST PLIST2 @VA07638 03362675
  3314. USE PLIST2,XR2 ADDRESSABILITY @VA07638 03362750
  3315. STCM R15,15,PHYP+4 SAVE IN FIRST LIST TOO @VA07638 03362825
  3316. DROP XR2 @VA07638 03362900
  3317. GOFINI LA R1,FIPLIST POINT TO FINIS PLIST @VA03020 03363000
  3318. SVC 202 03364000
  3319. DC AL4(*+4) @VA03972 03365000
  3320. NEXT 03366000
  3321. SPACE 03367000
  3322. FINIER EQU * 03368000
  3323. LA R6,FINIER FOR ERROR MESSAGE @VA08136 03368250
  3324. BAL RR,ERRWXX UNEXPECTED ERROR @VA08136 03368500
  3325. USING PHCL,CDR PHASE ADDRESSABILITY @VA08136 03368750
  3326. MVI PHCL+1,$@FINO SET CLOSE OUTPUT FILE @VA08136 03369000
  3327. MVI PHCL+2,$@EXIT SET EXIT @VA08136 03369250
  3328. DROP CDR @VA08136 03369500
  3329. NEXT CONTINUE @VA08136 03369750
  3330. EJECT 03370000
  3331. * END OF FILE ROUTINE FOR 'PACK' MODE. 03371000
  3332. $$EOPACK EQU * 03372000
  3333. LA R0,X'FF' PUT EOF BYTE INTO PACKED FILE 03373000
  3334. BAL RR,PACKP1 GO PACK IT IN 03374000
  3335. CLC PACKLEFT,=F'800' IS THE CURRENT OUTPUT REC EMPTY 03375000
  3336. BE EOPACKN NO WRITE IF SO 03376000
  3337. LH R1,WRITEM INCREMENT ITEM NUMBER 03377000
  3338. LA R1,1(,R1) 03378000
  3339. STH R1,WRITEM 03379000
  3340. LA R1,WRPLIST POINT TO OUTPUT PLIST 03380000
  3341. SVC 202 WRITE OUTPUT RECORD 03381000
  3342. DC AL4(*+4) ERROR RETURN @AV04664 03382000
  3343. CKRW WR CHECK FOR WRBUF ERROR 03383000
  3344. SPACE 03384000
  3345. EOPACKN EQU * 03385000
  3346. NEXT 03386000
  3347. EJECT 03387000
  3348. * POINT TO NEXT 'VERTICAL' FILE 03388000
  3349. $$NVPT EQU * 03389000
  3350. LA XR2,CIPLIST2 POINT TO CURRENT INPUT PLIST2 03390000
  3351. USE PLIST2,XR2 03391000
  3352. ST XR2,PPLIST2 STORE AS CURRENT PLIST2 03392000
  3353. * PLIST1 AND PLIST3 POINTERS ARE ALREADY SET. 03393000
  3354. NEXT 03394000
  3355. EJECT 03395000
  3356. * POINT TO NEXT 'HORIZONTAL' FILE 03396000
  3357. $$NHPT EQU * 03397000
  3358. LA XR2,CIPLIST2 POINT TO CURRENT INPUT PLIST2 03398000
  3359. USE PLIST2,XR2 03399000
  3360. ST XR2,PPLIST2 STORE AS CURRENT PLIST2 03400000
  3361. L XR,PPLIST1 GET PREVIOUS PLIST1 03401000
  3362. USE PLIST1,XR 03402000
  3363. LA XR,PNEXT1 MOVE UP ONE IN 'COPY' PLIST 03403000
  3364. ST XR,PPLIST1 THIS IS NEW PLIST1 03404000
  3365. L XR,PFLG POINT TO OLD FLAG BYTE 03405000
  3366. LA XR,1(,XR) POINT TO NEW FLAG BYTE 03406000
  3367. ST XR,PFLG AND STORE 03407000
  3368. CLI 0(XR),X'FF' ANY MORE 'HORIZONTAL' FILENAMES? 03408000
  3369. BE NHPTNONE NO; SKIP @VA03971 03409000
  3370. OI OPF3,OP3MORIN YES; REMEMBER IT @VA03971 03410000
  3371. CLI RC,28 CHECK IF RC=28 FILE ALREADY ACTIVE @VA13698 03410300
  3372. BE ERRACT YES, FILE ACTIVE GO CLOSE AND END @VA13698 03410600
  3373. NEXT @VA03971 03411000
  3374. NHPTNONE NI OPF3,X'FF'-OP3MORIN RESET 'MORE INPUT FILES' @VA03971 03412000
  3375. NEXT @VA03971 03413000
  3376. ERRACT EQU * ERROR, FILE ALREADY ACTIVE @VA13698 03413300
  3377. PHASE CL GO TO CLOSING PHASE FOR OUTPUT @VA13698 03413600
  3378. EJECT 03414000
  3379. * SKIP IF ANOTHER INPUT FILE EXISTS 03415000
  3380. $$SKFND TM OPF3,OP3MORIN ANY MORE INPUT FILES? @VA03971 03416000
  3381. BZ SKNFND NO; JUST KEEP GOING @VA03971 03417000
  3382. SKIP 1 @VA03971 03418000
  3383. SPACE 2 03419000
  3384. * DON'T SKIP IF THERE ARE NO MORE INPUT FILES 03420000
  3385. SKNFND NEXT @VA03971 03421000
  3386. EJECT 03422000
  3387. * SET UP FOR AND ENTER PHASE CV 03423000
  3388. $$SETCV LH R1,OVITEM GET OVERLAY FILE ITEM NUMBER @VA03971 03424000
  3389. BCTR R1,R0 DECREMENT IT BY 1 @VA03971 03425000
  3390. STH R1,OVITEM BECAUSE WE HAVE TO READ IT AGAIN @VA03971 03426000
  3391. OI OPF3,OP3PHCV 'PHASE CV BEING EXECUTED' @VA03971 03427000
  3392. PHASE CV ENTER PHASE CV @VA03971 03428000
  3393. EJECT 03429000
  3394. * IF THERE IS AN OVERLAY FILE, WE MUST BACKSPACE IT IF WE ARE TO 03430000
  3395. * READ AN ADDITIONAL INPUT FILE. 03431000
  3396. $$OVBK EQU * 03432000
  3397. LH R1,OVITEM GET OVERLAY FILE ITEM NUMBER 03433000
  3398. BCTR R1,0 DECREMENT 03434000
  3399. STH R1,OVITEM AND STORE 03435000
  3400. NEXT 03436000
  3401. EJECT 03437000
  3402. * WE CHECK TO SEE IF ANY RECORDS HAVE BEEN COPIED TO THE OUTPUT 03438000
  3403. * FILE AT ALL 03439000
  3404. $$CKOR EQU * 03440000
  3405. CLC WRITEM,OFREC HAS OUTPUT ITEM # CHANGED? 03441000
  3406. BE ERNRO ERROR IF HAS NOT 03442000
  3407. NEXT 03443000
  3408. EJECT 03444000
  3409. * FINIS OUTPUT FILE 03445000
  3410. $$FINO EQU * 03446000
  3411. CLI RC,X'00' DO WE HAVE A RET.CODE ALREADY? @VA09493 03446015
  3412. BH NOSECMSG IF YES DON'T GIVE HIM 2ND MSG.. @VA09493 03446030
  3413. SLR R0,R0 ZERO FOR ACT LKP @VA08136 03446050
  3414. LA R1,WRPLIST POINT TO WRITE PLIST @VA08136 03446100
  3415. L R15,AACTLKP ACT LKP POINTER @VA08136 03446150
  3416. BALR R14,R15 CALL LKP @VA08136 03446200
  3417. BNZ NOAFT ERROR ON RETURN @VA08136 03446250
  3418. LR XR,R1 R1 RETURNS AFT POINTER @VA08136 03446300
  3419. USING AFTSECT,XR AFT ADDRESSABILITY @VA08136 03446350
  3420. LH XR2,WRITEM ITEM NUMBER IN WRITE PLIST @VA08136 03446400
  3421. DMSEXS STH,XR2,AFTIC STORE INTO AFT ENTRY @VA08136 03446450
  3422. DROP XR IN SYSTEM STATUS @VA08136 03446500
  3423. NOSECMSG EQU * @VA09493 03446750
  3424. MVC FIPLIST+8(18),WRFNAME MOVE FILE NAME INTO FINIS PLIST 03447000
  3425. LA R1,FIPLIST POINT TO FINIS PLIST 03448000
  3426. SVC 202 03449000
  3427. DC AL4(NOFILE) @VA04736 03450000
  3428. NEXT 03451000
  3429. SPACE 3 @VA04736 03452000
  3430. NOFILE EQU * @VA04736 03453000
  3431. SR R15,R15 CLEAR A REGISTER @VA04736 03454000
  3432. STH R15,WRITEM INDICATE NO OUTPUT FILE @VA04736 03455000
  3433. B NEXT @VA04736 03456000
  3434. SPACE 2 @VA08136 03456100
  3435. NOAFT EQU * @VA08136 03456200
  3436. CLC WRITEM,OFREC OUTPUT ITEM NUMBER CHANGE @VA09884 03456230
  3437. BE ERNRO ERROR - NO FILE @VA09884 03456260
  3438. LA R6,NOAFT FOR ERROR MESSAGE @VA08136 03456300
  3439. BAL RR,ERRWXX UNEXPECTED ERROR @VA08136 03456400
  3440. USING PHCL,CDR PHASE ADDRESSABILITY @VA08136 03456500
  3441. MVI PHCL+1,$@EXIT SET EXIT @VA08136 03456600
  3442. DROP CDR @VA08136 03456700
  3443. NEXT CONTINUE @VA08136 03456800
  3444. EJECT 03457000
  3445. * FINIS OVERLAY FILE 03458000
  3446. $$FINV EQU * 03459000
  3447. MVC FIPLIST+8(18),OVFNAME MOVE NAME INTO FINIS PLIST 03460000
  3448. LA R1,FIPLIST POINT TO FINIS PLIST 03461000
  3449. SVC 202 03462000
  3450. DC AL4(FINVER) 03463000
  3451. NEXT 03464000
  3452. SPACE 03465000
  3453. FINVER EQU * 03466000
  3454. BAL RR,ERRWX UNEXPECTED ERROR 03467000
  3455. EJECT 03468000
  3456. * ERASE OUTPUT FILE 03469000
  3457. $$ERASEO EQU * 03470000
  3458. * COPY NAME INTO 'ERASE' PLIST 03471000
  3459. MVC ERPLIST+8(18),OUPLIST2+PNA2-PLIST2 03472000
  3460. LA R1,ERPLIST POINT TO ERASE PLIST 03473000
  3461. SVC 202 03474000
  3462. DC AL4(*+4) 03475000
  3463. NEXT 03476000
  3464. EJECT 03477000
  3465. * FOR 'OLDDATE' OPTION, COPY DATE AND YEAR FROM FST FOR FIRST INPUT 03478000
  3466. * FILE INTO FST FOR OUTPUT FILE. 03479000
  3467. $$SDATE EQU * 03480000
  3468. SPACE 03481000
  3469. * WRPLIST POINTS TO 'COPYFILE CMSUT' FOR REPLACE, OVLY, OR NEWFILE, 03482000
  3470. * AND THE OUTPUT FILE NAME OTHERWISE. 03483000
  3471. GETFST WRPLIST,ERR=SDATER GET FST FOR OUTPUT FILE 03484000
  3472. USE FSTSECT,R1 03485000
  3473. L XR,FIPLIST2+PFST-PLIST2 POINT TO FST FOR 1ST INPUT FILE 03486000
  3474. DMSKEY NUCLEUS GET NUCLEUS STORAGE KEY 03487000
  3475. TM FMO+1,X'F3' FILE MODE OF 3? @VA09042 03488100
  3476. BNO SDAT NO,DON'T USE SAVE AREA @VA09042 03488200
  3477. MVC FSTD(4),FFSTD GET ORIGINAL DATE AND TIME @VA03020 03490000
  3478. MVC FSTYR(2),FFSTYR GET ORIGINAL YEAR @VA03020 03491000
  3479. B RESET GO RESET THE KEY @VA03020 03492000
  3480. SDAT MVC FSTD,FSTD-FSTSECT(XR) COPY DATE @VA03020 03493000
  3481. MVC FSTYR,FSTYR-FSTSECT(XR) COPY YEAR 03494000
  3482. RESET EQU * @VA03020 03495000
  3483. DMSKEY RESET RESET PSW KEY 03496000
  3484. NEXT 03497000
  3485. SPACE 03498000
  3486. * IF ERROR, WE CHANGE THE WRPLIST OP FIELD FOR THE ERROR MESSAGE. 03499000
  3487. SDATER EQU * 03500000
  3488. LA R1,WRPLIST POINT TO PLIST 03501000
  3489. MVC 0(8,R1),=CL8'FSTLKP' CHANGE FOR ERROR MESSAGE 03502000
  3490. BAL RR,ERRWX GO TYPE ERROR MESSAGE 03503000
  3491. EJECT 03504000
  3492. * RENAME TEMP NAME TO NEW NAME 03505000
  3493. $$RENAME EQU * 03506000
  3494. SR R15,R15 CLEAR REGISTER @VA04736 03507000
  3495. CH R15,WRITEM IS THERE AN OUTPUT FILE? @VA04736 03508000
  3496. BE NEXT BRANCH IF NOT @VA04736 03509000
  3497. MVC RNPLIST+8(24),WRFNAME COPY TEMP NAME INTO RENAME PLIST 03510000
  3498. * COPY REAL NAME INTO RENAME PLIST 03511000
  3499. MVC RNPLIST+32(18),OUPLIST2+PNA2-PLIST2 03512000
  3500. LA R1,RNPLIST POINT TO RENAME PLIST 03513000
  3501. SVC 202 03514000
  3502. DC AL4(RENAMEE) 03515000
  3503. NEXT 03516000
  3504. SPACE 03517000
  3505. RENAMEE EQU * 03518000
  3506. BAL RR,ERRWX UNEXPECTED ERROR 03519000
  3507. $$EXIT EQU * 03520000
  3508. EXIT EQU * 03521000
  3509. L R0,BUFLEN GET I/O BUFFER LENGTH 03522000
  3510. L R1,BUFAD GET I/O BUFFER ADDRESS 03523000
  3511. LTR R1,R1 WAS AN I/O BUFFER ALLOCATED? 03524000
  3512. BZ EXITF DON'T FREEMAIN IF NOT 03525000
  3513. FREEMAIN R,LV=(0),A=(1) FREEMAIN BUFFER 03526000
  3514. SPACE 03527000
  3515. EXITF EQU * 03528000
  3516. L R13,SAVE13 RESTORE REG 13 03529000
  3517. SR XR,XR 03530000
  3518. IC XR,RC GET RETURN CODE 03531000
  3519. IC R5,DOSF GET SAVED DOSFLAGS @V305066 03532000
  3520. LR R1,WR POINT TO WORK SPACE 03533000
  3521. FREEMAIN R,LV=8*WORKLEN,A=(1) FREEMAIN WORK SPACE 03534000
  3522. LR R15,XR GET RETURN CODE 03535000
  3523. SPACE 03536000
  3524. * IF WE PUT 255 AS THE RETURN CODE, THEN WE REALLY MEANT 256. 03537000
  3525. CH R15,=H'255' IS IT 255 03538000
  3526. BNE *+8 SKIP IF NOT 03539000
  3527. LA R15,256 RESET IT TO 256 IF SO 03540000
  3528. LR XR,R15 SAVE R15 FOR LATER @VM03042 03541000
  3529. DMSKEY NUCLEUS @V305066 03542000
  3530. OI MISFLAGS,RELPAGES EXECUTE WITH SYSTEM KEY @V305066 03543000
  3531. STC R5,DOSFLAGS STORE BACK IN NUCON @V305066 03544000
  3532. DMSKEY RESET @V305066 03545000
  3533. LR R15,XR RESTORE RETURN CODE @VM03042 03546000
  3534. RETURN (14,12),RC=(15) 03547000
  3535. * GETNUM SUBROUTINE. 03548000
  3536. * THE SUBROUTINE IS USED TO CONVERT AN INPUTTED DECIMAL TO 03549000
  3537. * INTERNAL FORM. 03550000
  3538. GETNUM EQU * 03551000
  3539. LA RR,0(,RR) INDICATE MAIN ENTRY POINT 03552000
  3540. SPACE 03553000
  3541. GETNUMC EQU * 03554000
  3542. MVC STEMP(8),0(XR2) COPY FIELD 03555000
  3543. MVI STEMP+8,C'X' FORCE CONVERSION ERROR ON 9TH CH 03556000
  3544. STM 14,1,0(R13) SAVE REGS 03557000
  3545. SR R14,R14 03558000
  3546. SR R15,R15 03559000
  3547. LA R1,STEMP-1 CHAR POINTER REG 03560000
  3548. SPACE 03561000
  3549. GT1 EQU * 03562000
  3550. LA R1,1(,R1) POINT TO NEXT CHAR 03563000
  3551. CLI 0(R1),C' ' BLANK? 03564000
  3552. BE GTE 03565000
  3553. CLI 0(R1),C'0' NUMERIC? 03566000
  3554. BL GTER ERROR IF NOT 03567000
  3555. CLI 0(R1),C'9' 03568000
  3556. BH GTER 03569000
  3557. IC R15,0(R1) GET CHAR 03570000
  3558. SH R15,=AL2(C'0') DISPLACE TO 0 03571000
  3559. MH R14,=H'10' SHIFT RESULT SO FAR LEFT 1 DIGIT 03572000
  3560. AR R14,R15 ADD IN NEW DIGIT 03573000
  3561. B GT1 LOOP BACK 03574000
  3562. SPACE 03575000
  3563. GTE EQU * 03576000
  3564. LTR R1,R14 GET NUMBER 03577000
  3565. LM R14,R15,0(R13) RESTORE REGS 03578000
  3566. BZ GTER ZERO IS ILLEGAL 03579000
  3567. BR RR RETURN FROM SUBROUTINE 03580000
  3568. SPACE 2 03581000
  3569. * THE FOLLOWING ENTRY POINT IS TAKEN FROM THE 'SPECS' SPECIFICATIONS 03582000
  3570. * HANDLING ROUTINE. 03583000
  3571. GETNUMS EQU * 03584000
  3572. O RR,=AL1(X'80',0,0,0) INDICATE GETNUMS ENTRY 03585000
  3573. B GETNUMC 03586000
  3574. SPACE 2 03587000
  3575. * ERROR ENCOUNTERED 03588000
  3576. GTER EQU * 03589000
  3577. LTR RR,RR WHICH ENTRY? 03590000
  3578. BM ERILS USE 'SPECS' ERROR MESSAGE 03591000
  3579. B ERARG SUB-PARAM ERROR MESSAGE 03592000
  3580. EJECT 03593000
  3581. * GETNAME SUBROUTINE. 03594000
  3582. * THIS SUBROUTINE IS USED TO FORM AN OPTION NAME FROM AN OPTION 03595000
  3583. * CODE, SO THAT THE NAME CAN APPEAR IN AN ERROR MESSAGE. 03596000
  3584. GETNAME EQU * 03597000
  3585. N R1,=A(X'FF') GET OPTION BYTE 03598000
  3586. MH R1,=AL2(OPSLEN) MULTIPLY BY LENGTH OF OPTAB 03599000
  3587. LA R1,OPTAB(R1) POINT TO NAME IN OPTAB 03600000
  3588. BR RR RETURN 03601000
  3589. SPACE 4 03602000
  3590. * GETHEX SUBROUTINE. THIS SUBROUTINE TAKES TWO BYTE HEX INPUT AND 03603000
  3591. * CONVERTS IT TO INTERNAL FORM, RETURNING THE VALUE IN R1. 03604000
  3592. * UPON ENTERING, XR2 POINTS TO THE TWO BYTE FIELD. THE ROUTINE GIVES 03605000
  3593. * A NON-JUMP RETURN IF THERE IS AN ERROR, AND A JUMP RETURN IF THERE 03606000
  3594. * IS NOT. 03607000
  3595. GETHEX EQU * 03608000
  3596. MVC STEMP(2),0(XR2) COPY THE TWO-BYTE FIELD 03609000
  3597. TR STEMP(2),GETHEXT TRANSLATE THE NUMBER 03610000
  3598. CLI STEMP,X'FF' FIRST CHAR ILLEGAL? 03611000
  3599. BCR 8,RR (BER) ERROR RETURN IF SO 03612000
  3600. CLI STEMP+1,X'FF' SECOND CHAR ILLEGAL? 03613000
  3601. BCR 8,RR (BER) ERROR RETURN IF SO 03614000
  3602. SR R0,R0 03615000
  3603. SR R1,R1 03616000
  3604. IC R0,STEMP GET FIRST CHAR VALUE 03617000
  3605. IC R1,STEMP+1 GET SECOND CHAR VALUE 03618000
  3606. SLL R0,4 SHIFT FIRST CHAR VAL LEFT 03619000
  3607. AR R1,R0 COMBINE THE TWO 03620000
  3608. B 4(RR) AND GIVE JUMP RETURN 03621000
  3609. SPACE 03622000
  3610. * GETHEX TRANSLATE TABLE 03623000
  3611. GETHEXT DC 256X'FF' MOSTLY ILLEGAL CHARS 03624000
  3612. ORG GETHEXT+C'0' 03625000
  3613. DC AL1(0,1,2,3,4,5,6,7,8,9) SET NUMERIC DIGITS 03626000
  3614. ORG GETHEXT+C'A' 03627000
  3615. DC AL1(10,11,12,13,14,15) SET CAPITAL LETTERS 03628000
  3616. ORG GETHEXT+X'81' 03629000
  3617. DC AL1(10,11,12,13,14,15) SET SMALL LETTERS 03630000
  3618. ORG 03631000
  3619. * INFORMATIONAL MESSAGES 03632000
  3620. SPRI EQU * 03633000
  3621. DMSERR NUM=601,LET=R,TEXT='ENTER SPECIFICATION LIST:',DOT=NO 03634000
  3622. B SPR1 03635000
  3623. SPACE 3 03636000
  3624. * WARNING: THE NEXT TWO MESSAGES HAVE THE SAME MESSAGE NUMBER. 03637000
  3625. FNTYPEIO EQU * 03638000
  3626. DMSERR NUM=721,LET=I,MF=(E,ERLIST), *03639000
  3627. SUB=(CHAR8A,RDFNAME,CHARA,(XR2), *03640000
  3628. CHAR8A,OUPLIST2+PNA2-PLIST2,CHARA,(R14)), *03641000
  3629. TEXT='COPY ''....................'' ........ ''.........*03642000
  3630. ...........'' (... FILE)' 03643000
  3631. NEXT 03644000
  3632. SPACE 3 03645000
  3633. * WARNING: THIS MESSAGE HAS THE SAME NUMBER AS THE PRECEDING MESSAGE. 03646000
  3634. FNTYPENI EQU * 03647000
  3635. DMSERR NUM=721,LET=I,SUB=(CHAR8A,RDFNAME), *03648000
  3636. TEXT='COPY ''....................''' 03649000
  3637. NEXT 03650000
  3638. SPACE 3 03651000
  3639. SPACE 3 03657000
  3640. RTRI EQU * 03658000
  3641. DMSERR NUM=602,LET=R,TEXT='ENTER TRANSLATION LIST:',DOT=NO 03659000
  3642. B RTR1 03660000
  3643. EJECT 03661000
  3644. * ERROR MESSAGES 03662000
  3645. ERILO EQU * 03663000
  3646. LA XR,STEMP 03664000
  3647. DMSERR NUM=3,LET=E,SUB=(CHARA,(XR)), *03665000
  3648. TEXT='INVALID OPTION ''........''' 03666000
  3649. MVI RC,24 03667000
  3650. B EXIT 03668000
  3651. SPACE 3 03669000
  3652. ERNOIN EQU * 03670000
  3653. DMSERR NUM=42,LET=E,TEXT='NO FILEID(S) SPECIFIED' 03671000
  3654. MVI RC,24 03672000
  3655. B EXIT 03673000
  3656. SPACE 3 03674000
  3657. ERDISK EQU * 03675000
  3658. L XR,PPLIST2 POINT TO PLIST2 03676000
  3659. USE PLIST2,XR 03677000
  3660. LA XR,PMO2 POINT TO FILE MODE 03678000
  3661. DMSERR NUM=37,LET=E,SUB=(CHARA,(XR)), *03679000
  3662. TEXT='DISK ''..'' IS READ/ONLY' 03680000
  3663. MVI RC,36 03681000
  3664. B EXIT 03682000
  3665. SPACE 3 03683000
  3666. ERNX EQU * 03684000
  3667. L XR,PPLIST2 POINT TO PLIST2 03685000
  3668. USE PLIST2,XR 03686000
  3669. L XR,PPLIST3 POINT TO PLIST3 03687000
  3670. USE PLIST3,XR 03688000
  3671. LA XR,PNA3 POINT TO FILE NAME 03689000
  3672. DMSERR NUM=24,LET=E,SUB=(CHAR8A,(XR)), *03690000
  3673. TEXT='FILE ''....................'' ALREADY EXISTS -- SP*03691000
  3674. ECIFY ''REPLACE''' 03692000
  3675. MVI RC,28 03693000
  3676. B EXIT 03694000
  3677. SPACE 3 03695000
  3678. ERRWX EQU * 03696000
  3679. LR R6,RR FOR ERROR MESSAGE @VA08136 03696250
  3680. LA RR,ERRWXEND NO RETURN @VA08136 03696500
  3681. ERRWXX EQU * WILL RETURN ON RR @VA08136 03696750
  3682. LR XR,R1 PLIST POINTERS 03697000
  3683. LR XR2,R15 03698000
  3684. DMSERR NUM=901,LET=T,MF=(E,ERLIST), *03699000
  3685. SUB=(HEX,(R6),CHAR8A,(XR),HEX,(XR),HEX,(BR),DEC,(XR2)), *03700000
  3686. TEXT='UNEXPECTED ERROR AT ......: PLIST ''..............*03701000
  3687. ...............'' AT ......, BASE: ......, RC ........' 03702000
  3688. MVI RC,255 03703000
  3689. BR RR RETURN OR CONTINUE @VA08136 03703300
  3690. ERRWXEND EQU * CONTINUE @VA08136 03703600
  3691. USING PHCL,CDR FORCE ADDRESSABILITY @VA05996 03704000
  3692. MVI PHCL+1,$@FINI SET CLOSE INPUT FILE @VA05996 03705000
  3693. MVI PHCL+2,$@FINO SET CLOSE OUTPUT FILE @VA06125 03706000
  3694. MVI PHCL+3,$@EXIT SET BRANCH TO EXIT @VA06125 03707000
  3695. DROP CDR FREE THE REGISTER @VA05996 03708000
  3696. B NEXT GO TO HANDLE THE ABORT @VA05996 03709000
  3697. SPACE 3 03710000
  3698. ERACT EQU * 03711000
  3699. L XR,PPLIST2 POINT TO PLIST2 03712000
  3700. USE PLIST2,XR 03713000
  3701. L XR,PPLIST3 POINT TO PLIST3 03714000
  3702. USE PLIST3,XR 03715000
  3703. LA XR,PNA3 POINT TO FILENAME 03716000
  3704. USE ,XR 03717000
  3705. DMSERR NUM=30,LET=E,SUB=(CHAR8A,(XR)), @VA12493*03718000
  3706. TEXT='FILE ''....................'' ALREADY ACTIVE' 03719000
  3707. MVI RC,28 03720000
  3708. PHASE EO @VA04736 03721000
  3709. SPACE 3 03722000
  3710. * XR -> 'INPUT' OR 'OVERLAY' 03723000
  3711. ERROR36 EQU * @VA09572 03723150
  3712. LA R5,24(R1) POINT TO MODE LETTER @VA09572 03723300
  3713. DMSERR TEXT='DISK ''..'' NOT ACCESSED',NUM=69, X03723450
  3714. LET=E,SUB=(CHARA,((R5),1)),TYPCALL=SVC @VA09572 03723600
  3715. MVI RC,36 GIVE RETCODE @VA09572 03723750
  3716. B EXIT @VA09572 03723900
  3717. ERNF EQU * 03724000
  3718. L XR2,PPLIST2 POINT TO PLIST2 03725000
  3719. USE PLIST2,XR2 03726000
  3720. LA XR2,PNA2 POINT TO FILENAME 03727000
  3721. DMSERR NUM=2,LET=E,MF=(E,ERLIST), *03728000
  3722. SUB=(CHARA,(XR),CHAR8A,(XR2)), *03729000
  3723. TEXT='........ FILE ''....................'' NOT FOUND' 03730000
  3724. MVI RC,28 03731000
  3725. B EXIT 03732000
  3726. SPACE 3 03733000
  3727. ERSPECSX EQU * 03734000
  3728. DMSERR NUM=101,LET=S,SUB=(CHARA,(XR2)), *03735000
  3729. TEXT='''SPECS'' TEMP STRING STORAGE EXHAUSTED AT ''.....*03736000
  3730. ...''' 03737000
  3731. MVI RC,88 03738000
  3732. B EXIT 03739000
  3733. SPACE 3 03740000
  3734. ERTMI EQU * 03741000
  3735. DMSERR NUM=102,LET=S,TEXT='TOO MANY FILEIDS' 03742000
  3736. MVI RC,88 RETURN CODE = 88 P1091 03743000
  3737. B EXIT 03744000
  3738. SPACE 3 03745000
  3739. * ILLEGAL ASTERISK IN INPUT FILEID OTHER THAN THE FIRST (MULTIPLE MODE) 03746000
  3740. ERMST EQU * 03747000
  3741. LA R1,=C'*' POINT TO AN ASTERISK 03748000
  3742. SPACE 03749000
  3743. * ILLEGAL CHARACTER CAUGHT BY TRT. R1 POINTS TO THE CHAR. 03750000
  3744. ERILC EQU * 03751000
  3745. USE PLIST1,XR2 03752000
  3746. LR XR,R1 POINT TO ILLEGAL CHARACTER 03753000
  3747. CLI 0(XR),X'FF' IS THE ILLEGAL CHAR X'FF'? 03754000
  3748. BE ERIFI INCOMPLETE FILEID IF SO 03755000
  3749. CLI 0(XR),C'(' IS THE ILLEGAL CHAR C'(' 03756000
  3750. BE ERIFI INCOMPLETE FILEID IF SO 03757000
  3751. DMSERR NUM=62,LET=E,MF=(E,ERLIST), *03758000
  3752. SUB=(CHARA,((XR),1),CHAR8A,PNA1), *03759000
  3753. TEXT='INVALID CHAR ''..'' IN FILEID ''..................*03760000
  3754. ..''' 03761000
  3755. MVI RC,20 RETURN CODE = 20 P0767 03762000
  3756. B EXIT 03763000
  3757. SPACE 3 03764000
  3758. * FILEID CONTAINS A X'FF' OR C'(' -- INCOMPLETE FILEID SPECIFIED 03765000
  3759. ERIFI EQU * 03766000
  3760. DMSERR NUM=54,LET=E, @VM03248*03767000
  3761. TEXT='INCOMPLETE FILEID SPECIFIED' @VM03248 03768000
  3762. MVI RC,24 03769000
  3763. B EXIT 03770000
  3764. SPACE 3 03771000
  3765. * NULL SPECIFICATION LIST ENTERED 03772000
  3766. ERNS EQU * 03773000
  3767. LA XR2,=CL13'SPECIFICATION' 03774000
  3768. B ERNST 03775000
  3769. SPACE 03776000
  3770. * NULL TRANSLATION LIST ENTERED 03777000
  3771. ERNT EQU * 03778000
  3772. LA XR2,=CL13'TRANSLATION' 03779000
  3773. SPACE 03780000
  3774. ERNST EQU * 03781000
  3775. DMSERR NUM=63,LET=E,SUB=(CHARA,(XR2)), *03782000
  3776. TEXT='NO ............. LIST ENTERED' 03783000
  3777. MVI RC,40 RETURN CODE = 40 P1091 03784000
  3778. B EXIT 03785000
  3779. SPACE 3 03786000
  3780. ERTMS EQU * 03787000
  3781. DMSERR NUM=103,LET=S, P1091*03788000
  3782. TEXT='NUMBER OF SPECS EXCEEDS MAX .....', P1091*03789000
  3783. SUB=(DEC,MAXSPECS) 03790000
  3784. MVI RC,88 03791000
  3785. B EXIT 03792000
  3786. SPACE 3 03793000
  3787. * ILLEGAL SPECIFICATION 03794000
  3788. ERILS EQU * 03795000
  3789. LA XR,BLANKS SUBSTITUTE BLANK FIELD 03796000
  3790. B ERITS 03797000
  3791. SPACE 03798000
  3792. * INVALID TRANSLATION SPECIFICATION 03799000
  3793. ERTRS EQU * 03800000
  3794. LA XR,=C'TRANSLATION' SUBSTITUTE 'TRANSLATION' 03801000
  3795. SPACE 03802000
  3796. ERITS EQU * 03803000
  3797. DMSERR NUM=64,LET=E,MF=(E,ERLIST), *03804000
  3798. SUB=(CHARA,(XR),CHARA,(XR2)), *03805000
  3799. TEXT='INVALID ........... SPECIFICATION AT OR NEAR ''...*03806000
  3800. .....''' 03807000
  3801. MVI RC,24 03808000
  3802. B EXIT 03809000
  3803. SPACE 3 03810000
  3804. ERDOP EQU * 03811000
  3805. LR R1,R0 GET OPTION CODE 03812000
  3806. BAL RR,GETNAME GET OPTION NAME 03813000
  3807. LR XR,R1 XR -> OPTION NAME 03814000
  3808. DMSERR NUM=65,LET=E,SUB=(CHARA,(XR)), *03815000
  3809. TEXT='''........'' OPTION SPECIFIED TWICE' 03816000
  3810. MVI RC,24 03817000
  3811. B EXIT 03818000
  3812. SPACE 3 03819000
  3813. ERCONF EQU * 03820000
  3814. LR R1,R0 GET OPTION BYTE 03821000
  3815. BAL RR,GETNAME GET OPTION NAME 03822000
  3816. LR XR,R1 SAVE POINTER TO OPTION NAME 03823000
  3817. LR R1,R0 GET SECOND OPTION NAME 03824000
  3818. SRL R1,8 03825000
  3819. BAL RR,GETNAME GET SECOND OPTION NAME 03826000
  3820. LR XR2,R1 SAVE PTR TO 2ND OPTION NAME 03827000
  3821. DMSERR NUM=66,LET=E,MF=(E,ERLIST), *03828000
  3822. SUB=(CHARA,(XR),CHARA,(XR2)), *03829000
  3823. TEXT='''........'' AND ''........'' ARE CONFLICTING OPTI*03830000
  3824. ONS' 03831000
  3825. MVI RC,24 03832000
  3826. B EXIT 03833000
  3827. SPACE 3 03834000
  3828. * XR2 POINTS TO ILLEGAL SUB-PARAMETER 03835000
  3829. ERARG EQU * 03836000
  3830. LH R15,NOPS 03837000
  3831. SR R1,R1 03838000
  3832. IC R1,OPBYTES-1(R15) GET OPTION BYTE FOR LAST OPTION 03839000
  3833. BAL RR,GETNAME GET OPTION NAME 03840000
  3834. LR XR,R1 POINT TO LAST OPTION NAME 03841000
  3835. DMSERR NUM=29,LET=E,MF=(E,ERLIST), *03842000
  3836. SUB=(CHARA,(XR2),CHARA,(XR)), *03843000
  3837. TEXT='INVALID PARAMETER ''........'' IN THE ''........''*03844000
  3838. OPTION FIELD' 03845000
  3839. MVI RC,24 03846000
  3840. B EXIT 03847000
  3841. SPACE 3 03848000
  3842. ERUNX EQU * 03849000
  3843. LR XR,R15 SAVE PHASE CODE 03850000
  3844. DMSERR NUM=903,LET=T,SUB=(HEX,(XR)), *03851000
  3845. TEXT='IMPOSSIBLE PHASE CODE ''..''' 03852000
  3846. MVI RC,255 03853000
  3847. B EXIT 03854000
  3848. SPACE 3 03855000
  3849. ERGUP EQU * 03856000
  3850. DMSERR NUM=67,LET=E, *03857000
  3851. TEXT='COMBINED INPUT FILES ILLEGAL WITH PACK OR UNPACK O*03858000
  3852. PTIONS' 03859000
  3853. MVI RC,24 03860000
  3854. B EXIT 03861000
  3855. SPACE 3 03862000
  3856. ERUPX EQU * 03863000
  3857. DMSERR NUM=904,LET=T,SUB=(HEX,(RR),HEX,(BR)),MF=(E,ERLIST), *03864000
  3858. TEXT='UNEXPECTED UNPACK ERROR AT ......, BASE ......' 03865000
  3859. MVI RC,255 03866000
  3860. B EXIT 03867000
  3861. SPACE 03868000
  3862. ERILP EQU * 03869000
  3863. LA XR,RDFNAME POINT TO INPUT FILE NAME 03870000
  3864. DMSERR NUM=68,LET=E,SUB=(CHAR8A,(XR)), *03871000
  3865. TEXT='INPUT FILE ''....................'' NOT IN PACKED *03872000
  3866. FORMAT' 03873000
  3867. MVI RC,32 03874000
  3868. B EXIT 03875000
  3869. SPACE 3 03876000
  3870. * 'FROM' NUMBER IS NOT IN FILE. XR -> FST FOR FILE. 03877000
  3871. ERNFN EQU * 03878000
  3872. USE FSTSECT,XR 03879000
  3873. LH XR,FSTIC GET NUMBER OF ITEMS IN FILE 03880000
  3874. N XR,=A(X'FFFF') AVOID NEGATIVE RESULT OF LH 03881000
  3875. DMSERR NUM=156,LET=E,MF=(E,ERLIST), *03882000
  3876. TEXT='''FROM ........'' NOT FOUND -- FILE ''............*03883000
  3877. ........'' HAS ONLY ''........'' RECORDS', *03884000
  3878. SUB=(DECA,FROMN,CHAR8A,RDFNAME,DEC,(XR)) 03885000
  3879. MVI RC,32 03886000
  3880. B EXIT 03887000
  3881. SPACE 3 03888000
  3882. * 'FRLABEL' LABEL NOT FOUND 03889000
  3883. ERNFL EQU * 03890000
  3884. DMSERR NUM=157,LET=E,MF=(E,ERLIST), *03891000
  3885. SUB=(CHAR8A,FRL,CHAR8A,RDFNAME), *03892000
  3886. TEXT='LABEL ''........'' NOT FOUND IN FILE ''...........*03893000
  3887. .........''' 03894000
  3888. MVI RC,32 03895000
  3889. PHASE EO @VA04736 03896000
  3890. SPACE 3 03897000
  3891. ERFM EQU * 03898000
  3892. USE PLIST1,XR2 03899000
  3893. DMSERR NUM=48,LET=E,TEXT='INVALID MODE ''........''', *03900000
  3894. SUB=(CHARA,PMO1) 03901000
  3895. MVI RC,24 03902000
  3896. B EXIT 03903000
  3897. SPACE 3 03904000
  3898. ERNRO EQU * 03905000
  3899. DMSERR NUM=173,LET=E,SUB=(CHAR8A,OUPLIST2+PNA2-PLIST2), *03906000
  3900. TEXT='NO RECORDS WERE COPIED TO OUTPUT FILE ''..........*03907000
  3901. ..........''' 03908000
  3902. MVI RC,40 03909000
  3903. B EXIT 03910000
  3904. SPACE 3 03911000
  3905. ERLAE EQU * 03912000
  3906. LA XR,=C'EQUALS' 03913000
  3907. LA XR2,6 LENGTH OF 'EQUALS' 03914000
  3908. B ERLAC 03915000
  3909. SPACE 03916000
  3910. ERLAS EQU * 03917000
  3911. LA XR,=C'IS AN INITIAL SUBSTRING OF' 03918000
  3912. LA XR2,26 LENGTH OF 'IS AN INIT... OF' 03919000
  3913. SPACE 03920000
  3914. ERLAC EQU * 03921000
  3915. DMSERR NUM=172,LET=E,MF=(E,ERLIST), *03922000
  3916. SUB=(CHARA,TOL,CHARA,((XR),(XR2)),CHARA,FRL), *03923000
  3917. TEXT='TOLABEL ''........'' .......................... FR*03924000
  3918. LABEL ''........''' 03925000
  3919. MVI RC,24 03926000
  3920. B EXIT 03927000
  3921. * RDBUF/WRBUF RETURN CODE BRANCHES 03928000
  3922. RDBYTES DC X'00',8X'04',X'08',2X'04',X'0C',10X'04' 03929000
  3923. WRBYTES DC X'00',8X'04',X'08',15X'04' 03930000
  3924. * CODE VALUES 03931000
  3925. * 00 = NORMAL RETURN 03932000
  3926. * 04 = UNEXPECTED RETURN CODE 03933000
  3927. * 08 = FILE ALREADY ACTIVE FOR WRITE/READ 03934000
  3928. * 0C = EOF FOR RDBUF 03935000
  3929. SPACE 3 03936000
  3930. BLANKS DC CL20' ' BLANK AREA 03937000
  3931. INPUT DC CL8'INPUT' @VA07488 03937100
  3932. EJECT 03938000
  3933. LTORG 03939000
  3934. * FILE STATUS BLOCK 03940000
  3935. FSTB 03941000
  3936. EJECT 03942000
  3937. * ACTIVE DISK TABLE 03943000
  3938. ADT 03944000
  3939. * CMS NUCLEUS ROUTINES 03945000
  3940. NUCON 03946000
  3941. AFT @VA08136 03946500
  3942. END 03947000