User Tools

Site Tools


cdc:nos2.source:nam5871:dldirc1

DLDIRC1

Table Of Contents

  • [00006] PROC DLDIRC1(LEFTSYM, ERRCODE)
  • [00047] PROC DLCKDA
  • [00048] PROC DLCKTI
  • [00049] PROC DLCONVH
  • [00050] PROC DLCONVT

Source Code

DLDIRC1.txt
  1. *DECK DLDIRC1
  2. USETEXT DLFPDEF
  3. USETEXT DIERR
  4. USETEXT DIRTBL
  5. USETEXT VDDIR
  6. PROC DLDIRC1(LEFTSYM, ERRCODE);# INDIVIDUAL DIRECTIVE PROCESSOR #
  7. *IF DEF,IMS
  8. #
  9. *1DC DLDIRC1
  10. *
  11. * 1.PROC NAME AUTHOR DATE.
  12. * DLDIRC1 P.C.TAM 78/11/10
  13. *
  14. * 2. FUNCTIONAL DESCRIPTION.
  15. * INDIVIDUAL DIRECTIVE PROCESSOR
  16. *
  17. * 3. METHOD USED.
  18. * MATCH INPUT AGAINST VALID DIRECTIVE LIST,
  19. * GET ITS MATCH AND PROCEED TO PROCESS INPUT
  20. *
  21. * 4. ENTRY PARAMETER.
  22. * LEFTSYM DIRECTIVE ITEM ASSEMBLED
  23. *
  24. * 5. EXIT PARAMETER.
  25. * ERRCODE RETURN IF ERROR ENCOUNTERED
  26. * DURING PROCESSING
  27. *
  28. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  29. * DIERR DIRTBL DLFPDEF VDDIR
  30. *
  31. * 7. ROUTINES CALLED.
  32. * DLCKDA CHECK DATE FOR ERROR
  33. * DLCKTI CHECK TIME FOR ERROR
  34. * DLCONVH CONVERT HEX TO BINARY
  35. * DLCONVT CONVERT DECIMAL TO BINARY
  36. *
  37. * 8. DAYFILE MESSAGES.
  38. * NONE.
  39. *
  40.  #
  41. *ENDIF
  42. #
  43.   EXTERNAL VARIABLES
  44. #
  45. XREF
  46. BEGIN
  47. PROC DLCKDA; # CHECK DATE FOR ERROR #
  48. PROC DLCKTI; # CHECK CLOCK TIME FOR ERROR #
  49. PROC DLCONVH; # CONVERT DISPLAY HEXADECIMAL TO BINARY #
  50. PROC DLCONVT; # CONVERT DISPLAY DECIMAL TO BINARY #
  51. END
  52. #
  53.   LOCAL VARIABLES
  54. #
  55. SWITCH DIRTYPE
  56. , L$BD, L$BT, L$CN, L$DN, L$ED, L$ET, L$LE,
  57. L$NM, L$PS, L$PF, L$SM, L$SN,
  58. L$B, L$C, L$E, L$F, L$N,
  59. L$P, L$R, L$T, L$U, L$X;
  60. ITEM
  61. LEFTSYM I, # INPUT ASSEMBLED DIRECTIVE ITEM #
  62. ERRCODE I, # OUTPUT ERROR CODE IF ANY #
  63. CHART I, # TEMPORARY VARIABLE #
  64. LENGTH I, # TEMPORARY VARIABLE. #
  65. MATCH B, # TEMPORARY VARIABLE #
  66. I I, # TEMPORARY LOOP VARIABLE #
  67. K I, # TEMPORARY VARIABLE #
  68. UNPWD I, # TEMPORARY VARIABLE #
  69. UNPTR I; # TEPORARY VARIABLE #
  70.  
  71. # ******************************************************************** #
  72. BEGIN
  73.  
  74. # PRESET LOCAL VARIABLES #
  75.  
  76. ERRCODE = 0;
  77. MATCH = FALSE;
  78.  
  79. # LOOP TO MATCH INPUT WITH VALID DIRECTIVES #
  80.  
  81. FOR I = 1 STEP 1 WHILE I LQ DIRNO AND NOT MATCH
  82. DO
  83. BEGIN # LOOP TO FIND A MATCH #
  84. K = VDLEN[I]; # LENGTH OF DIRECTIVE KEYWORD #
  85. IF C<0, K>LEFTSYM EQ C<0, K>VDENTR[I]
  86. THEN
  87. BEGIN
  88. MATCH = TRUE;
  89. K = I;
  90. END
  91. END
  92. IF NOT MATCH
  93. THEN
  94. BEGIN # ILLEGAL DIRECTIVE #
  95. ERRCODE = D$ERR3;
  96. END
  97. ELSE
  98. BEGIN # MATCH FOUND #
  99.  
  100. # GET VALUE OF DIRECTIVE EXPRESSION IF ANY #
  101.  
  102. I = VDLEN[K]; # LENGTH OF DIRECTIVE #
  103. UNPWD = 0;
  104. UNPTR = 10 - I;
  105. C<0, UNPTR>UNPWD = C<I, UNPTR>LEFTSYM;
  106.  
  107. # SWITCH TO PROCESS DIFFERENT DIRECTIVES #
  108.  
  109. GOTO DIRTYPE[K];
  110.  
  111. L$BD: # BD= DIRECTIVE #
  112. DLCKDA(UNPWD, K); # CHECK DATE STRING #
  113. IF K EQ 0
  114. THEN
  115. BEGIN # SET SELECTION VALUE #
  116. DIRVALU[ID$BD] = LEFTSYM;
  117. DIRID[ID$BD] = ID$BD;
  118. END
  119. ELSE # ERROR IN BD= DIRECTIVE #
  120. ERRCODE = D$BDER;
  121. GOTO ENDP;
  122.  
  123. L$BT: # BT= DIRECTIVE #
  124. DLCKTI(UNPWD, K); # CHECK TIME FOR ERROR #
  125. IF K EQ 0
  126. THEN
  127. BEGIN # SET SELECTION VALUE #
  128. DIRVALU[ID$BT] = LEFTSYM;
  129. DIRID[ID$BT] = ID$BT;
  130. END
  131. ELSE # ERROR IN BT= DIRECTIVE #
  132. ERRCODE = D$BTER;
  133. GOTO ENDP;
  134.  
  135. L$CN: # CN= DIRECTIVE #
  136. DLCONVT(UNPWD, K, MATCH);# CONVERT DECIMAL DC TO BIN #
  137. IF MATCH AND # NUMERIC FIELD #
  138. MINCN LQ K AND K LQ MAXCN AND# CN WITH RANGE #
  139. C<I, 1> LEFTSYM NQ 0# CONNECTION NUMBER PRESENTS #
  140. THEN
  141. BEGIN
  142. DIRVALU[ID$CN] = K; # SET CONNECTION NUMBER SELECTED #
  143. DIRID[ID$CN] = ID$CN; # SET ID FIELD #
  144. END
  145. ELSE # ERROR IN CN= DIRECTIVE #
  146. BEGIN
  147. ERRCODE = D$CNER;
  148. END
  149. GOTO ENDP;
  150.  
  151. L$DN: # DN= DIRECTIVE #
  152. DLCONVT(UNPWD, K, MATCH);# CONVERT DECIMAL DC TO BINARY #
  153. IF MATCH AND # FIELD NUMERIC #
  154. C<I, 1> LEFTSYM NQ 0# DESTINATION NUMBER PRESENT #
  155. THEN
  156. BEGIN # SET DIRECTIVE VALUE #
  157. DIRVALU[ID$DN] = K;
  158. DIRID[ID$DN] = ID$DN;
  159. END
  160. ELSE # ERROR IN DN= DIRECTIVE #
  161. ERRCODE = D$DNER; # ERROR IN DN= DIRECTIVE #
  162. GOTO ENDP;
  163.  
  164. L$ED: # ED= DIRECTIVE #
  165. DLCKDA(UNPWD, K); # CHECK DATE STRING #
  166. IF K EQ 0
  167. THEN
  168. BEGIN # SET SELECTION VALUE #
  169. DIRVALU[ID$ED] = LEFTSYM;
  170. DIRID[ID$ED] = ID$ED;
  171. END
  172. ELSE # ERROR IN ED= DIRECTIVE #
  173. ERRCODE = D$EDER;
  174. GOTO ENDP;
  175.  
  176. L$ET: # ET= DIRECTIVE #
  177. DLCKTI(UNPWD, K); # CHECK TIME FOR ERROR #
  178. IF K EQ 0
  179. THEN
  180. BEGIN # SET SELECTION VALUE #
  181. DIRVALU[ID$ET] = LEFTSYM;
  182. DIRID[ID$ET] = ID$ET;
  183. END
  184. ELSE # ERROR IN ET= DIRECTIVE #
  185. ERRCODE = D$ETER;
  186. GOTO ENDP;
  187.  
  188. L$LE: # LE= DIRECTIVE #
  189. DLCONVT(UNPWD, K, MATCH);# CONVERT DECIMAL DC TO BINARY #
  190. IF MATCH AND # NUMERIC VALUE #
  191. C<I, 1> LEFTSYM NQ 0 AND# VALUE PRESENT #
  192. 1 LQ K AND K LQ TLWMAX # LENGTH WITHIN RANGE #
  193. THEN
  194. BEGIN # SET SELECTION VALUE #
  195. DIRVALU[ID$LE] = K;
  196. DIRID[ID$LE] = ID$LE;
  197. END
  198. ELSE # ERROR IN LE= DIRECTIVE #
  199. BEGIN
  200. ERRCODE = D$LEER;
  201. END
  202. GOTO ENDP;
  203.  
  204. L$NM: # NM= DIRECTIVE #
  205. DLCONVT(UNPWD, K, MATCH);# CONVERT DECIMAL DC TO BINARY #
  206. IF MATCH AND # NUMERIC FIELD #
  207. C<I, 1> LEFTSYM NQ 0 AND # VALUE PRESENT #
  208. (0 LQ K AND K LQ 1000000) # RANGE 0 TO 1000000 #
  209. THEN
  210. BEGIN # SET SELECTION VALUE #
  211. DIRVALU[ID$NM] = K;
  212. DIRID[ID$NM] = ID$NM;
  213. END
  214. ELSE # ERROR IN NM= DIRECTIVE #
  215. BEGIN
  216. ERRCODE = D$NMER;
  217. END
  218. GOTO ENDP;
  219.  
  220. L$PS: # PS= DIRECTIVE #
  221. DLCONVH(UNPWD,K,CHART,LENGTH); # CONVERT HEX DC TO BINARY. #
  222. IF CHART EQ 0 AND LENGTH EQ 4 # CONVERSION OK. #
  223. THEN
  224. BEGIN
  225. DIRVALU[ID$PS] = K;
  226. DIRID[ID$PS] = ID$PS;
  227. DIRWD0[ID$PF] = 0;
  228. END
  229. ELSE # ERROR IN PS= DIRECTIVE #
  230. ERRCODE = D$PSER;
  231. GOTO ENDP;
  232.  
  233. L$PF: # PF= DIRECTIVE #
  234. DLCONVH(UNPWD,K,CHART,LENGTH); # CONVERT HEX DC TO BINARY. #
  235. IF CHART EQ 0 AND LENGTH EQ 2 # CONVERSION OK. #
  236. THEN
  237. BEGIN
  238. DIRVALU[ID$PF] = K;
  239. DIRID[ID$PF] = ID$PF;
  240. DIRWD0[ID$PS] = 0;
  241. END
  242. ELSE # ERROR IN PF= DIRECTIVE #
  243. ERRCODE = D$PFER;
  244. GOTO ENDP;
  245.  
  246. L$SM: # SM= DIRECTIVE #
  247. DLCONVT(UNPWD, K, MATCH);# CONVERT DECIMAL DC TO BINARY #
  248. IF MATCH AND # SUPPRESS MESSAGE NUMBER NUMERIC #
  249. C<I, 1> LEFTSYM NQ 0 AND # VALUE PRESENT #
  250. (0 LQ K AND K LQ 1000000) # RANGE 0 TO 1000000 #
  251. THEN
  252. BEGIN
  253. DIRVALU[ID$SM] = K;
  254. DIRID[ID$SM] = ID$SM;
  255. END
  256. ELSE # ERROR IN SM= DIRECTIVE #
  257. BEGIN
  258. ERRCODE = D$SMER;
  259. END
  260. GOTO ENDP;
  261.  
  262. L$SN: # SN= DIRECTIVE #
  263. DLCONVT(UNPWD, K, MATCH);# CONVERT DECIMAL DC TO BINARY #
  264. IF MATCH AND # SOURCE NUMBER NUMERIC #
  265. C<I,1>LEFTSYM NQ 0 # NUMBER PRESENT #
  266. THEN
  267. BEGIN # SET DIRECTIVE VALUE #
  268. DIRVALU[ID$SN] = K;
  269. DIRID[ID$SN] = ID$SN;
  270. END
  271. ELSE # ERROR IN SN= DIRECTIVE #
  272. ERRCODE = D$SNER;
  273. GOTO ENDP;
  274.  
  275. L$B: # B DIRECTIVE #
  276. IF C<I,1>LEFTSYM EQ 0 # VALID B DIRECTIVE #
  277. THEN
  278. BEGIN # SET B DIRECTIVE SELECTED #
  279. DIRVALU[ID$B] = 1;
  280. DIRID[ID$B] = ID$B;
  281. END
  282. ELSE # ERROR IN B DIRECTIVE #
  283. ERRCODE = D$BERR;
  284. GOTO ENDP;
  285.  
  286. L$C: # C DIRECTIVE #
  287. IF C<I,1>LEFTSYM EQ 0 # VALID C DIRECTIVE #
  288. THEN
  289. BEGIN # SET C DIRECTIVE SELECTED #
  290. DIRVALU[ID$C] = 1;
  291. DIRID[ID$C] = ID$C;
  292. END
  293. ELSE # ERROR IN C DIRECTIVE #
  294. ERRCODE = D$CERR;
  295. GOTO ENDP;
  296.  
  297. L$E: # E DIRECTIVE #
  298. IF C<I,1>LEFTSYM EQ 0 # VALID E DIRECTIVE #
  299. THEN
  300. BEGIN # SET E DIRECTIVE SELECTED #
  301. DIRVALU[ID$E] = 1;
  302. DIRID[ID$E] = ID$E;
  303. END
  304. ELSE # ERROR IN E DIRECTIVE #
  305. ERRCODE = D$EERR;
  306. GOTO ENDP;
  307.  
  308. L$F: # F DIRECTIVE #
  309. IF C<I,1>LEFTSYM EQ 0 # VALID F DIRECTIVE #
  310. THEN
  311. BEGIN # SET F DIRECTIVE SELECTED #
  312. DIRVALU[ID$F] = 1;
  313. DIRID[ID$F] = ID$F;
  314. END
  315. ELSE # ERROR IN F DIRECTIVE #
  316. ERRCODE = D$FERR;
  317. GOTO ENDP;
  318.  
  319. L$N: # N DIRECTIVE #
  320. IF C<I>LEFTSYM EQ 0 # VALID N DIRECTIVE #
  321. THEN
  322. BEGIN # SET N DIRECTIVE SELECTED #
  323. DIRVALU[ID$N] = 1;
  324. DIRID[ID$N] = ID$N;
  325. END
  326. ELSE
  327. ERRCODE = D$NERR; # ERROR IN N DIRECTIVE #
  328. GOTO ENDP;
  329.  
  330. L$P: # P DIRECTIVE #
  331. IF C<I,1>LEFTSYM EQ 0 # VALID P DIRECTIVE #
  332. THEN
  333. BEGIN # SET P DIRECTIVE SELECTED #
  334. DIRVALU[ID$P] = 1;
  335. DIRID[ID$P] = ID$P;
  336. END
  337. ELSE # ERROR IN P DIRECTIVE #
  338. ERRCODE = D$PERR;
  339. GOTO ENDP;
  340.  
  341. L$R: # R DIRECTIVE #
  342. IF C<I,1>LEFTSYM EQ 0 # VALID R DIRECTIVE #
  343. THEN
  344. BEGIN # SET R DIRECTIVE SELECTED #
  345. DIRVALU[ID$R] = 1;
  346. DIRID[ID$R] = ID$R;
  347. END
  348. ELSE
  349. ERRCODE = D$RERR;
  350. GOTO ENDP;
  351.  
  352. L$T: # T DIRECTIVE #
  353. IF C<I,1>LEFTSYM EQ 0 # VALID T DIRECTIVE #
  354. THEN
  355. BEGIN # SET T DIRECTIVE SELECTED #
  356. DIRVALU[ID$T] = 1;
  357. DIRID[ID$T] = ID$T;
  358. END
  359. ELSE # ERROR IN E DIRECTIVE #
  360. ERRCODE = D$TERR;
  361. GOTO ENDP;
  362.  
  363. L$U: # U DIRECTIVE #
  364. IF C<I,1>LEFTSYM EQ 0 # VALID U DIRECTIVE #
  365. THEN
  366. BEGIN # SET U DIRECTIVE SELECTED #
  367. DIRVALU[ID$U] = 1;
  368. DIRID[ID$U] = ID$U;
  369. END
  370. ELSE # ERROR IN U DIRECTIVE #
  371. ERRCODE = D$UERR;
  372. GOTO ENDP;
  373.  
  374. L$X: # X DIRECTIVE #
  375. IF C<I,1>LEFTSYM EQ 0 # VALID X DIRECTIVE #
  376. THEN
  377. BEGIN # SET X DIRECTIVE SELECTED #
  378. DIRVALU[ID$X] = 1;
  379. DIRID[ID$X] = ID$X;
  380. END
  381. ELSE # ERROR IN R DIRECTIVE #
  382. ERRCODE = D$XERR;
  383.  
  384. ENDP:
  385. END
  386. END
  387. TERM
cdc/nos2.source/nam5871/dldirc1.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator