Table of Contents

DMSRNE Source

References

Source Listing

DMSRNE.ASSEMBLE.txt
  1. RNE TITLE 'DMSRNE (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00003000
  4. * MODULE NAME 00004000
  5. * 00005000
  6. * DMSRNE 00006000
  7. * 00007000
  8. * FUNCTION 00008000
  9. * 00009000
  10. * PROVIDE INTERFACE BETWEEN CMS EDITOR AND TSO'S 00010000
  11. * ICDQRNMS ROUTINE. DMSRNE AND ICDQRNMS GENMODED 00011000
  12. * TOGHETER AS 'RENUM' MODULE, WILL RENUMBER ANY 00012000
  13. * VSBASIC OR FREEFORT SOURCE PROGRAM CURRENTLY 00013000
  14. * BEING EDITED. 00014000
  15. * 00015000
  16. * ATTRIBUTES 00016000
  17. * 00017000
  18. * SERIALLY REUSEABLE 00018000
  19. * TRANSIENT MODULE 00019000
  20. * DISK RESIDENT 00020000
  21. * NOTE: RENUM MUST BE GENMOD'D WITH THE SYSTEM OPTION 00020100
  22. * 00021000
  23. * ENTRY POINTS 00022000
  24. * 00023000
  25. * DMSRNE 00024000
  26. * 00025000
  27. * ENTRY CONDITIONS 00026000
  28. * 00027000
  29. * R1 = PARAMETER LIST 00028000
  30. * 00029000
  31. * DC CL8'RENUM' COMMAND 00030000
  32. * DC CL8'FTYPE' FILETYPE ( VSBASIC OR FREEFORT ) 00031000
  33. * DC CL8'FMODE' FILEMODE 00032000
  34. * DS F STRTNO 00033000
  35. * DS F INCRNO 00034000
  36. * DS F AINCORE 00035000
  37. * DS F FSIZE 00036000
  38. * 00037000
  39. * PARAMETERS 00038000
  40. * 00039000
  41. * STRTNO - STARTING SEQ. NUMBER ( DEFAULTS TO 10 ) 00040000
  42. * INCRNO - INCREMENT AMOUNT ( DEFAULTS TO STRTNO ) 00041000
  43. * AINCORE - ADDRESS EDITED INCORE FILE 00042000
  44. * FSIZE - ITEM LENGTH OF EDITED FILE 00043000
  45. * 00044000
  46. * EXIT CONDITIONS 00045000
  47. * 00046000
  48. * RETURN TO CALLER WITH RETURN CODE IN R15 00047000
  49. * 00048000
  50. * RETURN CODES: 00049000
  51. * 00050000
  52. * 0 AND 100 00051000
  53. * 00052000
  54. * MESSAGES: 00053000
  55. * 00054000
  56. * - WRONG FILE FORMAT FOR RENUM 00055000
  57. * - SET NEW FILEMODE AND RETRY 00056000
  58. * - MAXIMUM LINE NUMBER EXCEEEDED 00057000
  59. * - VSBASIC STATEMENT OVERFLOW 00058000
  60. * - INVALID SYNTAX IN VSBASIC STATEMENT 00059000
  61. * - INVALID LINE NUMBER REFERENCE 00060000
  62. * - STATEMENT REFERENCED NOT FOUND 00061000
  63. * - ERROR READING/WRITING TO DISK 00062000
  64. * 00063000
  65. * CALLS TO OTHER ROUTINES 00064000
  66. * 00065000
  67. * DMSERS, DMSLADW, DMSBWR, DMSBRD, DMSFNS, 00066000
  68. * AND ICDQRNMS ( TSO'S CONVERT ) 00067000
  69. * 00068000
  70. * EXTERNAL REFERENCES 00069000
  71. * 00070000
  72. * NUCON 00071000
  73. * 00072000
  74. * TABLES/WORK AREAS 00073000
  75. * 00074000
  76. * INTERNAL 00075000
  77. * 00076000
  78. * REGISTER USAGE 00077000
  79. * 00078000
  80. * R0 NUCON ADDRESSABILITY 00079000
  81. * R1 COMMAND ADDRESS 00080000
  82. * R2 WORK 00081000
  83. * R3 WORK AND INCORE COPY ADDRESS 00082000
  84. * R4 WORK 00083000
  85. * R5 WORK 00084000
  86. * R6 WORK 00085000
  87. * R7 WORK 00086000
  88. * R8 WORK 00087000
  89. * R9 WORK 00088000
  90. * R10 INTERNAL LINKAGE 00089000
  91. * R11 WORK 00090000
  92. * R12 RENUM ADDRESSABILITY 00091000
  93. * R13 SAVE AREA ADDRESS 00092000
  94. * R14 EXTERNAL LINKAGE 00093000
  95. * R15 ADDRESS LINKING ROUTINE 00094000
  96. * 00095000
  97. * OPERATION 00096000
  98. * 00097000
  99. * 1. SET UP NECESSARY ADDRESSABILITIES AND SAVE 00098000
  100. * THE EDITOR'S REGISTERS. 00099000
  101. * 00100000
  102. * 2. ENSURE THE FILETYPE IS VSBASIC OR FREEFORT 00101000
  103. * AND SAVE THE STRTNO, INCRNO, AINCORE AND FSIZE. 00102000
  104. * 00103000
  105. * 3. COMPUTE THE SIZE OF THE NUMBER TABLE AND INITIA- 00104000
  106. * LIZE THE WRBUF PLIST (WORK FILE). 00105000
  107. * 00106000
  108. * 4. VERIFY THAT THE DISK ORIGIN OF THE INPUT FILE 00107000
  109. * IS A READ/WRITE DISK (FOR VSBASIC FILES ONLY). 00108000
  110. * 00109000
  111. * 5. ACQUIRE THE NUMBER TABLE FORM FREE STORAGE, AND 00110000
  112. * INITIALIZE THE TABLE WITH THE OLD NUMBERS BY CON- 00111000
  113. * VERTING TO BINARY THE SEQUENCE NUMBER OF EACH RECORD 00112000
  114. * IN THE FILE. 00113000
  115. * 00114000
  116. * 6. ONCE THE OLD NUMBERS HAVE BEEN CONVERTED, THE 00115000
  117. * NEW NUMBERS ARE COMPUTED FROM THE STRTNO AND INCRNO 00116000
  118. * SPECIFIED BY THE USER, AND THE TABLE IS INITIALIZED 00117000
  119. * WITH THE COMPUTED NEW NUMBERS. IF PROCESSING A FREE 00118000
  120. * FORT FILE, SKIP TO STEP 10. 00119000
  121. * 00120000
  122. * 7. ONCE THE NUMBER TABLE IS BUILT, A RECORD IS 00121000
  123. * OBTAINED ( ONE AT A TIME ) AND A CALL IS MADE 00122000
  124. * TO ICDQRNMS TO CONVERT THE LINE USING THE NUMBER 00123000
  125. * TABLE PASSED AS A PARAMETER. ICDQRNMS WILL RETURN 00124000
  126. * THE UPDATED RECORD IN AN OUTPUT BUFFER, AND ANY 00125000
  127. * ERROR CONDITION FOUND IS DETECTED BY CHECKING A 00126000
  128. * RETURN CODE IN THE RNMSRC FIELD OF THE ICDQRNMS 00127000
  129. * PLIST. THE UPDATED RECORD IS WRITTEN TO A WORK FILE 00128000
  130. * WITH THE FILEID 'RENUM CMSUT1 FM'. 00129000
  131. * 00130000
  132. * 8. WHEN ALL RECORDS HAVE BEEN RENUMBERED, THE OUTPUT 00131000
  133. * FILE IS CLOSED. 00132000
  134. * 00133000
  135. * 9. NOW, THE WORK FILE IS READ AND THE INCORE COPY IS 00134000
  136. * UPDATED TO CONTAIN THE RENUMBERED FILE. THEN THE 00135000
  137. * WORK FILE IS ERASED AND CONTROL RETURNS TO EDIT. 00136000
  138. * 00137000
  139. * 10. IF RENUMBERING A FREEFORT FILE, COLUMNS 1 THRU 00138000
  140. * 8, OF EACH RECORD IN THE INCORE COPY, ARE UPDATED 00139000
  141. * TO THE NEW LINE NUMBERS COMPUTED IN STEP 6. 00140000
  142. * THE UPDATE IS DONE IN-PLACE AND CONTROL RETURNS 00141000
  143. * TO EDIT. 00142000
  144. *. 00143000
  145. EJECT 00144000
  146. *********************************************************************** 00145000
  147. * 00146000
  148. * ADDRESSABILITY AND REGISTER SAVE 00147000
  149. * 00148000
  150. *********************************************************************** 00149000
  151. SPACE 00150000
  152. DMSRNE CSECT @V242801 00151000
  153. USING NUCON,R0 NUCON ADDRESSABILITY @V242801 00152000
  154. USING DMSRNE,R15 TEMP. ADDRESSABILITY @V242801 00153000
  155. STM R0,R14,SAVREGS SAVE ALL REGISTERS @V242801 00154000
  156. DROP R15 @V242801 00155000
  157. USING DMSRNE,R12 RENUM ADDRESSABILITY @V242801 00156000
  158. LR R12,R15 LOAD BASE REGISTER @V242801 00157000
  159. XC RCODE,RCODE CLEAR RETURN CODE @V242801 00158000
  160. XC RNMSW,RNMSW CLEAR INTERNAL FLAGS @V242801 00159000
  161. MVC MAXNO,VBMAX SET DEFAULT TO VSBASIC'S @V242801 00160000
  162. EJECT 00161000
  163. *********************************************************************** 00162000
  164. * 00163000
  165. * CHECK THE FILETYPE AND SAVE THE PARAMETERS 00164000
  166. * 00165000
  167. *********************************************************************** 00166000
  168. SPACE 00167000
  169. LA R3,8(,R1) POINT TO THE FILETYPE @V242801 00168000
  170. CLC VSBASIC,0(R3) VSBASIC FILETYPE SPECIFIED ? @V242801 00169000
  171. BE FTYPEOK YES..LOOKS OK @V242801 00170000
  172. CLC FREEFORT,0(R3) FREEFORT FILETYPE SPECIFIED ? @V242801 00171000
  173. BNE ERR1 NO..ERROR @V242801 00172000
  174. OI RNMSW,FFORT SET FREEFORT FLAG @V242801 00173000
  175. MVC MAXNO,FFMAX SET MAXNO TO FREEFORT'S @V242801 00174000
  176. FTYPEOK LA R3,8(,R3) BUMP TO FILEMODE @V242801 00175000
  177. MVC FMODE,0(R3) FILEMODE TO PLIST @V242801 00176000
  178. LA R3,4(,R3) BUMP TO PARAMETERS @V242801 00177000
  179. LM R4,R7,0(R3) GET STRT/INCR/AINCORE/FSIZE @V242801 00178000
  180. STM R4,R6,STRTNO SAVE STRT/INCR/AINCORE @V242801 00179000
  181. ST R7,FSIZE AND THE RECORD LENGTH @V242801 00180000
  182. LTR R6,R6 ANY RECORDS INCORE ? @V242801 00181000
  183. BZ END NO..NULL FILE..JUST RETURN @V242801 00182000
  184. LA R2,1 INITIALIZE RECORD COUNT @V242801 00183000
  185. CHKNOIT L R6,0(,R6) POINT TO NEXT RECORD @V242801 00184000
  186. LTR R6,R6 DOES IT EXISTS ? @V242801 00185000
  187. BZ TABLEN NO..THIS IS IT THEN @V242801 00186000
  188. LA R2,1(,R2) UP COUNT BY ONE @V242801 00187000
  189. B CHKNOIT KEEP COUNTING @V242801 00188000
  190. EJECT 00189000
  191. *********************************************************************** 00190000
  192. * 00191000
  193. * SET-UP THE NUMBER TABLE LENGTH AND INITIALIZE 00192000
  194. * THE ICDQRNMS OUTPTR FIELD 00193000
  195. * 00194000
  196. *********************************************************************** 00195000
  197. SPACE 00196000
  198. TABLEN LA R2,1(,R2) PLUS ONE FOR NUMBER TABLE @V242801 00197000
  199. SLL R2,3 GET SIZE IN BINARY @V242801 00198000
  200. ST R2,LNUMTAB SAVE AS NUM TABLE LENGTH @V242801 00199000
  201. TM RNMSW,FFORT PROCESSING FREEFORT FILE ? @V242801 00200000
  202. BO GETNUMT YES..BRANCH THEN @V242801 00201000
  203. LA R2,OUTBUFF GET OUTPUT BUFFER ADDR @V242801 00202000
  204. ST R2,FBUFF SAVE IN WRBUF PLIST @V242801 00203000
  205. LA R2,5(,R2) BUMP PAST SEQ. NUMBER @V242801 00204000
  206. ST R2,OUTPTR SAVE AS RNMS OUTPUT BUFFER @V242801 00205000
  207. SPACE 00206000
  208. *********************************************************************** 00207000
  209. * 00208000
  210. * VERIFY THE DISK ORIGIN IS READ/WRITE 00209000
  211. * 00210000
  212. *********************************************************************** 00211000
  213. SPACE 00212000
  214. LA R1,FMODE-24 GET ADTLKW PLIST @V242801 00213000
  215. L R15,VCADTLKW GET ADTLKW ADDRESS @VM03093 00214100
  216. BALR R14,R15 CHECK IF R/W DISK @V242801 00215000
  217. BC 2,ERR2 DISK ORIGIN NOT R/W @V242801 00216000
  218. EJECT 00217000
  219. *********************************************************************** 00218000
  220. * 00219000
  221. * ACQUIRE THE NUMBER TABLE. TABLE SIZE IS A D-WORD 00220000
  222. * FOR EACH RECORD. 1ST WORD TO CONTAIN THE CURRENT 00221000
  223. * LINE NUMBER, SECOND WORD TO CONTAIN THE NEW LINE 00222000
  224. * NUMBER. THE INPUT FILE IS READ 'TILL EOF AND THE 00223000
  225. * FIRST 5 CHAR. ARE ASSUMED TO BE THE LINE NUMBER. 00224000
  226. * 00225000
  227. *********************************************************************** 00226000
  228. SPACE 00227000
  229. GETNUMT L R0,LNUMTAB GET NUMBER TABLE SIZE @V242801 00228000
  230. SRL R0,3 SIZE IN DBLE. WORDS @V242801 00229000
  231. DMSFREE DWORDS=(0),TYPE=USER @V242801 00230000
  232. ST R1,ANUMTAB SAVE NUMBER TABLE ADDR @V242801 00231000
  233. OI RNMSW,TABGOT REMEMBER TABLE ACQUIRED @V242801 00232000
  234. XC 4(4,R1),4(R1) ZERO 2ND WORD IN TABLE @V242801 00233000
  235. L R0,LNUMTAB GET TABLE LENGTH @V242801 00234000
  236. SH R0,H8 TABLE SIZE LESS 8 BYTES @V242801 00235000
  237. ST R0,0(R1) SAVE AS REAL TABLE LENGTH @V242801 00236000
  238. LH R5,H5 GET SEQ. NUM LEN (VSBASIC) @V242801 00237000
  239. TM RNMSW,FFORT PROCESSING FREEFORT FILE ? @V242801 00238000
  240. BZ SAVLEN NO..USE LEN IN R5 @V242801 00239000
  241. LH R5,H8 SEQ. NUM LEN FOR FREEFORT @V242801 00240000
  242. SAVLEN STH R5,SEQLEN SAVE THE SEQ. NUM LEN @V242801 00241000
  243. LA R2,8(,R1) POINT TO FIRST ENTRY @V242801 00242000
  244. L R3,AINCORE GET INCORE FILE ADDRESS @V242801 00243000
  245. LOOP BAL R10,GETREC GO GET A RECORD @V242801 00244000
  246. B ITISEOF EOF EXIT FROM GETREC @V242801 00245000
  247. LA R1,INBUFF GET BUFFER ADDRESS @V242801 00246000
  248. LH R5,SEQLEN GET NUMBER LENGTH @V242801 00247000
  249. LOOP1 CLI 0(R1),BLANK IS DIGIT A BLANK ? @V242801 00248000
  250. BE DIGITOK YES..BRANCH THEN @V242801 00249000
  251. CLI 0(R1),X'F0' IS DIGIT LESS THAN ZERO ? @V242801 00250000
  252. BL ERR1 YES..ERROR @V242801 00251000
  253. CLI 0(R1),X'F9' IS DIGIT OVER NINE ? @V242801 00252000
  254. BH ERR1 YES..ERROR @V242801 00253000
  255. DIGITOK LA R1,1(,R1) BUMP TO NEXT DIGIT @V242801 00254000
  256. BCT R5,LOOP1 CHECK ALL DIGITS @V242801 00255000
  257. LA R1,INBUFF GET BUFFER ADDRESS @V242801 00256000
  258. LH R5,SEQLEN GET NUMBER LENGTH @V242801 00257000
  259. BCTR R5,0 LESS 1 FOR EXECUTE @V242801 00258000
  260. EX R5,OC MAKE ALL BLANKS ZEROS @V242801 00259000
  261. EX R5,PACK PACK THE LINE NUMBER @V242801 00260000
  262. CVB R1,WORK NOW, CONVERT TO BINARY @V242801 00261000
  263. ST R1,0(,R2) SAVE IN OLD LIST @V242801 00262000
  264. LA R2,8(,R2) BUMP LIST TO NEXT ENTRY @V242801 00263000
  265. B LOOP KEEP READING 'TILL EOF @V242801 00264000
  266. EJECT 00265000
  267. *********************************************************************** 00266000
  268. * 00267000
  269. * THE NEW NUMBERS ARE COMPUTED AND THE NUMBER 00268000
  270. * TABLE IS INITIALIZED WITH THE NEW NUMBERS 00269000
  271. * 00270000
  272. *********************************************************************** 00271000
  273. SPACE 00272000
  274. ITISEOF L R2,LNUMTAB GET NUMBER TABLE LENGTH @V242801 00273000
  275. SRL R2,3 COMPUTE DOBLE. WORDS @V242801 00274000
  276. BCTR R2,0 LESS ONE (TABLE HEADER) @V242801 00275000
  277. L R1,ANUMTAB GET NUMBER TABLE ADDRESS @V242801 00276000
  278. LA R1,12(,R1) POINT TO FIRST ENTRY @V242801 00277000
  279. LM R3,R4,STRTNO GET START LINE NO. @V242801 00278000
  280. LOOP2 C R3,MAXNO EXCEEDS MAX ALLOWED ? @V242801 00279000
  281. BH ERR3 YES..ERROR @V242801 00280000
  282. ST R3,0(,R1) SAVE AS NEW LINE NUMBER @V242801 00281000
  283. AR R3,R4 UP LINE NUMBER BY INCR @V242801 00282000
  284. LA R1,8(,R1) BUMP TABLE TO NEXT ENTRY @V242801 00283000
  285. BCT R2,LOOP2 LOOP 'TILL TABLE DONE @V242801 00284000
  286. TM RNMSW,FFORT PROCESSING FREEFORT FILE ? @V242801 00285000
  287. BO RENFREE YES..GO RENUMBER FILE @V242801 00286000
  288. LA R1,INBUFF GET ADDRESS INPUT BUFFER @V242801 00287000
  289. LA R1,5(,R1) BUMP PAST SEQ. NUMBER @V242801 00288000
  290. ST R1,INPTR SAVE AS RNMS INPUT BUFFER @V242801 00289000
  291. MVC ERSFILE(18),FNAME SET UP ERASE FILEID @V242801 00290000
  292. LA R1,ERASE GET ERASE PLIST @V242801 00291000
  293. L R15,AERASE ERASE @V305066 00292000
  294. BALR R14,R15 (IF ANY) @V305066 00292100
  295. L R2,ANUMTAB GET NUMBER TABLE ADDR @V242801 00294000
  296. LA R2,8(,R2) POINT TO 1ST ENTRY @V242801 00295000
  297. L R3,AINCORE GET INCORE COPY ADDRESS @V242801 00296000
  298. EJECT 00297000
  299. *********************************************************************** 00298000
  300. * 00299000
  301. * THE INPUT FILE IS READ ONE RECORD AT A TIME. RNMS IS 00300000
  302. * CALLED TO CONVERT THE RECORD (USING THE NUMBER TABLE) 00301000
  303. * AND THE UPDATED RECORD IS WRITTEN TO DISK. 00302000
  304. * 00303000
  305. *********************************************************************** 00304000
  306. SPACE 00305000
  307. LOOP3 BAL R10,GETREC GO GET A RECORD @V242801 00306000
  308. B RETURN EOF EXIT FROM GETREC @V242801 00307000
  309. L R4,FSIZE GET RECORD LENGTH @V242801 00308000
  310. SH R4,H5 LESS LINE NUMBER LENGTH @V242801 00309000
  311. ST R4,INLEN SAVE FOR RNMS USE @V242801 00310000
  312. LA R5,OUTBUFF+5 POINT TO RNMS OUTPUT BUFFER @V242801 00311000
  313. MVI 0(R5),BLANK PREPARE TO BLANK @V242801 00312000
  314. EX R4,MVC1 BLANK ENOUGH FOR THIS LRECL @V242801 00313000
  315. BAL R10,CALLRNMS GO CONVERT THIS LINE @V242801 00314000
  316. L R5,OUTLEN GET OUTPUT REC LENGTH @V242801 00315000
  317. LA R5,5(,R5) ADD LINE NUMBER LENGTH @V242801 00316000
  318. C R5,FSIZE IS THERE OVERFLOW ? @V242801 00317000
  319. BNH RECOK NO..BRANCH @V242801 00318000
  320. L R2,0(,R2) GET STMNT NUMBER IN ERROR @V242801 00319000
  321. B ERR4 GIVE ERROR MSG @V242801 00320000
  322. RECOK L R5,4(,R2) GET NEW LINE NUMBER @V242801 00321000
  323. CVD R5,WORK CONVERT IT @V242801 00322000
  324. UNPK OUTBUFF(5),WORK UNPACK IT @V242801 00323000
  325. OI OUTBUFF+4,X'F0' SET ZONE @V242801 00324000
  326. LA R5,OUTBUFF GET OUPUT BUFFER ADDR @V242801 00325000
  327. LOOP4 CLI 0(R5),X'F0' IS DIGIT ZERO ? @V242801 00326000
  328. BNE WRITEIT NO..LEADING ZEROS BLANK @V242801 00327000
  329. NI 0(R5),X'4F' MAKE ZERO A BLANK @V242801 00328000
  330. LA R5,1(,R5) BUMP TO NEXT DIGIT @V242801 00329000
  331. B LOOP4 KEEP LOOKING @V242801 00330000
  332. WRITEIT LA R1,PLIST GET WRBUF PLIST @V242801 00331000
  333. L R15,AWRBUF GET WRBUF ADDRESS @V242801 00332000
  334. BALR R14,R15 GO TO IT @V242801 00333000
  335. BNZ ERR104W BRANCH IF ERROR @V242801 00334000
  336. LA R2,8(,R2) BUMP TO NEXT ENTRY @V242801 00335000
  337. B LOOP3 KEEP LOOPING 'TILL EOF @V242801 00336000
  338. EJECT 00337000
  339. *********************************************************************** 00338000
  340. * 00339000
  341. * CLOSE THE WORK FILE AND RELEASE THE NUMBER TABLE FROM 00340000
  342. * FREE STORAGE. IF RENUMBERING A VSBASIC FILE, THE WORK 00341000
  343. * FILE IS READ AND THE INCORE COPY OF THE FILE IS UPDA- 00342000
  344. * TED. THEN THE WORK FILE IS ERASED AND CONTROL RETURNS 00343000
  345. * TO THE EDITOR. 00344000
  346. * 00345000
  347. *********************************************************************** 00346000
  348. SPACE 00347000
  349. RETURN LA R1,PLIST GET FINIS PLIST @V242801 00348000
  350. L R15,AFINIS FINIS @V305066 00349000
  351. BALR R14,R15 ... @V305066 00349100
  352. RETURN2 TM RNMSW,TABGOT HAS NUM TABLE BEEN ACQUIRED ? @V242801 00351000
  353. BZ END NO..JUST GET OUT @V242801 00352000
  354. L R0,LNUMTAB GET SIZE NUMBER TABLE @V242801 00353000
  355. SRL R0,3 IN DOBLE. WORDS @V242801 00354000
  356. L R1,ANUMTAB GET NUMBER TABLE ADDRESS @V242801 00355000
  357. DMSFRET DWORDS=(0),LOC=(1) @V242801 00356000
  358. TM RNMSW,FFORT PROCESSING FREEFORT FILE ? @V242801 00357000
  359. BO END YES..JUST GET OUT @V242801 00358000
  360. L R15,RCODE GET POSSIBLE ERROR CODE @V242801 00359000
  361. LTR R15,R15 ANY FOUND ? @V242801 00360000
  362. BNZ ERSOUT YES..ERASE OUTPUT FILE @V242801 00361000
  363. L R2,AINCORE GET POINTER TO INCORE FILE @V242801 00362000
  364. L R3,FSIZE GET LRECL @V242801 00363000
  365. BCTR R3,0 LESS 1 FOR LATER EXECUTE @V242801 00364000
  366. READNEW LA R1,PLIST GET RDBUF PLIST @V242801 00365000
  367. L R15,ARDBUF GET RDBUF ADDRESS @V242801 00366000
  368. BALR R14,R15 GO READ A RECORD @V242801 00367000
  369. BNZ CHKEOF POSSIBLE ERROR OR EOF @V242801 00368000
  370. EX R3,MOVEUP MOVE RECORD TO INCORE @V242801 00369000
  371. L R2,0(,R2) BUMP TO NEXT LOCATION @V242801 00370000
  372. B READNEW READ 'TILL EOF @V242801 00371000
  373. CHKEOF CH R15,EOF IS IT END-OF-FILE ? @V242801 00372000
  374. BNE ERR104R NO..MUST BE OTHER ERROR @V242801 00373000
  375. ERSOUT LA R1,ERASE GET ERASE PLIST @V242801 00374000
  376. L R15,AERASE ERASE @V305066 00375000
  377. BALR R14,R15 ... @V305066 00375100
  378. END L R15,RCODE GET ERROR CODE @V242801 00377000
  379. LM R0,R14,SAVREGS RESTORE ALL REGS @V242801 00378000
  380. BR R14 RETURN TO CALLER @V242801 00379000
  381. EJECT 00380000
  382. *********************************************************************** 00381000
  383. * 00382000
  384. * CONVERT STMNT NUMBERS TO EBCDIC (FOR ERROR MSGS) 00383000
  385. * 00384000
  386. *********************************************************************** 00385000
  387. SPACE 00386000
  388. CONVERT LA R4,8 PREPARE TO BLANK @V242801 00387000
  389. LA R5,OUTBUFF SOME OF WORK AREA @V242801 00388000
  390. MVI 0(R5),BLANK TO LEFT JUSTIFY @V242801 00389000
  391. EX R4,MVC1 THE CONVERTED NUMBER. @V242801 00390000
  392. CVD R2,WORK NOW CONVERT THE NUMBER @V242801 00391000
  393. UNPK OUTBUFF(5),WORK AND UNPACK IT @V242801 00392000
  394. OI OUTBUFF+4,X'F0' SET ZONE LAST DIGIT @V242801 00393000
  395. LOOP5 CLI 0(R5),X'F0' CHECK FOR 1ST. NON-ZERO @V242801 00394000
  396. BNER R10 RETURN IF SO @V242801 00395000
  397. LA R5,1(,R5) BUMP TO NEXT DIGIT @V242801 00396000
  398. B LOOP5 KEEP LOOKING @V242801 00397000
  399. SPACE 00398000
  400. *********************************************************************** 00399000
  401. * 00400000
  402. * READ A RECORD FROM CORE INTO INBUFF 00401000
  403. * 00402000
  404. *********************************************************************** 00403000
  405. SPACE 00404000
  406. GETREC LTR R3,R3 ANYTHING LEFT @V242801 00405000
  407. BZR R10 NO..THAT IS ALL @V242801 00406000
  408. L R4,FSIZE GET RECORD LENGTH @V242801 00407000
  409. BCTR R4,0 LESS 1 FOR EXECUTE @V242801 00408000
  410. EX R4,MVEDOWN MOVE INCORE REC TO BUFFER @V242801 00409000
  411. L R3,0(,R3) POINT TO NEXT REC @V242801 00410000
  412. B 4(,R10) RETURN @V242801 00411000
  413. EJECT 00412000
  414. *********************************************************************** 00413000
  415. * 00414000
  416. * ROUTINE TO CALL RNMS - CONVERT VSBASIC SOURCE 00415000
  417. * 00416000
  418. *********************************************************************** 00417000
  419. SPACE 00418000
  420. CALLRNMS L R15,ARNMS GET RNMS ADDRESS @V242801 00419000
  421. LA R13,RNMSAV GET SAVE AREA ADDR @V242801 00420000
  422. LA R1,A1RNMSPL GET RNMS PLIST ADDR/ADDR @V242801 00421000
  423. BALR R14,R15 GO TO CONVERT LINE @V242801 00422000
  424. L R5,RNMSRC GET RETURN CODE @V242801 00423000
  425. LTR R5,R5 ANY ERRORS ? @V242801 00424000
  426. CALLOK BZR R10 NO..RETURN @V242801 00425000
  427. L R2,0(,R2) GET STMNT NUMBER IN ERROR @V242801 00426000
  428. B RNMSERR(R5) GO TO SPECIFIED ERROR MSG @V242801 00427000
  429. RNMSERR B CALLOK JUST IN CASE @V242801 00428000
  430. B ERR5 RETURN CODE = 4 @V242801 00429000
  431. B ERR4 RETURN CODE = 8 @V242801 00430000
  432. B ERR5 RETURN CODE = 12 @V242801 00431000
  433. B ERR6 RETURN CODE = 16 @V242801 00432000
  434. B ERR7 RETURN CODE = 20 @V242801 00433000
  435. SPACE 00434000
  436. *********************************************************************** 00435000
  437. * 00436000
  438. * ROUTINE TO RENUMBER AND UPDATE THE INCORE COPY 00437000
  439. * OF THE FREEFORT FILE. 00438000
  440. * 00439000
  441. *********************************************************************** 00440000
  442. SPACE 00441000
  443. RENFREE L R3,AINCORE GET INCORE COPY ADDRESS @V242801 00442000
  444. LM R4,R5,STRTNO GET STRTNO/INCRNO VALUES @V242801 00443000
  445. LOOP6 CVD R4,WORK CONVERT NUMBER @V242801 00444000
  446. UNPK 8(8,R3),WORK UNPACK IT @V242801 00445000
  447. OI 15(R3),X'F0' SET ZONE LAST DIGIT @V242801 00446000
  448. L R3,0(,R3) BUMP TO NEXT RECORD @V242801 00447000
  449. LTR R3,R3 IS THIS IT ? @V242801 00448000
  450. BZ RETURN2 YES..JUST GET OUT @V242801 00449000
  451. AR R4,R5 COMPUTE NEXT SEQ. NUMBER @V242801 00450000
  452. B LOOP6 KEEP LOOPING 'TILL DONE @V242801 00451000
  453. EJECT 00452000
  454. *********************************************************************** 00453000
  455. * 00454000
  456. * ERROR MESSAGES 00455000
  457. * 00456000
  458. *********************************************************************** 00457000
  459. SPACE 00458000
  460. ERR1 LA R15,ERR1LST GET ERROR LIST ADDRESS @V242801 00459000
  461. ST R15,RCODE SAVE AS RETURN CODE @V242801 00460000
  462. B RETURN2 EXIT @V242801 00461000
  463. * 00462000
  464. ERR2 LA R15,ERR2LST GET ERROR LIST ADDRESS @V242801 00463000
  465. ST R15,RCODE SAVE AS RETURN CODE @V242801 00464000
  466. B END EXIT @V242801 00465000
  467. * 00466000
  468. ERR3 LA R15,ERR3LST GET ERROR LIST ADDRESS @V242801 00467000
  469. ERREXIT ST R15,RCODE SAVE AS RETURN CODE @V242801 00468000
  470. B RETURN EXIT @V242801 00469000
  471. * 00470000
  472. ERR4 LA R15,ERR4LST GET ERROR LIST ADDRESS @V242801 00471000
  473. ST R15,RCODE SAVE AS RETURN CODE @V242801 00472000
  474. BAL R10,CONVERT CONVERT THE STMNT NUMBER @V242801 00473000
  475. MVC ERR4SUB,0(R5) MOVE TO MSG AS SUB. @V242801 00474000
  476. B RETURN EXIT @V242801 00475000
  477. * 00476000
  478. ERR5 LA R15,ERR5LST GET ERROR LIST ADDRESS @V242801 00477000
  479. ST R15,RCODE SAVE AS RETURN CODE @V242801 00478000
  480. BAL R10,CONVERT CONVERT THE STMNT NUMBER @V242801 00479000
  481. MVC ERR5SUB,0(R5) MOVE TO MSG AS SUB. @V242801 00480000
  482. B RETURN EXIT @V242801 00481000
  483. * 00482000
  484. ERR6 LA R15,ERR6LST GET ERROR LIST ADDRESS @V242801 00483000
  485. ST R15,RCODE SAVE AS RETURN CODE @V242801 00484000
  486. BAL R10,CONVERT CONVERT THE STMNT NUMBER @V242801 00485000
  487. MVC ERR6SUB,0(R5) MOVE TO MSG AS SUB. @V242801 00486000
  488. B RETURN EXIT @V242801 00487000
  489. * 00488000
  490. ERR7 LA R15,ERR7LST GET ERROR LIST ADDRESS @V242801 00489000
  491. ST R15,RCODE SAVE AS RETURN CODE @V242801 00490000
  492. BAL R10,CONVERT CONVERT THE STMNT NUMBER @V242801 00491000
  493. MVC ERR7SUB2,0(R5) MOVE TO MSG AS SUB2. @V242801 00492000
  494. L R2,OUTLEN GET TARGET LINE NUMBER @V242801 00493000
  495. BAL R10,CONVERT CONVERT THE STMNT NUMBER @V242801 00494000
  496. MVC ERR7SUB1,0(R5) MOVE TO MSG AS SUB1. @V242801 00495000
  497. B RETURN EXIT @V242801 00496000
  498. EJECT 00497000
  499. ERR104R LA R3,READING GET OPERATION @V242801 00498000
  500. LA R4,FROM MAKE IT PRETTY @V242801 00499000
  501. LA R6,104 GET MESSAGE NUMBER @V242801 00500000
  502. B ERR104 GIVE MESSAGE @V242801 00501000
  503. ERR104W CH R15,DSKFUL IS IT DISK FULL ? @V242801 00502000
  504. BE ERREXIT YES..JUST GET OUT @V242801 00503000
  505. LA R3,WRITING GET OPERATION @V242801 00504000
  506. LA R4,TO MAKE IT PRETTY @V242801 00505000
  507. LA R6,105 GET MESSAGE NUMBER @V242801 00506000
  508. ERR104 LR R5,R15 GET ERROR CODE IN REG 5 @V242801 00507000
  509. LA R2,PLIST+8 POINT TO FILEID @V242801 00508000
  510. DMSERR TEXT='ERROR ''....'' ........ FILE ''..................*00509000
  511. ..'' .... DISK',NUM=(R6),LET=S,RENT=NO,CSECT=EDI, *00510000
  512. SUB=(DEC,(R5),CHARA,(R3),CHAR8A,(R2),CHARA,(R4)) 00511000
  513. MVI RCODE+3,100 SET RETURN CODE @V242801 00512000
  514. B RETURN RELEASE TABLES @V242801 00513000
  515. EJECT 00514000
  516. *********************************************************************** 00515000
  517. * 00516000
  518. * PLISTS FOR RDBUF, WRBUF, RNMS AND ERASE 00517000
  519. * 00518000
  520. *********************************************************************** 00519000
  521. SPACE 00520000
  522. DS 0D @V242801 00521000
  523. PLIST DC CL8'FINIS' RDBUF/WRBUF/FINIS COMMAND @V242801 00522000
  524. FNAME DC CL8'RENUM' FILENAME @V242801 00523000
  525. FTYPE DC CL8'CMSUT1' FILETYPE @V242801 00524000
  526. FMODE DS CL2 FILEMODE @V242801 00525000
  527. FITNO DC H'0' ITEM NUBER @V242801 00526000
  528. FBUFF DS A BUFFER ADDRESS @V242801 00527000
  529. FSIZE DS A RECORD LENGTH @V242801 00528000
  530. FVF DC CL2'F' FIXED/VARIABLE FLAG @V242801 00529000
  531. FNOIT DC H'1' NUMBER OF ITEMS TO READ @V242801 00530000
  532. * 00531000
  533. RNMSPL DS 0D @V242801 00532000
  534. INPTR DS F ADDR INPUT BUFFER @V242801 00533000
  535. OUTPTR DS F ADDR OUTPUT BUFFER @V242801 00534000
  536. ANUMTAB DS F ADDR NUMBER TABLE @V242801 00535000
  537. LNUMTAB DS F LEN NUMBER TABLE @V242801 00536000
  538. INLEN DS F LEN INPUT BUFFER @V242801 00537000
  539. RNMSRC DS F RNMS RETURN CODE @V242801 00538000
  540. OUTLEN DS F LEN OUTPUT BUFFER @V242801 00539000
  541. DS1FLG DC AL1(1),AL3(0) FLAG FOR DATA SET 1 @V242801 00540000
  542. DS 14F RNMS WORK @V242801 00541000
  543. DS 260CL1 RNMS WORK @V242801 00542000
  544. DS 260CL1 RNMS WORK @V242801 00543000
  545. * 00544000
  546. DS 0D ERASE PLIST @V242801 00545000
  547. ERASE DC CL8'ERASE' COMMAND @V242801 00546000
  548. ERSFILE DC CL24' ' FILEID @V242801 00547000
  549. DC 8X'FF' FENCE @V242801 00548000
  550. EJECT 00549000
  551. *********************************************************************** 00550000
  552. * 00551000
  553. * MESSAGES TEXT AND LENGTH 00552000
  554. * 00553000
  555. *********************************************************************** 00554000
  556. SPACE 00555000
  557. ERR1LST DC A(LERR1TXT),A(ERR1TXT) LENGTH AND TEXT ADDRESS @V242801 00556000
  558. ERR2LST DC A(LERR2TXT),A(ERR2TXT) LENGTH AND TEXT ADDRESS @V242801 00557000
  559. ERR3LST DC A(LERR3TXT),A(ERR3TXT) LENGTH AND TEXT ADDRESS @V242801 00558000
  560. ERR4LST DC A(LERR4TXT),A(ERR4TXT) LENGTH AND TEXT ADDRESS @V242801 00559000
  561. ERR5LST DC A(LERR5TXT),A(ERR5TXT) LENGTH AND TEXT ADDRESS @V242801 00560000
  562. ERR6LST DC A(LERR6TXT),A(ERR6TXT) LENGTH AND TEXT ADDRESS @V242801 00561000
  563. ERR7LST DC A(LERR7TXT),A(ERR7TXT) LENGTH AND TEXT ADDRESS @V242801 00562000
  564. * 00563000
  565. ERR1TXT DC C'WRONG FILE FORMAT FOR RENUM' @V242801 00564000
  566. LERR1TXT EQU *-ERR1TXT @V242801 00565000
  567. * 00566000
  568. ERR2TXT DC C'SET NEW FILEMODE AND RETRY' @V242801 00567000
  569. LERR2TXT EQU *-ERR2TXT @V242801 00568000
  570. * 00569000
  571. ERR3TXT DC C'MAXIMUM LINE NUMBER EXCEEDED' @V242801 00570000
  572. LERR3TXT EQU *-ERR3TXT @V242801 00571000
  573. * 00572000
  574. ERR4TXT DC C'OVERFLOW AT STMNT ' @V242801 00573000
  575. ERR4SUB DS CL5 @V242801 00574000
  576. LERR4TXT EQU *-ERR4TXT @V242801 00575000
  577. * 00576000
  578. ERR5TXT DC C'INVALID SYNTAX IN STMNT ' @V242801 00577000
  579. ERR5SUB DS CL5 @V242801 00578000
  580. LERR5TXT EQU *-ERR5TXT @V242801 00579000
  581. * 00580000
  582. ERR6TXT DC C'INVALID LINE NUMBER REFERENCE IN STMNT ' @V242801 00581000
  583. ERR6SUB DS CL5 @V242801 00582000
  584. LERR6TXT EQU *-ERR6TXT @V242801 00583000
  585. * 00584000
  586. ERR7TXT DC C'LINE ' @V242801 00585000
  587. ERR7SUB1 DS CL5 @V242801 00586000
  588. DC C'REFERENCED IN STMNT ' @V242801 00587000
  589. ERR7SUB2 DS CL5 @V242801 00588000
  590. DC C', NOT FOUND' @V242801 00589000
  591. LERR7TXT EQU *-ERR7TXT @V242801 00590000
  592. EJECT 00591000
  593. *********************************************************************** 00592000
  594. * 00593000
  595. * EQUATES, CONSTANTS, WORKAREA AND LITERALS 00594000
  596. * 00595000
  597. *********************************************************************** 00596000
  598. SPACE 00597000
  599. BLANK EQU C' ' BLANK CODE @V242801 00598000
  600. WORK DS D WORK ARE FOR PACK/UNPACK @V242801 00599000
  601. RNMSAV DS 18F RNMS SAVE AREA @V242801 00600000
  602. A1RNMSPL DC A(A2RNMSPL) RNMS PLIST ADDRESS/ADDRESS @V242801 00601000
  603. A2RNMSPL DC A(RNMSPL) RNMS PLIST ADDRESS @V242801 00602000
  604. ARNMS DC V(ICDQRNMS) ADDRESS CONVERT ROUTINE @V242801 00603000
  605. SAVREGS DS 15F SAVE AREA FOR CALLERS REGS @V242801 00604000
  606. RCODE DS F RETURN CODE SAVE @V242801 00605000
  607. STRTNO DS F STARTING SEQ. NO. @V242801 00606000
  608. INCRNO DS F INCREMENTS @V242801 00607000
  609. AINCORE DS F ADDRESS EDIT INCORE FILE @V242801 00608000
  610. MAXNO DS F MAX STRT/INCR ALLOWED @V242801 00609000
  611. VBMAX DC F'99999' MAXNO FOR VSBASIC @V242801 00610000
  612. FFMAX DC F'99999999' MAXNO FOR FREEFORT @V242801 00611000
  613. EOF DC H'12' END-OF-FILE RETURN CODE @V242801 00612000
  614. DSKFUL DC H'13' DISK FULL RETURN CODE @V242801 00613000
  615. H5 DC H'5' CONSTANT OF FIVE @V242801 00614000
  616. H8 DC H'8' CONSTANT OF EIGHT @V242801 00615000
  617. SEQLEN DC H'0' SEQ. NUMBER LENGTH @V242801 00616000
  618. OC OC 0(1,R1),ZEROS CHANGE ALL BLANKS TO ZERO @V242801 00617000
  619. PACK PACK WORK,0(1,R1) PACK THE LINE NUMBER @V242801 00618000
  620. MVC1 MVC 1(0,R5),0(R5) MVC TO BLANK PLIST @V242801 00619000
  621. MOVEUP MVC 8(0,R2),OUTBUFF MVC TO MOVE BUFFER TO INCORE @V242801 00620000
  622. MVEDOWN MVC INBUFF(1),8(R3) MVC TO MOVE INCORE TO BUFFER @V242801 00621000
  623. * 00622000
  624. VSBASIC DC CL8'VSBASIC' FILETYPE FOR VSBASIC INPUT @V242801 00623000
  625. FREEFORT DC CL8'FREEFORT' FILETYPE FOR FREEFORT INPUT @V242801 00624000
  626. READING DC CL8'READING' MSG 104R OPERATION @V242801 00625000
  627. WRITING DC CL8'WRITING' MSG 104W OPERATION @V242801 00626000
  628. FROM DC CL4'FROM' MSG 104R FROM @V242801 00627000
  629. TO DC CL4'TO' MSG 104W TO @V242801 00628000
  630. ZEROS DC CL8'00000000' CHANGE ALL BLANKS TO ZEROS @V242801 00629000
  631. INBUFF DS CL168 RNMS INPUT BUFFER @VA11046 00630000
  632. OUTBUFF DS CL168 RNMS OUTPUT BUFFER @VA11046 00631000
  633. RNMSW DS CL1 INTERNAL SWITCH @V242801 00632000
  634. FFORT EQU X'80' FREEFORT FILE @V242801 00633000
  635. TABGOT EQU X'04' NUMBER TABLE ACQUIRED @V242801 00634000
  636. EJECT 00635000
  637. NUCON @V242801 00636000
  638. REGEQU @V242801 00637000
  639. END 00638000