User Tools

Site Tools


cdc:nos2.source:nam5871:csiccc

CSICCC

Table Of Contents

  • [00004] PROC CSICCC
  • [00005] CONTROL CARD CRACKER.
  • [00009] CONTROL CARD CRACKER.
  • [00037] PROC CSIIAP
  • [00038] PROC CSUCDB
  • [00039] PROC MESSAGE

Source Code

CSICCC.txt
  1. *DECK CSICCC
  2. USETEXT TEXTCS
  3. USETEXT TEXTSS
  4. PROC CSICCC;
  5. # TITLE - CONTROL CARD CRACKER. #
  6.  
  7. BEGIN
  8. #
  9. ** CSICCC - CONTROL CARD CRACKER.
  10. *
  11. * J.C. LEE 81/01/02 (FOR NS)
  12. * D.K. ENDO 82/06/03 (MODIFIED FOR CS)
  13. *
  14. * THIS PROCEDURE CRACKS THE CONTROL, SAVES THE VALID VALUES, AND
  15. * FLAGS ERRORS IF FOUND.
  16. *
  17. * PROC CSICCC
  18. *
  19. * ENTRY 1. ARGUMENT LIST IN COMMUNICATION AREA
  20. *
  21. * EXIT 1. NIN, MC, CP AND BU VALUES.
  22. * 2. ERROR MESSAGE IN DAYFILE IF NEEDED.
  23. *
  24. * METHOD
  25. *
  26. * LOOP THRU THE ARGUMENT LIST. FOR EACH OPTION SEARCH THE PARAM
  27. * TABLE FOR VALID OPTION. IF FOUND, JUMP TO APPROPRIATE PARAGRAPH
  28. * TO CONVERT AND SAVE VALUE, ELSE FLAG AS ILLEGAL OPTION.
  29. *
  30. #
  31.  
  32. #
  33. **** PROC CSICCC - XREF LIST BEGINS.
  34. #
  35. XREF
  36. BEGIN
  37. PROC CSIIAP; # INITIALIZATION ABORT PROCEDURE #
  38. PROC CSUCDB; # CONVERT DC DECIMAL TO BINARY #
  39. PROC MESSAGE; # PUTS MESSAGE IN DAYFILE #
  40. END
  41. #
  42. ****
  43. #
  44. #
  45.   DEFINITIONS FOR PARAMETER INDEXES
  46. #
  47. DEF PAR$COUNT #04#; # NUMBER OF VALID CS PARAMETERS #
  48. DEF PAR$NIN #01#; # NIN INDEX #
  49. DEF PAR$MC #02#; # MC INDEX #
  50. DEF PAR$CP #03#; # CPU UTILIZATION INDEX #
  51. DEF PAR$BU #04#; # BUFFER AVAILABILITY INDEX #
  52. #
  53.   MISCELLANEOUS DEFINITIONS
  54. #
  55. DEF COMMA # O"56" #;
  56. DEF EQUAL # O"54" #;
  57. DEF PERIOD # O"57" #;
  58. #
  59.   REASON CODES FOR CONTROL CARD ERRORS
  60. #
  61. DEF RC$PARILL #01#; # ILLEGAL PARAMETER #
  62. DEF RC$PARFMT #02#; # PARAMETER FORMAT ERROR #
  63. DEF RC$PARVAL #03#; # BAD PARAMETER VALUE #
  64. DEF RC$PARDUP #04#; # DUPLICATE PARAMETER #
  65. DEF RC$PARMIS #05#; # MISSING REQUIRED PARAMETER #
  66. #
  67.   LOCAL VARIABLES
  68. #
  69. ITEM ARGPTR I = 0; # ARGUMENT POINTER #
  70. ITEM ERR B; # ERROR INDICATOR #
  71. ITEM ERRCODE I = 0; # ERROR CODE #
  72. ITEM I I; # TEMPORARY VARIABLE #
  73. ITEM J U; # TEMPORARY VARIABLE #
  74. ITEM K U; # TEMPORARY VARIABLE #
  75. ITEM MATCH B; # FOUND VALID PARAMETER FLAG #
  76. ITEM NARGS U; # NO OF ARGUMENTS #
  77.  
  78.  
  79. BASED ARRAY ARG[1:22] S(1);
  80. BEGIN # RA.ARGR #
  81. ITEM ARG$SYMBO U(00,00,42); # ARGUMENT VALUE #
  82. ITEM ARG$SEPAR U(00,42,18); # ARGUMENT SEPARATOR #
  83. ITEM ARG$WORD U(00,00,60);
  84. END
  85. BASED ARRAY ACT[0:0] S(1);
  86. BEGIN
  87. ITEM ACT$COUNT U(00,42,18); # ARGUMENT COUNT #
  88. END
  89.  
  90. ARRAY PAR [1:PAR$COUNT] S(1);
  91. BEGIN # VALID PARAMETER LIST #
  92. ITEM PAR$KEY U(00,00,42) = [ # KEYWORDS #
  93. O"16111600000000", # NIN #
  94. O"15030000000000", # MC #
  95. O"03200000000000", # CP #
  96. O"02250000000000", # BU #
  97. ];
  98. ITEM PAR$NCV U(00,42,12) = [ # CHARS ALLOWED FOR PARAM VALUE#
  99. 3, # UP TO 3 DEC CHARS FOR NIN #
  100. 7, # UP TO 7 DEC CHARS FOR MC #
  101. 3, # UP TO 3 DEC CHARS FOR CP #
  102. 3, # UP TO 3 DEC CHARS FOR BU #
  103. ];
  104. ITEM PAR$PRC B(00,54,06) = [ # PARAMETER PROCESSED FLAG #
  105. FALSE,
  106. FALSE,
  107. FALSE,
  108. FALSE,
  109. ];
  110. END
  111. DEF L$PARERR # 5 #;
  112. DEF DM$PARERR # DM$SYSLOC+DM$ABORT #;
  113. ARRAY MSG$PARERR [RC$PARILL:RC$PARMIS] S(L$PARERR);
  114. BEGIN # CONTROL CARD ERROR DIAGNOSTICS #
  115. ITEM PEM$TEXT C(00,00,40) = [ # MESSAGE TEXT #
  116. " CS/UNRECOGNIZED CONTROL CARD PARAMETER.",
  117. " CS/CONTROL CARD PARAMETER SYNTAX ERROR.",
  118. " CS/ILLEGAL CONTROL CARD PARAM VALUE.",
  119. " CS/DUPLICATE CONTROL CARD PARAMETER.",
  120. " CS/NIN IS NOT SPECIFIED.",
  121. ];
  122. ITEM PEM$END U(04,00,60) = [ RC$PARMIS(0) ];
  123. END
  124.  
  125. SWITCH PARTYPE , # SWITCHES FOR PARAMETERS #
  126. TYPE$NIN,
  127. TYPE$MC,
  128. TYPE$CP,
  129. TYPE$BU;
  130. CONTROL EJECT;
  131. #
  132.   POINT BASED ARRAY TO COMMUNICATION AREA TO GET ARGUMENT LIST
  133.   AND ARGUMENT COUNT.
  134. #
  135. P<ARG> = 2;
  136. P<ACT> = O"64";
  137.  
  138.  
  139. #
  140.   INITIALIZE VALUES TO DEFAULT.
  141. #
  142. MC = DEFMC$;
  143. CSCP = DEFCP$;
  144. CSBU = DEFBU$;
  145.  
  146. #
  147.   LOOP TO PROCESS ALL SPECIFIED PARAMETERS
  148. #
  149. NARGS = ACT$COUNT[0]; # NO OF ARGUMENTS #
  150. FOR ARGPTR=ARGPTR WHILE ARGPTR LS NARGS
  151. AND ERRCODE EQ 0
  152. DO # SCAN RA+2 THRU RA+22 FOR ARGUMENTS #
  153. BEGIN
  154. ARGPTR = ARGPTR + 1; # MOVE POINTER TO NEXT ARGUMENT #
  155. MATCH = FALSE;
  156.  
  157. FOR I=1 STEP 1 WHILE I LQ PAR$COUNT
  158. AND NOT MATCH
  159. DO
  160. BEGIN
  161. IF ARG$SYMBO[ARGPTR] EQ PAR$KEY[I]
  162. THEN # FOUND VALID KEYWORD #
  163. BEGIN
  164. MATCH = TRUE;
  165. K = I; # SET TO KEYWORD INDEX #
  166. END
  167. END
  168.  
  169. IF MATCH
  170. THEN # FOUND VALID PARAMETER #
  171. BEGIN
  172. I = ARGPTR + 1; # POINTER TO PARAMETER VALUE #
  173.  
  174. IF (ARG$SEPAR[ARGPTR] EQ EQUAL)
  175. AND (I LQ NARGS)
  176. THEN # PARAMETER FORMAT OK #
  177. BEGIN
  178. ARGPTR = I; # UPDATE POINTER TO NEXT ARG #
  179. J = PAR$NCV[K]; # CHARS ALLOWED FOR VALUE #
  180.  
  181. IF J EQ 7
  182. OR C<J,7-J>ARG$SYMBO[ARGPTR] EQ 0
  183. THEN # PARAMETER VALUE NOT EXCEEDING #
  184. BEGIN # MAX NUMBER OF CHARS ALLOWED #
  185. #
  186.   SWITCH TO PARAMETER PROCESSING CASES
  187. #
  188. GOTO PARTYPE[K];
  189. TYPE$NIN:
  190. I = PAR$NIN;
  191. CSUCDB(ARG$WORD[ARGPTR],K,J,ERR); # CONVERT DEC TO BIN #
  192. CRNT$NIN = K; # SET NETWORK INVOCATION NUMBER #
  193. GOTO ENDPRC;
  194. TYPE$MC:
  195. I = PAR$MC;
  196. CSUCDB(ARG$WORD[ARGPTR],K,J,ERR) ; # CONVERT DEC TO BIN #
  197. MC = K;
  198. GOTO ENDPRC;
  199. TYPE$CP:
  200. I = PAR$CP;
  201. CSUCDB(ARG$WORD[ARGPTR],K,J,ERR);
  202. CSCP = K;
  203. GOTO ENDPRC;
  204. TYPE$BU:
  205. I=PAR$BU;
  206. CSUCDB(ARG$WORD[ARGPTR],K,J,ERR);
  207. CSBU = K;
  208. GOTO ENDPRC;
  209. ENDPRC:
  210. IF NOT ERR
  211. THEN # NO ERROR FOUND #
  212. BEGIN
  213. IF NOT PAR$PRC[I]
  214. THEN # PARAMETER NOT PROCESSED #
  215. BEGIN
  216. PAR$PRC[I] = TRUE; # SET PARAMETER PROCESSED FLAG #
  217. END
  218.  
  219. ELSE # DUPLICATE PARAMETER #
  220. ERRCODE = RC$PARDUP;
  221. END
  222.  
  223. ELSE # BAD PARAMETER VALUE #
  224. ERRCODE = RC$PARVAL;
  225. END
  226.  
  227. ELSE # CHARS EXCEED ALLOWED VALUE #
  228. ERRCODE = RC$PARVAL;
  229. END
  230.  
  231. ELSE # PARAMETER FORMAT ERROR #
  232. ERRCODE = RC$PARFMT;
  233. END
  234.  
  235. ELSE # ILLEGAL PARAMETER #
  236. ERRCODE = RC$PARILL;
  237. END
  238.  
  239. IF ERRCODE EQ 0
  240. AND NOT PAR$PRC[PAR$NIN]
  241. THEN # NIN MUST BE SPECIFIED #
  242. ERRCODE = RC$PARMIS;
  243.  
  244. IF ((CSCP LS MINCP$) OR (CSCP GR MAXCP$))
  245. OR ((CSBU LS MINBU$) OR (CSBU GR MAXBU$))
  246. THEN
  247. BEGIN
  248. ERRCODE = RC$PARVAL;
  249. END
  250.  
  251. IF ERRCODE NQ 0
  252. THEN # ERROR FOUND #
  253. BEGIN
  254. MESSAGE(MSG$PARERR[ERRCODE],0);
  255. CSIIAP;
  256. END
  257. RETURN;
  258. END
  259. TERM
cdc/nos2.source/nam5871/csiccc.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator