User Tools

Site Tools


cdc:nos2.source:nam5871:lfgcrak

LFGCRAK

Table Of Contents

  • [00007] CRACK CONTROL CARD.

Source Code

LFGCRAK.txt
  1. *DECK LFGCRAK
  2. USETEXT LFGFET,LFGFN
  3. PROC LFGCRAK;
  4. BEGIN
  5. *IF DEF,IMS
  6. #
  7. ** LFGCRAK - CRACK CONTROL CARD.
  8. *
  9. * M. E. VATCHER 81/02/19
  10. * D. K. ENDO 81/12/22 (ADD -Z- AND -BC- PARAMETERS)
  11. *
  12. * LFGCRAK CRACKS THE LFG CONTROL CARD. ALL FILE NAMES ARE
  13. * CHECKED TO MAKE SURE THEY ARE VALID.
  14. *
  15. * PROC LFGCRAK
  16. *
  17. * ENTRY NONE.
  18. *
  19. * EXIT NONE.
  20. *
  21. * METHOD
  22. *
  23. * FOR EACH WORD BEGINNING AT RA+2
  24. * IF ITS AN "I" PARAMETER
  25. * THEN
  26. * CHECK FILE NAME
  27. * SET FILE NAME IN INPUT FET
  28. * ELSE IF ITS AN "L" PARAMETER
  29. * THEN
  30. * CHECK FILE NAME
  31. * SET FILE NAME IN OUTPUT FET
  32. * ELSE IF ITS AN "NLF" PARAMETER
  33. * THEN
  34. * CHECK FILE NAME
  35. * SET FILE NAME IN NLF FET
  36. * ELSE IF ITS A "Z" PARAMETER
  37. * THEN
  38. * CALL *Z* ARGUMENT PROCESSOR
  39. * ELSE IF ITS A "BC" PARAMETER
  40. * THEN
  41. * CHECK DECIMAL NUMBER
  42. * CONVERT TO INTEGER AND SAVE IT
  43. * END
  44. *
  45. #
  46. *ENDIF
  47.  
  48. #
  49. **** PROC LFGCRAK - XREF LIST BEGIN.
  50. #
  51.  
  52. XREF
  53. BEGIN
  54. PROC ABORT; # ABORTS JOB ON REQUEST #
  55. ITEM INPUT; # INPUT DIRECTIVE FET #
  56. PROC LFGZAP; # *Z* ARGUMENT PROCCESSOR #
  57. PROC MESSAGE; # PUTS MESSAGE INTO DAYFILE #
  58. ITEM OUTPUT U; # FWA OF LIST OUTPUT FET #
  59. PROC READ; # FILLS CIO BUFFER #
  60. PROC RECALL; # RETURNS CONTROL WHEN RECALL BIT IS SET #
  61. ITEM WFET U; # FWA OF NLF FET #
  62. END
  63.  
  64. #
  65. ****
  66. #
  67.  
  68. DEF COMMA # 1 #; # JOB COMM. AREA CODE FOR , #
  69. DEF EQUAL # 2 #; # JOB COMM. AREA CODE FOR = #
  70. DEF MAX$BC # 64 #; # MAXIMUM BC VALUE ALLOWED #
  71. DEF MIN$BC # 1 #; # MINIMUM BC VALUE ALLOWED #
  72. DEF NO$LIST #O"33000000000000"#; # LEFT JUSTIFIED ZERO #
  73. DEF PARTERM #O"17"#; # JOB COMM. AREA CODE FOR ) OR . #
  74. DEF PLWC # O"64" #; # WORD WHERE PARAMTER LIST WORD COUNT IS #
  75. DEF PRMLIST # 2 #; # WORD WHERE PARAMETER LIST STARTS #
  76.  
  77. CONTROL NOLIST; # LFGSTAN COMMON DECK #
  78. *CALL LFGSTAN
  79. CONTROL LIST;
  80. ITEM DONEII B; # LOOP TERMINATION CONDITION #
  81. ITEM DONEK B; # LOOP TERMINATION CONDITION #
  82. ITEM II U; # LOOP INDEX #
  83. ITEM J I; # POINTER TO WORD IN JOB COMM. AREA #
  84. ITEM K U; # LOOP INDEX #
  85. ITEM SUCCESS B; # SUCCESSFUL COMPLETION INDICATOR #
  86. ITEM SWTCHVCTR I; # SWITCH VECTOR #
  87. ITEM Z$USED B; # Z PARAMETER SPECIFIED FLAG #
  88.  
  89. BASED ARRAY PARAMS [1:1] S(1);
  90. BEGIN
  91. ITEM PARVAL C(0,0,7);
  92. ITEM PARCODE U(0,56,4);
  93. END
  94.  
  95. DEF MAXPT # 5 #; # MAXIMUM NUMBER OF PARAMETERS #
  96. ARRAY PARAM$TABLE [01:MAXPT] S(1);
  97. BEGIN
  98. ITEM PT$NAME C(00,00,07) = [O"11000000000000",
  99. O"14000000000000",
  100. O"16140600000000",
  101. O"32000000000000",
  102. O"02030000000000"
  103. ];
  104. ITEM PT$SWTCHV I(00,42,18) = [1,
  105. 2,
  106. 3,
  107. 4,
  108. 5
  109. ];
  110. END
  111.  
  112. BASED ARRAY PARAM$WC [00:00] S(1);
  113. BEGIN # PARAMETER LIST WORD COUNT #
  114. ITEM PLIST$WC I(00,42,18);
  115. END
  116.  
  117. ARRAY BC$RANGE [00:00] S(4);
  118. BEGIN
  119. ITEM BR$MSG C(00,00,30) = [" BC VALUE OUT OF RANGE(1-64)."];
  120. ITEM BR$ZBYT I(03,00,60) = [0];
  121. END
  122.  
  123. ARRAY NOVAL [0:0] S(3);
  124. BEGIN
  125. ITEM NOVAL1 C(0,0,28) =
  126. [" NO VALUE FOR PARAMETER XXX."];
  127. ITEM NOVAL2 C(2,24,3);
  128. ITEM NOVALZ U(2,48,12) = [ 0 ];
  129. END
  130.  
  131. ARRAY UNREC$DELIM [00:00] S(3);
  132. BEGIN
  133. ITEM UD$MSG C(00,00,24) = [" UNRECOGNIZED DELIMETER."];
  134. ITEM UD$ZBYT I(02,24,36) = [0];
  135. END
  136.  
  137. ARRAY NO$EQUAL [00:00] S(3);
  138. BEGIN
  139. ITEM NE$MSG C(00,00,25) = [" CANNOT ASSIGN VALUE TO Z."];
  140. ITEM NE$ZBYT I(02,30,30) = [0];
  141. END
  142.  
  143. ARRAY NOT$DEC [00:00] S(3);
  144. BEGIN
  145. ITEM ND$MSG C(00,00,28) = [" BC VALUE SHOULD BE DECIMAL."];
  146. ITEM ND$ZBYT I(02,48,12) = [0];
  147. END
  148.  
  149. ARRAY UNREC$PRM [0:0] S(3);
  150. BEGIN
  151. ITEM UNREC1 C(0,0,24) =
  152. [" UNRECOGNIZED PARAMETER."];
  153. ITEM UNRECZ U(2,24,36) = [ 0 ];
  154. END
  155.  
  156. SWITCH GFNSWTCH UNK,
  157. I$PRM,
  158. L$PRM,
  159. NLF$PRM,
  160. Z$PRM,
  161. BC$PRM;
  162. CONTROL EJECT;
  163. PROC LFGCDN(VALUE,NUMBER,STATIS);
  164. BEGIN # CHECK DECIMAL NUMBER #
  165.  
  166. ITEM VALUE C(7); # VALUE TO BE CHECKED AND CONVERTED #
  167. ITEM NUMBER I; # CONVERTED NUMBER #
  168. ITEM STATIS B; # ERROR STATUS #
  169.  
  170. DEF NINE # O"44" #;
  171. DEF ZERO # O"33" #; # DISPLAY CODE ZERO #
  172. ITEM CTEMP C(1); # CHARACTER TEMPORARY #
  173. ITEM EXPONENT I; # CURRENT EXPONENT VALUE #
  174. ITEM I I; # SCRATCH ITEM #
  175. # #
  176. # LFGCDN CODE BEGINS HERE #
  177. # #
  178. STATIS = TRUE; # SET RETURN STATUS TO O.K. #
  179. NUMBER = 0; # CLEAR NUMBER TEMPORARY #
  180. EXPONENT = 0; # CLEAR EXPONENT #
  181. FOR I=6 STEP -1 UNTIL 0
  182. DO # FOR EACH CHARACTER OF VALUE(FROM RIGHT) #
  183. BEGIN
  184. CTEMP = C<I,1>VALUE; # MASK CHARACTER #
  185. IF CTEMP NQ 0 # IF CHARACTER IS NOT BLANK #
  186. THEN
  187. BEGIN
  188. IF CTEMP GQ ZERO AND
  189. CTEMP LQ NINE # IF CHARACTER IS A DECIMAL NUM #
  190. THEN
  191. BEGIN
  192. CTEMP = CTEMP - ZERO; # CALCULATE VALUE #
  193. NUMBER = NUMBER + (CTEMP * 10**EXPONENT);
  194. EXPONENT = EXPONENT + 1; # INCREMENT EXPONENT VALUE #
  195. END
  196. ELSE # CHARACTER IS NOT DECIMAL #
  197. BEGIN
  198. SUCCESS = FALSE; # SET ERROR STATUS #
  199. END
  200. END
  201. END
  202. RETURN; # **** RETURN ***** #
  203. END
  204. CONTROL EJECT;
  205. PROC LFGCKFN(FNAME,SUCCESS);
  206. BEGIN # CHECK FILE NAME #
  207.  
  208. ITEM CHAR C(1);
  209. ITEM FNAME C(7); # FILE NAME CANDIDATE #
  210. ITEM III U; # LOOP VARIABLE #
  211. ITEM SUCCESS B;
  212.  
  213. ARRAY CNA [0:0] S(4);
  214. BEGIN
  215. ITEM CNA1 C(0,0,38) =
  216. [" FILE NAME CHARACTER NOT ALPHANUMERIC."];
  217. ITEM CNAZ U(3,48,12) = [ 0 ];
  218. END
  219.  
  220. ARRAY ZFFN [0:0] S(3);
  221. BEGIN
  222. ITEM ZFFN1 C(0,0,23) =
  223. [" ZERO FILLED FILE NAME."];
  224. ITEM ZFFNZ U(2,18,42) = [ 0 ];
  225. END
  226.  
  227. SUCCESS = TRUE;
  228. FOR III = 0 STEP 1 UNTIL 6 DO
  229. BEGIN # FOR EACH CHARACTER IN THE FILE NAME #
  230. CHAR = C<III,1>FNAME;
  231. IF III EQ 0 AND CHAR EQ 0
  232. THEN # ZERO FILLED NAME #
  233. BEGIN
  234. MESSAGE(ZFFN,0);
  235. SUCCESS = FALSE;
  236. RETURN; # ***** EXIT ***** #
  237.  
  238. END
  239. IF CHAR EQ 0
  240. THEN # END OF FILE NAME #
  241. BEGIN
  242. RETURN; # ***** EXIT ***** #
  243.  
  244. END
  245. IF CHAR GR O"44"
  246. THEN # IT IS NOT ALPHANUMERIC #
  247. BEGIN
  248. MESSAGE(CNA,0);
  249. SUCCESS = FALSE;
  250. RETURN; # ***** EXIT ***** #
  251.  
  252. END
  253. END # GET NEXT CHARACTER #
  254. END # END OF ROUTINE #
  255. CONTROL EJECT;
  256. P<PARAMS> = PRMLIST; # PARAMETERS IN JOB COMMUNICATION AREA #
  257. P<PARAM$WC> = PLWC; # POINT ARRAY TO WORD COUNT #
  258. LISTFLG = TRUE; # SET LISTING REQUESTED FLAG #
  259. SUCCESS = TRUE;
  260. Z$USED = FALSE;
  261. J = 0;
  262. IF PLIST$WC[0] EQ 0 # IF NO PARAMETERS SPECIFIED #
  263. THEN
  264. BEGIN
  265. DONEII = TRUE; # SET DONE FLAG #
  266. END
  267. ELSE # PARAMTERS SPECIFIED #
  268. BEGIN
  269. DONEII = FALSE; # CLEAR DONE FLAG #
  270. END
  271. FOR II=0 WHILE NOT DONEII AND SUCCESS
  272. DO
  273. BEGIN # FOR EACH WORD BEGINNING AT RA+2 #
  274. J = J + 1;
  275. IF J GR PLIST$WC[0] # IF REACHED END OF PARAMETER LIST #
  276. THEN
  277. BEGIN
  278. DONEII = TRUE; # SET DONE FLAG #
  279. END
  280. IF NOT DONEII
  281. THEN
  282. BEGIN
  283. SWTCHVCTR = 0; # SET SWITCH VECTOR TO UNKNOWN #
  284. FOR K=0 STEP 1 UNTIL MAXPT
  285. DO # FOR EACH ENTRY IN PARAMETER TABLE #
  286. BEGIN
  287. IF PT$NAME[K] EQ PARVAL[J]
  288. THEN # IF PARAMTER IS IN TABLE #
  289. BEGIN
  290. SWTCHVCTR = PT$SWTCHV[K];# SAVE SWITCH VALUE #
  291. END
  292. END
  293. GOTO GFNSWTCH[SWTCHVCTR]; # JUMP TO APPROPRIATE PARAGRAPH #
  294. I$PRM: # I PARAMETER IS SPECIFIED #
  295. IF PARCODE[J] NQ EQUAL
  296. THEN # NO EQUALS SIGN #
  297. BEGIN
  298. NOVAL2[0] = " I";
  299. MESSAGE(NOVAL,0);
  300. SUCCESS = FALSE;
  301.  
  302. END
  303. ELSE # AN EQUAL WAS SPECIFIED #
  304. BEGIN
  305. J = J + 1; # POINT TO FILE NAME #
  306. LFGCKFN(PARVAL[J],SUCCESS);# CHECK FILE NAME #
  307. P<SIOFET> = LOC(INPUT);
  308. FETLFN[0] = PARVAL[J]; # PUT FILE NAME IN INPUT FET #
  309. END
  310. GOTO NEXT;
  311. L$PRM: # L PARAMETER IS SPECIFIED #
  312. IF PARCODE[J] NQ EQUAL
  313. THEN # NO = SIGN AFTER L PARAMETER #
  314. BEGIN
  315. NOVAL2[0] = " L";
  316. MESSAGE(NOVAL,0);
  317. SUCCESS = FALSE;
  318. END
  319. ELSE # AN EQUAL WAS SPECIFIED #
  320. BEGIN
  321. J = J + 1;
  322. IF PARVAL[J] EQ NO$LIST
  323. THEN # IF NO OUTPUT LISTING REQUESTED #
  324. BEGIN
  325. LISTFLG = FALSE; # CLEAR LISTING FLAG #
  326. END
  327. ELSE # FILE NAME WAS SPECIFIED #
  328. BEGIN
  329. LFGCKFN(PARVAL[J],SUCCESS); # CHECK FILE NAME #
  330. P<SIOFET> = LOC(OUTPUT);
  331. FETLFN[0] = PARVAL[J];
  332. END
  333. END
  334. GOTO NEXT;
  335. NLF$PRM: # NLF PARAMETER IS SPECIFIED #
  336. IF PARCODE[J] NQ EQUAL
  337. THEN # NO = SIGN AFTER NLF #
  338. BEGIN
  339. NOVAL2[0] = "NLF";
  340. MESSAGE(NOVAL,0);
  341. SUCCESS = FALSE;
  342. END
  343. ELSE # AN EQUAL WAS SPECIFIED #
  344. BEGIN
  345. J = J + 1; # GO TO NEXT WORD IN JOB COMM. AREA #
  346. LFGCKFN(PARVAL[J],SUCCESS); # CHECK FILE NAME #
  347. P<SIOFET> = WFET;
  348. FETLFN[0] = PARVAL[J];
  349. END
  350. GOTO NEXT;
  351. Z$PRM: # Z PARAMETER IS SPECIFIED #
  352. IF PARCODE[J] EQ COMMA OR # IF DELIMITER IS COMMA OR -)- #
  353. PARCODE[J] EQ PARTERM
  354. THEN
  355. BEGIN
  356. LFGZAP(INPUT); # CALL *Z* ARGUMENT PROCESSOR #
  357. Z$USED = TRUE; # SET Z SPECIFIED FLAG #
  358. END
  359. ELSE # DELIMITER IS NOT VALID #
  360. BEGIN
  361. IF PARCODE EQ EQUAL # TRIED TO ASSIGN VALUE TO Z #
  362. THEN
  363. BEGIN
  364. J = J + 1; # POINT TO NEXT WORD #
  365. MESSAGE(NO$EQUAL,0);
  366. SUCCESS = FALSE;
  367. END
  368. ELSE # CONNOT RECOGNIZE DELIMITER #
  369. BEGIN
  370. MESSAGE(UNREC$DELIM,0);
  371. SUCCESS = FALSE;
  372. END
  373. END
  374. GOTO NEXT;
  375. BC$PRM: # BC PARAMETER IS SPECIFIED #
  376. IF PARCODE[J] NQ EQUAL
  377. THEN # NO EQUAL AFTER BC #
  378. BEGIN
  379. NOVAL2[0] = "BC";
  380. MESSAGE(NOVAL,0);
  381. SUCCESS = FALSE;
  382. END
  383. ELSE # AN EQUAL WAS SPECIFIED #
  384. BEGIN
  385. J = J + 1; # POINT TO NEXT WORD #
  386. LFGCDN(PARVAL[J],BC$VAL,SUCCESS); # CHECK DECIMAL NUMBER #
  387. IF NOT SUCCESS
  388. THEN # IF NOT A DECIMAL NUMBER #
  389. BEGIN
  390. MESSAGE(NOT$DEC,0);
  391. END
  392. ELSE # NUMBER VALUE IS O.K. #
  393. BEGIN
  394. IF BC$VAL LS MIN$BC OR
  395. BC$VAL GR MAX$BC # IF VALUE IS NOT IN RANGE #
  396. THEN
  397. BEGIN
  398. MESSAGE(BC$RANGE,0);
  399. SUCCESS = FALSE;
  400. END
  401. END
  402. END
  403. GOTO NEXT;
  404. UNK: # UNKNOWN PARAMETER #
  405. MESSAGE(UNREC$PRM,0); # SENT DAYFILE MESSAGE #
  406. SUCCESS = FALSE; # CLEAR SUCCESS FLAG #
  407. IF PARCODE[J] EQ EQUAL
  408. THEN # IF VALUE ASSIGNED TO UNKNOWN PARAMETER #
  409. BEGIN
  410. J = J + 1; # SKIP THE VALUE #
  411. END
  412. NEXT:
  413. IF PARCODE[J] NQ COMMA AND # IF DELIM IS NOT COMMA OR -)- #
  414. PARCODE[J] NQ PARTERM
  415. THEN
  416. BEGIN
  417. MESSAGE(UNREC$DELIM,0); # SEND DAYFILE MESSAGE #
  418. SUCCESS = FALSE; # CLEAR SUCCESS FLAG #
  419. END
  420. END
  421. END
  422. IF NOT SUCCESS # IF ERRORS WERE DETECTED #
  423. THEN
  424. BEGIN
  425. ABORT; # ABORT JOB #
  426. END
  427. IF NOT Z$USED # IF -Z- WAS NOT SPECIFED #
  428. THEN
  429. BEGIN
  430. READ(INPUT); # FILL CIO BUFFER WITH INPUT DIRECTIVES #
  431. RECALL(INPUT);
  432. END
  433. RETURN; # **** RETURN **** #
  434. END TERM
cdc/nos2.source/nam5871/lfgcrak.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator