Table of Contents

DMSRDC Source

References

Source Listing

DMSRDC.ASSEMBLE.txt
  1. RDC TITLE 'DMSRDC (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00010000
  4. * MODULE NAME - DMSRDC 00011000
  5. * 00012000
  6. * FUNCTION- READ CARDS AND ASSIGN THE FILE NAME INDICATED 00013000
  7. * 00014000
  8. * ATTRIBUTES- DISK RESIDENT, TRANSIENT 00015000
  9. * NOTE: READCARD MUST BE GENMOD'D WITH THE SYSTEM OPTION 00015100
  10. * 00016000
  11. * ENTRY POINT- READCARD 00017000
  12. * 00018000
  13. * ENTRY CONDITIONS- 00019000
  14. * GPR1 = A(PLIST) 00020000
  15. * PLIST IN FORM 00021000
  16. * CL8'READCD' 00022000
  17. * 00023000
  18. * CL*'FN/*' 00024000
  19. * CL*'FT/*' NOT PRESENT IF SPECIAL READ 00025000
  20. * <CL8'FM'> OPTIONAL, 00026000
  21. * CL8'FENCE' 00027000
  22. * @VA14498 00027500
  23. * EXIT CONDITION-R15 CONTAINS RESULT CODE 00028000
  24. * 0- NO ERRORS 00029000
  25. * 8 - READER EMPTY OR NOT READY 00030100
  26. * 20 - ILLEGAL * IN FILEID 00030200
  27. * 24 - NO FILEID 00030300
  28. * INCOMPLETE FILEID 00030400
  29. * 36 - DEVICE INVALID, NONEXISTENT OR UNSUPPORTED @VA14498 00030420
  30. * DISK NOT ACCESSED @VA14498 00030440
  31. * DISK IS READ/ONLY @VA14498 00030460
  32. * 100- ERROR WRITING FILE 00030500
  33. * ERROR READING CARDS 00030600
  34. * @VA14498 00034600
  35. * CALLS TO OTHER ROUTINES 00040000
  36. * DMSBRD,DMSFNS,DMSERS,DMSSTT,DMSCWR,DMSCIO,DMSCPF, @VA14498 00041100
  37. * DMSLAD @VA14498 00041700
  38. * @VA14498 00042300
  39. * EXTERNAL REFERENCES 00043000
  40. * FVS, ADT, NUCON 00044000
  41. * 00045000
  42. * TABLES/WORK AREAS 00046000
  43. * 00047000
  44. * REGISTER USAGE- 00048000
  45. * R15- SUBROUTINE LINKAGE AND RETURN CODE 00049000
  46. * R14- RETURN 00050000
  47. * R12- BASE 00051000
  48. * R1- PLIST POINTER(ON ENTRY) 00052000
  49. * R2- PLIST POINTER 00053000
  50. * R13 - NOT USED 00054100
  51. * ALL OTHERS - WORK REGISTERS 00054200
  52. * 00056000
  53. * OPERATION: @VA14498 00057000
  54. * 00058000
  55. * READCARD INITIALIZES BLOCK LENGTH AND RECORD SIZE THEN-- 00059000
  56. * 00060000
  57. * IF SPECIAL READ MODE (*): READCARD READS THE FIRST CARD FROM 00061000
  58. * THE CARD READER VIA A CALL TO DMSCIO, IF THE CARD IS NOT 00062100
  59. * A READ CONTROL CARD, READCARD PRINTS AN INFORMATION MESSAGE 00063000
  60. * AND WILL THEN ASSUME A FILEID OF 'READCARD CMSUT1' 00064100
  61. * (THE USER MAY LATER RENAME THE FILE IDENTIFICATION TO WHAT WAS 00065000
  62. * INTENDED.) IF AN ASTERISK WAS SPECIFIED ONLY IN THE 00066000
  63. * FILENAME FIELD, READCARD WILL TAKE THE FILENAME, @VA14498 00067000
  64. * FILETYPE AND FILEMODE FROM THE READ CONTROL CARD AND @VA14498 00068000
  65. * PLACE THAT INFORMATION IN THE PARAMETER LIST. IF 00069000
  66. * ASTERISKS WERE PLACED IN THE FILENAME AND FILETYPE 00070000
  67. * FIELDS, AND NO MODE SPECIFIED, THE FILENAME AND 00071000
  68. * FILETYPE FROM THE READ CARD WILL BE PLACED IN THE 00072000
  69. * PARAMETER LIST AND A DEFAULT MODE OF A1 WILL BE PLACED 00073000
  70. * INTO THE PARAMETER LIST. IF '* * FM' WAS SPECIFIED, 00074000
  71. * THE FILENAME AND FILETYPE ARE TAKEN FROM THE READ 00075000
  72. * CARD AND PUT INTO THE PARAMETER LIST AND THE MODE 00076000
  73. * SPECIFIED IS THE DISK UPON WHICH THE FILE WILL BE 00077000
  74. * PLACED. THE CONTROL CARD INFORMATION IS TYPED AT 00078000
  75. * THE CONSOLE VIA A CALL TO CONWRITE. IF '* * MODE', 00079000
  76. * THE MODE IN EFFECT IS TYPED AS PART OF THE CONTROL CARD 00080000
  77. * INFORMATION. 00081000
  78. * 00082000
  79. * IF THE EXISTENCE OF A FILE WITH THE INTENDED 00083000
  80. * IDENTIFICATION HAS BEEN ESTABLISHED, READCARD WILL @VA14498 00084000
  81. * ERASE THE COPY OF THE OLD FILE ONCE VERIFICATION OF 00085000
  82. * THE INPUT FILE IS OBTAINED. NEXT, IT READS A BLOCK 00086000
  83. * OF CARDS AS DESCRIBED BELOW. IF NEITHER ANOTHER READ 00087000
  84. * CONTROL CARD NOR AN END-OF-FILE IS ENCOUNTERED DURING 00088000
  85. * READING, READCARD CALLS THE DMSBWR FUNCTION PROGRAM TO 00089000
  86. * PLACE THE CARD IMAGES INTO A DISK FILE IT REPEATS 00090100
  87. * THIS PROCEDURE FOR THE NEXT BLOCK OF CARDS IN THE 00091000
  88. * READER. 00092000
  89. * 00093000
  90. * IF ANOTHER READ CONTROL CARD APPEARS IN THE INPUT 00094000
  91. * STREAM, SCAN IS CALLED TO FORMAT IT AND CONWRITE TO 00095000
  92. * TYPE IT AT THE TERMINAL. IT THEN WRITES THE 00096100
  93. * REMAINING IMAGE OF THE PREVIOUS FILE INTO THE DISK 00097000
  94. * FILE, CALLS THE FINIS COMMAND PROGRAM TO CLOSE THAT 00098000
  95. * FILE, AND RETURNS TO PROCESS THE NEW FILE OF CARDS 00099000
  96. * FOLLOWING THE SECOND CONTROL CARD IN THE PRESCRIBED 00100000
  97. * MANNER. READCARD REPEATS THIS PROCEDURE FOR EACH 00101100
  98. * LOGICAL FILE OF CARDS IN THE READER. 00102000
  99. * 00103000
  100. * 00104000
  101. * WHEN AN END-OF-FILE IS ENCOUNTERED DURING THE READING 00105000
  102. * OF CARDS, READCARD PLACES THE REMAINING IMAGES INTO THE 00106000
  103. * LAST DISK FILE, CALLS FINIS TO CLOSE THAT FILE, CALLS CP 00107000
  104. * CLOSE TO CLOSE THE CARD READER OPERATION, AND RETURNS 00108000
  105. * TO THE CALLING PROGRAM, THUS, DURING PROCESSING, 00109000
  106. * READCARD CONVERTS EACH CARD FILE IN THE CARD READER TO 00110000
  107. * A CORRESPONDINGLY NAMED DISK FILE. 00111000
  108. * 00112000
  109. * NO SPECIAL READ MODE. READCARD CALLS THE ERASE COMMAND 00113100
  110. * PROGRAM TO ERASE THE IDENTICALLY NAMED FILE(IF ONE 00114000
  111. * EXISTS AND IF THERE ARE CARDS TO BE READ). NEXT,IT 00115000
  112. * READS A BLOCK OF CARDS,. IT THEN CALLS THE DMSBWR 00116000
  113. * FUNCTION PROGRAM TO WRITE THE IMAGES INTO A DISK 00117000
  114. * FILE. READCARD REPEATS THIS PROCEDURE FOR EACH BLOCK 00118000
  115. * OF CARDS UNTIL AN END-OF-FILE OCCURS. AT THIS TIME, 00119000
  116. * IT WRITES THE REMAINING IMAGES INTO THE DISK FILE, 00120000
  117. * CLOSES THAT FILE (VIA DMSFNS),CLOSES THE CARD READER 00121000
  118. * (VIA CP CLOSE ROUTINE), AND RETURNS TO THE 00122000
  119. * CALLING PROGRAM. THUS, IF THE SPECIAL READ MODE IS 00123000
  120. * NOT SELECTED, READCARD CREATES A SINGLE FILE FROM THE 00124000
  121. * CARDS IN THE READER. 00125000
  122. * 00126000
  123. * IN EITHER CASE, (SPECIAL READ MODE(*) OR NOT), 00127000
  124. * READCARD WILL READ THE FIRST DATA RECORD AND COMPARE 00128000
  125. * ITS RECORD LENGTH AGAINST THE SPECIFIED LENGTH. IF 00129000
  126. * IT GETS AN INCORRECT LENGTH, IT CHECKS TO SEE IF AN 00130000
  127. * ERROR HAS BEEN ENCOUNTERED AND BRANCHES OUT WITH THE 00131000
  128. * APPROPRIATE ERROR CODE. IF THERE IS NO ERROR 00132000
  129. * AND IT IS THE FIRST CARD, IT ASSUMES THE FILE RECORD 00133100
  130. * LENGTH TO BE EQUAL TO THE LENGTH OF THE FIRST RECORD READ 00134000
  131. * AND CONTINUES TO READ AND WRITE AS DESCRIBED IN THE 00135000
  132. * READ MODE DESCRIPTIONS DEPENDING ON WHICH WAS SPECIFIED. 00136000
  133. * (THEREFORE, READCARD WILL NOT READ VARIABLE LENGTH 00137100
  134. * FILES). BEFORE CLOSING THE CARD READER THE RECORD 00138000
  135. * LENGTH IS CHECKED AND IF THE LENGTH IS NOT 80 BYTES 00139100
  136. * THE MESSAGE "RECORD LENGTH = XXX BYTES" IS 00140000
  137. * TYPED. 00141000
  138. * 00142000
  139. * THE FORMAT OF THE CARD EXPECTED BY READCARD IS 00143000
  140. * EITHER THE CMS VER 3.1 "OFFLINE READ..." CONTROL 00144000
  141. * CARD OR THE FOLLOWING FORMAT WHICH IS PRODUCED BY 00145000
  142. * THE PUNCH COMMAND. 00146000
  143. * 00147000
  144. * 00148000
  145. * COL - - - - - -- -- -- -- -- -- -- -- -- -- 00149000
  146. * 1 2 6 7 8 16 17 25 26 28 29 35 36 44 45 00150000
  147. * : READ B B FILENAME B FILETYPE B FM B VOLID B MM/DD/YY B HH 00151100
  148. * 00154000
  149. *. 00155000
  150. EJECT 00156000
  151. DMSRDC CSECT 00157000
  152. READCARD EQU DMSRDC 00158000
  153. ENTRY READCARD 00159000
  154. BALR 12,0 SET BASE REG 00160000
  155. USING *,12 TELL ASSEMBLER WHO IT IS 00161000
  156. USING NUCON,R0 FAKE OUT FOR ADDRESSES WE NEED 00162000
  157. TM BATFLAGS,BATRUN IS BATCH RUNNING? V0742 00162100
  158. BZ NOTBAT BRANCH IF NOT @VM03203 00162200
  159. LR R2,R1 SAVE PLIST POINTR @VM03203 00162300
  160. OI BATFLAG2,BATDCMS TELL BATCH WHO'S CALLING @VM03203 00162400
  161. LR R1,R2 BATABEND NEEDS PLIST @VM03203 00162500
  162. L R15,ABATABND ENTER BATCH AT 'ABEND' POINT@VM03203 00162600
  163. BR R15 AND DON'T COME BACK.... @VM03203 00162700
  164. NOTBAT EQU * CONTINUE ... @VM03203 00162800
  165. STM R0,R15,SAVE SAVE REGS 00163000
  166. SR R2,R2 CLEAR DIAGNOSE AREA V0305 00163100
  167. ST R2,DIAGAREA ... V0305 00163200
  168. L R2,=XL4'0000000C' ASSUME DEVICE '00C' V0305 00163300
  169. LA R4,INVMES SET FOR 'INVALID' MESSAGE V0305 00163400
  170. DC X'83',X'23',XL2'0024' ISSUE DEVICE TYPE DIAGNOSE V0305 00163500
  171. BC 1,ERR13A DEVICE NOT ATTACHED - ERROR V0305 00163600
  172. ST R3,DIAGAREA RESULTS STORED V0305 00163700
  173. CLI DEVCLASS,CLASURI UNIT RECORD INPUT CLASS? V0305 00163800
  174. BNE ERR13 NO, WE ARE THROUGH V0305 00163900
  175. TM DEVTYPE,TYPRDR IS IT A READER? V0305 00164000
  176. BZ ERR13 NO, ERROR V0305 00164100
  177. DEVOK LA R2,151 SET FOR MAXIMUM RECL V0402 00164200
  178. STH R2,UNIT+12 SET INITIAL LRECL FOR READ 00165000
  179. ST R2,LRECL * 00166000
  180. LA R2,5 ASSUME BLOCK SIZE OF 5 V0402 00167100
  181. ST R2,BLKSIZE * 00168000
  182. SR R10,R10 NO. CARDS READ THIS FILE 00169000
  183. SR R11,R11 TOTAL NO. CARDS READ 00170000
  184. MVI SWS,X'00' RESET SWITCHES 00171000
  185. MVI SWS2,X'00' ... V0402 00171100
  186. OI SWS2,RPLIST HANDLING REAL COMMAND PLIST V0402 00171200
  187. MVC FILENOIT(2),=XL2'0001' SET ITEM COUNT 00172000
  188. OI SWS,FIRST FIRST READ SWITCH 00173000
  189. MVC FMODE(2),=CL2'A ' INITIALIZE DEFAULT MODE V0402 00173100
  190. * CHECK PLIST 00174000
  191. L R1,SAVE+4 RESTORE POINTER TO PARMS 00175000
  192. CKPLIST CLI 8(R1),X'FF' FENCE @VM08930 00175050
  193. BE ERR01 @VM08930 00175100
  194. CLI 16(R1),X'FF' FENCE @VM08930 00175150
  195. BE CK1 @VM08930 00175200
  196. CLI 24(R1),X'FF' FILEMODE OMITTED? @VM08930 00175250
  197. BE CHKTYPE YES @VM08930 00175300
  198. CLI 24(R1),C'*' FILEMODE EQUAL ASTERISK? @VM08930 00175350
  199. BE CHKTYPE YES @VM08930 00175400
  200. MVC MODE(2),24(R1) EXPLICIT MODE @VM08930 00175450
  201. MVC FMODE(2),24(R1) @VM08930 00175500
  202. OI SWS2,FMGIVN EXPLICIT MODE @VM08930 00175550
  203. CHKTYPE CLI 16(R1),C'*' IS FT AN *? @VM08930 00177100
  204. BE CK1 YES, SEE IF FN = * @VA01240 00177200
  205. CLI 8(R1),X'FF' FENCE? 00178000
  206. BE ERR01 PARM ERROR IF IT IS 00179000
  207. CLI 8(R1),C'*' ASTERISK 00180000
  208. BE CK2 YES,CK FOR FT=* 00181000
  209. CLI 16(R1),C'*' ASTERISK? 00182000
  210. BE ERR01A ERROR 00183000
  211. MVC NAME(18),8(R1) SAVE FN,FT,FM 00184000
  212. * 00185000
  213. CK3 TM SWS,FIRST+SPMODE+SETFM 00186000
  214. BO CK4 IF ALL ABLVE SWITCHES ON 00187000
  215. TM SWS,SETFM SETTING FILE MODE? 00188000
  216. BZ CK3A NO 00189000
  217. MVC MODE(2),FMODE SET FM FROM INITIAL VALUE 00190000
  218. B CK4 00191000
  219. CK3A CLI 24(R1),X'FF' FILE MODE? 00192000
  220. BE CK3B NO. FM NOT ENTERED. 00193000
  221. CLC 24(3,R1),=C'* ' WAS FM = *? 00194000
  222. BNE CK4 OKAY,IT'S SET 00195000
  223. CK3B MVC MODE(2),=CL2'A1' DEFAULT MODE = A1 00196000
  224. B CK4 00197000
  225. * 00198000
  226. CK1 TM SWS,SPMODE IS IT ALL READY SPECIAL 00199000
  227. BO ERR01A ERROR IF IT IS 00200000
  228. CLI 8(R1),C'*' ASTERISK 00201000
  229. BE SETSW YES @VM08931 00202000
  230. CLI 16(R1),C'*' FILETYPE EQUAL '*'? @VM08931 00202100
  231. BE ERR01A YES @VM08931 00202200
  232. B ERR01C FILETYPE OMITTED. @VM08931 00202300
  233. SETSW OI SWS,SPMODE SIGNAL SPECIAL @VM08931 00203000
  234. B CK2B V0402 00204100
  235. * 00205000
  236. CK2 TM SWS,SPMODE IS IT SPECIAL 00206000
  237. BO ERR01A ERROR 00207000
  238. CLI 16(R1),C'*' FT=* 00208000
  239. BNE ERR01A ERROR IF IT DOES NOT P1094 00209000
  240. OI SWS,SETFM+SPMODE 00210000
  241. CLI 24(R1),X'FF' MODE? 00211000
  242. BNE CK2A YES, USE IT 00212000
  243. CK2A1 MVC FMODE(2),=CL2'A ' V0402 00213100
  244. B CK2B 00214000
  245. CK2A CLI 24(R1),C'*' IS FILEMODE AN ASTERISK 00215000
  246. BE CK2A1 IF SO, DEFAULT TO A1 P3073 00216000
  247. TM SWS2,RPLIST REAL COMMAND PLIST? V0402 00216100
  248. BZ CK4 BRANCH IF CONTROL CARD PLIST V0402 00216200
  249. CLI 25(R1),X'40' MODE NO. EXPLICITLY GIVEN? V0402 00216300
  250. BE CKMV BRANCH IF NOT V0402 00216400
  251. OI SWS2,FMGIVN EXPLICIT MODE NO. GIVEN V0402 00216500
  252. CKMV EQU * V0402 00216600
  253. MVC FMODE(2),24(R1) MOVE IN GIVEN MODE 00217000
  254. CK2B MVC MODE(2),FMODE 00218000
  255. * 00219000
  256. CK4 MVC UNIT+12(2),LRECL+2 SET INITIAL CNTR 00220000
  257. XC UNIT+14(2),UNIT+14 CLEAR BYTES READ 00221000
  258. L R8,BUFFER BUFFER ADDRESS 00222000
  259. ST R8,UNIT+8 00223000
  260. MVI UNIT+8,X'80' TURN ON SPECIAL FLAG 00224000
  261. L R9,BLKSIZE 00225000
  262. NI SWS2,255-RPLIST V0402 00225100
  263. CLI MODE+1,X'40' IS 2ND CHAR MISSING? P3073 00227000
  264. BNE READ NO P3073 00228000
  265. MVI MODE+1,C'1' DEFAULT VALUE 1 P3073 00229000
  266. * 00230000
  267. READ TM SWS1,CTRL TEST FOR ASSUMED CONTROL CARD 00231000
  268. BNO READ1B NOT ONE 00232000
  269. NI SWS1,255-CTRL TURN OFF SWITCH 00233000
  270. B READ1D SKIP READ SINCE CARD IS IN BUFFER 00234000
  271. READ1B LA R1,UNIT READ CARD 00235000
  272. SVC 202 CALL CMS 00236000
  273. DC AL4(ERR03) ERROR RET 00237000
  274. READ1 LA R11,1(R11) TOTAL READ 00238000
  275. READ1D TM SWS,FIRST 1ST READ? 00239000
  276. BZ READCD1 NO 00240000
  277. READ1C TM SWS,SPMODE+FIRSTSP IS IT SPECIAL 00241000
  278. BM CKCTRL SKIP FILE SETUP FOR NOW 00242000
  279. MVC FILE,=CL8'STATEW' SET COMMAND 00243000
  280. MVC FILENAME(18),NAME MOVE FILE NAME 00244000
  281. LA R1,FILE CALL STATEW 00245000
  282. L R15,ASTATEW TO SEE IF OLD EXISTS @V305066 00246000
  283. BALR R14,R15 ... @V305066 00246100
  284. C R15,=F'36' WAS DISK NOT ACCESSED? @VA09236 00246300
  285. BE DEVERR GIVE MSG @VA09236 00246500
  286. C R15,=F'28' WAS FILE NOT FOUND BY STATE? 00248000
  287. BE SKERASE NOT THERE, SKIP ERASE 00249000
  288. LTR R15,R15 EVERYTHING OKAY 00250000
  289. BZ ERASE YES, GO ERASE EXISTING FILE 00251000
  290. LA R15,24 SET ERROR CODE(MSG WAS GIVEN BY STATE) 00252000
  291. B RETURN1 GO BACK 00253000
  292. * 00257000
  293. ERASE MVC FILE(8),=CL8'ERASE' 00258000
  294. LA R1,FILE ERASE OLD FILE 00259000
  295. L R15,AERASE ERASE @V305066 00260000
  296. BALR R14,R15 ... @V305066 00260100
  297. B SKRWCK SKIP R/W CHECK @VA14498 00261000
  298. SKERASE EQU * 00262000
  299. LA R1,FILE CALL ADTLKW @VA14498 00262100
  300. L R15,VCADTLKW TO CHECK IF R/W DISK @VA14498 00262200
  301. BALR R14,R15 IF NOT ... @VA14498 00262300
  302. BC 2,DEVERR2 GIVE ERROR MSG @VA14498 00262400
  303. * @VA14498 00262500
  304. SKRWCK EQU * @VA14498 00262600
  305. MVC FILE(8),=CL8'WRBUF' SET FOR WRITE 00263000
  306. MVC FILEBUFF(4),BUFFER SET BUFFER START AREA 00264000
  307. NI SWS,255-(FIRST+FIRSTSP) TURN OFF 1ST SWITCH 00265000
  308. * 00266000
  309. READCD1 TM SWS,SPMODE SPECIAL READ? 00267000
  310. BZ READ1A NO,CONTINUE 00268000
  311. CLC 0(5,R8),ASSUME IS IT 12-2-9 READ CARD 00269000
  312. BE READCD1A 00270000
  313. CLC 0(7,R8),=C'OFFLINE' IS IT OLD OFFLINE HEADER 00271000
  314. BNE READ1A NO 00272000
  315. * SCAN FOR 'READ' AFTER OFFLINE 00272050
  316. LA R4,8(R8) SET POINTER V0014 00272100
  317. LA R5,68 SET COUNTER V0014 00272150
  318. CKOFF2 CLI 0(R4),C' ' IS CHAR A NON-BLANK V0014 00272200
  319. BNE CKOFF1 IF SO LOOK FOR 'READ' V0014 00272250
  320. LA R4,1(R4) OTHERWISE,INCR PTR V0014 00272300
  321. BCT R5,CKOFF2 AND LOOK AGAIN V0014 00272350
  322. B READ1A V0014 00272400
  323. CKOFF1 CLC 0(4,R4),=CL4'READ' IS IT REALLY? V0150 00272451
  324. BNE READ1A IF NOT, GO BACK V0014 00272500
  325. READCD1A OI SWS,EOF+CCARD TURN ON SWITCHES 00273000
  326. MVC CCSAVE(80),0(R8) SAVE CNTRL CARD 00274000
  327. READCD1B L R7,BUFFER SET LENGTH 00275000
  328. SR R8,R7 IN FCB FOR WRITE 00276000
  329. LTR R10,R10 ANY CARDS TO WRITE 00277000
  330. BZ READNULL NO,NULL FILE 00278000
  331. LTR R8,R8 ANY LEFT TO WRITE 00279000
  332. BZ READ4 NO 00280000
  333. STH R8,FILESIZE+2 SET SIZE 00281000
  334. L R1,BLKSIZE CALCULATE ACTUAL NUMBER TO WRITE 00282000
  335. SR R1,R9 SUBTRACT NUMBER NOT READ 00283000
  336. STH R1,FILENOIT 00284000
  337. B READ2A 00285000
  338. * 00286000
  339. READ1A LA R10,1(R10) INCR NO. CARDS THIS FILE 00287000
  340. BCT R9,READ3 DECR BLOCK COUNT THIS RECORD 00288000
  341. * END OF BLOCK, WRITE IT 00289000
  342. READ2 MVC FILENOIT(2),BLKSIZE+2 00290000
  343. SR R1,R1 CLEAR REG 00291000
  344. LH R1,BLKSIZE+2 GET NO RECORDS 00292000
  345. MH R1,LRECL+2 CALCULATE NUMBER BYTE RECORD 00293000
  346. ST R1,FILESIZE 00294000
  347. READ2A LA R1,FILE WRITE BUFFER 00295000
  348. L R15,AWRBUF WRBUF @V305066 00296000
  349. BALR R14,R15 ... @V305066 00296100
  350. BNZ ERR02 DISK WRITE ERROR @V305066 00296200
  351. TM SWS,EOF IS IT END OF FILE 00298000
  352. BO READ4 YES 00299000
  353. L R9,BLKSIZE SET BLOCKSIZE 00300000
  354. L R8,BUFFER RESET BEGINNING OF BUFFER 00301000
  355. ST R8,UNIT+8 * 00302000
  356. OI UNIT+8,X'80' SPECIAL READ SWITCH FOR CARDIO 00303000
  357. B READ 00304000
  358. READ3 L R1,LRECL INCR BUFFER POINTER 00305000
  359. AR R8,R1 * 00306000
  360. ST R8,UNIT+8 NEXT READ IN AREA 00307000
  361. OI UNIT+8,X'80' SPECIAL READ SWITCH FOR CARDIO 00308000
  362. B READ 00309000
  363. * LOOK FOR CONTROL CARD 00310000
  364. CKCTRL CLC 0(6,R8),ASSUME CONTROL CARD ? 00311000
  365. BE TYPCTRL V0402 00312100
  366. CKCTRL1A EQU * P3073 00315000
  367. CLC 0(7,R8),=C'OFFLINE' IS IT OFFLINE CARD 00316000
  368. BNE CKCTRL1 V0402 00316100
  369. LA R0,68 SET COUNTER V0150 00317050
  370. LA R1,8(,R8) POINT TO CARD V0150 00317100
  371. *SCAN FOR READ AFTER 'OFFLINE CARD' 00317150
  372. CKC1 CLI 0(R1),C' ' IS CHAR A NON-BLANK? V0150 00317200
  373. BNE CKC2 IF SO, LOOK FOR 'READ' V0150 00317250
  374. LA R1,1(R1) IF NOT, GO AGAIN V0150 00317300
  375. BCT R0,CKC1 DECR CNTR V0150 00317350
  376. B CKCTRL1 IF NOT, ASSUME HEADER V0150 00317400
  377. * 00317450
  378. CKC2 CLC 0(4,R1),=CL4'READ' IS IT REALLY?? V0150 00317500
  379. BNE CKCTRL1 IF NOT ASSUME HEADER V0150 00317550
  380. B TYPCTRL 00318000
  381. CKCTRL1 XC CCSAVE(80),CCSAVE CLEAR 00319000
  382. MVC CCSAVE(29),ASSUME ASSUMED 00320000
  383. OI SWS1,CTRL TURN ON SW FOR CONTROL CARD ASSUMED 00321000
  384. DMSERR NUM=702,LET=I,TEXT='READ CONTROL CARD MISSING. G00322000
  385. FOLLOWING ASSUMED:' 00323000
  386. B TYPCTRL1 00324000
  387. * 00325000
  388. TYPCTRL MVC CCSAVE(80),0(R8) MOVE IN CNTRL CARD 00326000
  389. TYPCTRL1 EQU * V0402 00327100
  390. LA R8,CCSAVE ADDRESS THE CONTROL CARD @VA00982 00327250
  391. CLC CCSAVE(8),=C'OFFLINE ' OFFLINE READ? @VA00982 00327300
  392. BNE RDCARD NO, READ CARD @VA00982 00327350
  393. LA R8,8(R8) BYPASS CONTROL WORD @VA00982 00327400
  394. RDCARD LA R0,4 NO WORDS TO BYPASS @VA00982 00327450
  395. LA R1,CCSAVE+69 CALCULATE MAXIMUM @VA00982 00327500
  396. SR R1,R8 AREA TO SCAN @VA00982 00327550
  397. CKBLNK CLI 0(R8),C' ' SKIP BLANKS @VA00982 00327600
  398. BNE BYPASS PASS ON NON-BLANKS @VA00982 00327650
  399. LA R8,1(R8) NEXT CHAR POSITION @VA00982 00327700
  400. ADVBLNK EQU * @VA06148 00327760
  401. BCT R1,CKBLNK CHECK NEXT @VA06148 00327770
  402. B MVMODE MODE POSITION BY DEFAULT @VA00982 00327800
  403. SPACE 1 00327850
  404. CHKCHAR CLI 0(R8),C' ' CHECK FOR NON BLANK @VA00982 00327900
  405. LA R8,1(R8) NEXT POSITION ANYWAY @VA00982 00327950
  406. BE ADVBLNK GO TO SCAN FOR NEXT NON-BLANK @VA06148 00328010
  407. BCT R1,CHKCHAR KEEP ON TRUCKIN' @VA00982 00328050
  408. B MVMODE SHOULDN'T REALLY GET HERE @VA00982 00328100
  409. SPACE 1 00328150
  410. BYPASS BCT R0,CHKCHAR MORE WORDS TO SKIP @VA00982 00328200
  411. MVMODE TM SWS2,FMGIVN MODE SPECIFIED? @VA00982 00328250
  412. BO MVE2 YES, SETUP THE WHOLE THING @VA00982 00328300
  413. MVC 0(1,R8),FMODE SET MODE LETTER @VA00982 00328350
  414. B TYPCTRLA @VA00982 00328400
  415. MVE2 MVC 0(2,R8),FMODE MODE LETTER AND NUMBER @VA00982 00328450
  416. SPACE 1 00328500
  417. TYPCTRLA LA R0,CCSAVE 00334000
  418. DMSERR LET=I,NUM=702,TEXT='...................................X00335000
  419. ....................................',SUB=(CHARA,(0)) 00336000
  420. LA R0,71 LENGTH FOR SCAN MODULE @VA00982 00337100
  421. * 00338000
  422. LA R1,CCSAVE POINT TO CARD 00340000
  423. L R15,ASCANN GO TO SCAN TO FORMAT PARAMETERS 00341000
  424. BALR R14,R15 ON CTRL CARD TO PLIST 00342000
  425. OI SWS,FIRSTSP INDICATE FIRST PASS ON SP CTRL CARD 00344000
  426. * 00345000
  427. * ON RETURN R1 POINTS TO LIST OF PARAMETERS 00346000
  428. CLC 0(5,R1),ASSUME IS IT READ CNTRL CARD? V0014 00347100
  429. BE CKPLIST 00348000
  430. LA R1,8(R1) SET PLIST POINTER 00351000
  431. B CKPLIST 00352000
  432. * 00353000
  433. * CLOSE THE FILE- IF NO MORE, CLOSE READER. 00354000
  434. READ4 MVC FILE(8),=CL8'FINIS' CLOSE FILE 00355000
  435. LA R1,FILE * 00356000
  436. L R15,AFINIS FINIS @V305066 00357000
  437. BALR R14,R15 ... @V305066 00357100
  438. BNZ ERR02 DISK ERROR @V305066 00357200
  439. READ5 TM SWS,CCARD IS CONTROL CARD PRESENT 00359000
  440. BZ CLOSE NO 00360000
  441. NI SWS,255-(EOF+CCARD) TURN OFF SOME SWITCHES 00361000
  442. OI SWS,FIRST TURN ON OTHERS 00362000
  443. LA R10,0 RESET COUNTER 00363000
  444. B TYPCTRL1 00364000
  445. CLOSE LA R1,CLOSIO CLOSE CARD READER 00365000
  446. SVC 202 00366000
  447. DC AL4(ERR03) CARD READER ERROR 00367000
  448. TM SWS1,NOEOF WAS THIS SPECIAL CASE P0709 00368000
  449. BNO CLOSE1 NO P0709 00369000
  450. LR R15,R6 RETURN CODE P0709 00370000
  451. B CLOSE2 P0709 00371000
  452. CLOSE1 LA R15,0 RETURN CODE P0709 00372000
  453. CLOSE2 CLC LRECL,=F'80' IS LRECL 80 CHARS P0709 00373000
  454. BE RETURN YES, THEN DON'T NEED MESSAGE 00374000
  455. LA R0,LRECL POINT TO LENGTH 00375000
  456. DMSERR LET=I,NUM=738, P3021X00376000
  457. TEXT='RECORD LENGTH IS ''...'' BYTES', P3021X00377000
  458. SUB=(DECA,(0)) P3021 00378000
  459. LA R15,0 00379000
  460. * 00380000
  461. RETURN LM R0,R14,SAVE RESTORE 00381000
  462. BR R14 RETURN 00382000
  463. * 00383000
  464. RETURN1 LR R6,R15 SAVE CODE 00384000
  465. LA R1,CLOSERDR CLOSE RDR HOLD 00385000
  466. SVC 202 HAVE CMS COMMUNICATE THE REQUEST 00386000
  467. DC AL4(*+4) 00387000
  468. LR R15,R6 RESTORE CODE 00388000
  469. B RETURN RETURN 00389000
  470. EJECT 00390000
  471. * 00391000
  472. ERR01 DMSERR NUM=42,LET=E,TEXT='NO FILEID SPECIFIED' 00392000
  473. LA R15,24 00393000
  474. B RETURN 00394000
  475. * 00395000
  476. ERR01A DMSERR NUM=62,LET=E,TEXT='INVALID * IN FILEID' 00396100
  477. LA R15,20 SET RETURN CODE P1096 00397000
  478. B RETURN 00398000
  479. * 00399000
  480. ERR01C DMSERR NUM=54,LET=E,TEXT='INCOMPLETE FILEID SPECIFIED' 00400000
  481. * 00401000
  482. LA R15,24 00402000
  483. B RETURN 00403000
  484. ERR02 LA R0,FILENAME 00404000
  485. DMSERR NUM=105,LET=S, P3061X00405000
  486. TEXT=('ERROR ''..'' WRITING FILE', P3061X00406000
  487. ' ''....................'' ', P3061X00407000
  488. 'ON DISK'),SUB=(DEC,(15),CHAR8A,(0)),RENT=NO @VA08020 00408000
  489. LA R15,100 00409000
  490. B RETURN1 GO CLOSE RDR 00410000
  491. * 00411000
  492. * 00412000
  493. ERR03 CH R15,H1 IS IT EOF 00413000
  494. BE RDEOF YES 00414000
  495. CH R15,H2 IS IT READY 00415000
  496. BE REREAD NO,TRY AGAIN 00416000
  497. CH R15,H5 INCORRECT LENGTH? 00417000
  498. BE SETLEN 00418000
  499. CH R15,=H'3' IS ERROR CODE OTHER THAN 3 00419000
  500. BNE RETURN MSG WAS GIVEN IN CARDIO MODULE 00420000
  501. ERR03A DMSERR NUM=124,LET=S,TEXT='ERROR READING CARD FILE' 00421000
  502. LA R15,100 ERROR CODE 00422000
  503. B RETURN1 CLOSE RDR 00423000
  504. * 00424000
  505. * 00428000
  506. RDEOF LTR R11,R11 ANY CARDS READ AT ALL 00429000
  507. BZ REREAD NO, NO DATA IN READER V0699 00430100
  508. OI SWS,EOF TURN ON END OF FILE SWITCH 00431000
  509. B READCD1B 00432000
  510. * 00433000
  511. REREAD DMSERR NUM=205,LET=W,TEXT='READER EMPTY OR NOT READY' 00434000
  512. LA R15,8 00435000
  513. TM SWS,FIRST IS IT FIRST READ P0709 00436000
  514. BO RETURN1 YES P0709 00437000
  515. LR R6,R15 SAVE CODE P0709 00438000
  516. OI SWS,EOF FORCE END OF FILE P0709 00439000
  517. OI SWS1,NOEOF SET INDICATOR P0709 00440000
  518. B READCD1B FINISH UP P0709 00441000
  519. READNULL DMSERR NUM=701,LET=I,TEXT='(NULL FILE)' 00442000
  520. LA R15,0 00443000
  521. B READ5 00444000
  522. * 00445000
  523. SETLEN TM SWS,FIRST WAS IT FIRST READ 00446000
  524. BZ ERR03A NO,ERROR,QUIT 00447000
  525. SR R1,R1 CLEAR REG 00448000
  526. LH R1,UNIT+14 00449000
  527. ST R1,LRECL SAVE REC LEN 00450000
  528. STH R1,UNIT+12 SET LEN IN PARM LIST 00451000
  529. MVI UNIT+8,X'00' TURN OFF SPECIAL FLAG 00452000
  530. LA R2,0 SET TO CALCULATE 00453000
  531. LA R3,800 BLOCK LENGTH 00454000
  532. DR R2,R1 DIVIDE AND 00455000
  533. ST R3,BLKSIZE SAVE RESULTS 00456000
  534. LR R9,R3 RESET BLK COUNT 00457000
  535. B READ1 CONTINUE WITH NEW LRECL AND BLKSIZE 00458000
  536. DEVERR LA R3,FILEMODE POINT TO MODE LETTER @VA09236 00458150
  537. DMSERR TEXT='DISK ''..'' NOT ACCESSED',NUM=69, X00458300
  538. LET=E,SUB=(CHARA,((R3),1)),TYPCALL=SVC @VA09236 00458450
  539. L R15,=F'36' GIVE RETCODE @VA09236 00458600
  540. B RETURN1 @VA09236 00458750
  541. * 00459000
  542. DEVERR2 LA R3,FILEMODE POINT TO MODE LETTER @VA14498 00459100
  543. DMSERR TEXT='DISK ''..'' IS READ/ONLY',NUM=37, X00459200
  544. LET=E,SUB=(CHARA,((R3),1)),TYPCALL=SVC @VA14498 00459300
  545. L R15,=F'36' GIVE RETCODE @VA14498 00459400
  546. B RETURN1 @VA14498 00459500
  547. * 00460000
  548. ERR13 LA R4,UNSMES SET FOR 'UNSUPPORTED' MESSAGE V0305 00460100
  549. ERR13A DMSERR NUM=008,LET=E,RENT=NO, X00460200
  550. TEXT='DEVICE ''...'' .......................', X00460300
  551. SUB=(HEX,(2),CHARA,((4),23)) V0305 00460400
  552. LA R15,36 SET RETURN CODE V0305 00460500
  553. LM R0,R14,SAVE RESTORE REGISTERS V0305 00460600
  554. BR R14 RETURN V0305 00460700
  555. EJECT 00461000
  556. * SAVE AREAS, CONSTANTS AND EQUATES. 00462000
  557. DS 0D 00463000
  558. CCSAVE1 DC 4C' ' LENGTH AREA 00464000
  559. CCSAVE DS 80C CONTROL CARD BUFFER 00465000
  560. SAVE DS 16F 00466000
  561. SWS DS 1C SWITCHES 00467000
  562. SWS1 DC X'00' 00468000
  563. CTRL EQU X'01' CNTRL CARD ASSUMED SWITCH 00469000
  564. NOEOF EQU X'02' INTERVENTION REQ'D ON RDR P0709 00470000
  565. SWS2 DS 1C V0402 00470100
  566. RPLIST EQU X'80' REAL COMMAND PLIST V0402 00470200
  567. FMGIVN EQU X'40' EXPLICIT MODE NO. GIVEN V0402 00470300
  568. BUFFER DC A(IOAREA) 00471000
  569. NAME DS 8C SAVE FILENAME 00472000
  570. TYPE DS 8C SAVE FILE TYPE 00473000
  571. MODE DS 2C SAVE FILEMODE 00474000
  572. FMODE DS 2C FILEMODE 00475000
  573. H1 DC H'1' 00476000
  574. H2 DC H'2' 00477000
  575. H5 DC H'5' 00478000
  576. LRECL DS 1F RECORD LENGTH 00479000
  577. BLKSIZE DS 1F BLOCK SIZE 00480000
  578. FIRSTSP EQU X'80' 1ST PASS ON SPMODE CCARD 00481000
  579. CCARD EQU X'40' CONTROL CARD PRESENT 00482000
  580. EOF EQU X'20' END OF FILE 00483000
  581. FIRST EQU X'10' FIRST READ OF FILE 00484000
  582. RECL132 EQU X'08' 132 CHAR RECORDS 00485000
  583. RECL96 EQU X'04' 96 CHAR RECORDS 00486000
  584. SETFM EQU X'02' FILEMODE WAS SPECIFIED 00487000
  585. SPMODE EQU X'01' SPECIAL MODE READ 00488000
  586. * SUPPLIED CONTROL CARD-THIS ORDER 00489000
  587. ASSUME DC C':READ ' P3073 00490000
  588. DC C'READCARD CMSUT1 A1 ' P3073 00491000
  589. DIAGAREA DS 0F V0305 00491100
  590. DEVCLASS DS 1C V0305 00491200
  591. DEVTYPE DS 1C V0305 00491300
  592. DEVSTAT DS 1C V0305 00491400
  593. DEVFLAG DS 1C V0305 00491500
  594. CLASURI EQU X'20' V0305 00491600
  595. TYPRDR EQU X'80' V0305 00491700
  596. INVMES DC CL24'INVALID OR NONEXISTENT ' V0305 00491800
  597. UNSMES DC CL24'UNSUPPORTED DEVICE TYPE ' V0305 00491900
  598. EJECT 00492000
  599. * I/O PARAMETER LSITS 00493000
  600. CLOSIO DS 0H 00494000
  601. DC CL8'CP' 00495000
  602. DC CL8'CLOSE' 00496000
  603. DC CL8'00C' 00497000
  604. DC 8X'FF' 00498000
  605. * 00499000
  606. CLOSERDR DC CL8'CP' CALL CP TO DO THE WORK 00500000
  607. DC CL8'CLOSE' CLOSE THE RDR 00501000
  608. DC CL8'RDR' * 00502000
  609. DC CL8'HOLD' AND HOLD THE FILE 00503000
  610. DC 8X'FF' FENCE 00504000
  611. UNIT DS 0F 00505000
  612. DC CL8'CARDRD' 00506000
  613. DS 1F BUFFER LOCATION 00507000
  614. DS 1F LRECL 00508000
  615. DS 2C NO. BYTES READ 00509000
  616. * 00510000
  617. NULMSG DS 0F 00511000
  618. DC CL8'TYPLIN' 00512000
  619. DC AL1(1),AL3(NULLM),C'B',AL3(L'NULLM) 00513000
  620. NULLM DC C'(NULL FILE)' MESSAGE FOR EMPTY FILE 00514000
  621. TYPLIN DS 0F 00515000
  622. DC CL8'TYPLIN' 00516000
  623. DC AL1(1),AL3(BUFFER),C'B',AL3(72) 00517000
  624. * 00518000
  625. FILE DS 0D 00519000
  626. FILECOMM DC CL8'*' COMMAND 00520000
  627. FILENAME DC CL8'*' FILENAME 00521000
  628. FILETYPE DC CL8'*' FILETYPE 00522000
  629. FILEMODE DC CL2'*' FILEMODE 00523000
  630. FILEITNO DC H'0' ITEM NUMBER 00524000
  631. FILEBUFF DC A(*) BUFFER AREA 00525000
  632. FILESIZE DC A(800) BUFFER SIZE 00526000
  633. FILEFV DC CL2'F' FIXED/VARIABLE FLAG 00527000
  634. FILENOIT DC H'1' NUMBER OF ITEMS 00528000
  635. FILENORD DC F'0' 00529000
  636. IOAREA DS 800C 00530000
  637. LTORG 00531000
  638. * 00532000
  639. FVS 00533000
  640. ADT 00534000
  641. REGEQU 00535000
  642. NUCON 00536000
  643. END 00537000