*DECK NVFICSC USETEXT TEXTNVF USETEXT TEXTSS PROC NVFICSC; # TITLE - CONTROL STATEMENT CRACKER # BEGIN # ** NVFICSC - CONTROL STATEMENT CRACKER. * * J.C. LEE 81/01/02 (FOR NS) * D.K. ENDO 82/06/03 (MODIFIED FOR NVF) * * THIS PROCEDURE CRACKS THE CONTROL STATEMENT, SAVES THE VALID * VALUES, AND FLAGS ERRORS IF FOUND. * * PROC NVFICSC * * ENTRY 1. ARGUMENT LIST IN COMMUNICATION AREA * * EXIT 1. NIN, MC, AL, AND LL VALUES. * 2. ERROR MESSAGE IN DAYFILE IF NEEDED. * * METHOD * * LOOP THRU THE ARGUMENT LIST. FOR EACH OPTION SEARCH THE PARAM * TABLE FOR VALID OPTION. IF FOUND, JUMP TO APPROPRIATE PARAGRAPH * TO CONVERT AND SAVE VALUE, ELSE FLAG AS INVALID OPTION. * # # **** PROC NVFICSC - XREF LIST BEGINS. # XREF BEGIN PROC NVFIIAP; # INITIALIZATION ABORT PROCEDURE # PROC NVFUCDB; # CONVERT DC DECIMAL TO BINARY # PROC MESSAGE; # PUTS MESSAGE IN DAYFILE # END # **** # # DEFINITIONS FOR PARAMETER INDEXES # DEF PAR$COUNT #04#; # NUMBER OF VALID NVF PARAMETERS# DEF PAR$NIN #01#; # NIN INDEX # DEF PAR$MC #02#; # MC INDEX # DEF PAR$AL #03#; # AL INDEX # DEF PAR$LL #04#; # LL INDEX # # MISCELLANEOUS DEFINITIONS # DEF COMMA # O"56" #; DEF EQUAL # O"54" #; DEF MAXAL$ # 256 #; DEF MAXLL$ # 04 #; DEF MINAL$ # 01 #; DEF MINLL$ # 01 #; DEF PERIOD # O"57" #; # REASON CODES FOR CONTROL STATEMENT ERRORS # DEF RC$PARILL #01#; # INVALID PARAMETER # DEF RC$PARFMT #02#; # PARAMETER FORMAT ERROR # DEF RC$PARVAL #03#; # BAD PARAMETER VALUE # DEF RC$PARDUP #04#; # DUPLICATE PARAMETER # DEF RC$PARMIS #05#; # MISSING REQUIRED PARAMETER # # LOCAL VARIABLES # ITEM ARGPTR I = 0; # ARGUMENT POINTER # ITEM ERR B; # ERROR INDICATOR # ITEM ERRCODE I = 0; # ERROR CODE # ITEM I I; # TEMPORARY VARIABLE # ITEM J U; # TEMPORARY VARIABLE # ITEM K U; # TEMPORARY VARIABLE # ITEM MATCH B; # FOUND VALID PARAMETER FLAG # ITEM NARGS U; # NO OF ARGUMENTS # BASED ARRAY ARG[1:22] S(1); BEGIN # RA.ARGR # ITEM ARG$SYMBO U(00,00,42); # ARGUMENT VALUE # ITEM ARG$SEPAR U(00,42,18); # ARGUMENT SEPARATOR # ITEM ARG$WORD U(00,00,60); END BASED ARRAY ACT[0:0] S(1); BEGIN ITEM ACT$COUNT U(00,42,18); # ARGUMENT COUNT # END ARRAY PAR [1:PAR$COUNT] S(1); BEGIN # VALID PARAMETER LIST # ITEM PAR$KEY U(00,00,42) = [ # KEYWORDS # O"16111600000000", # NIN # O"15030000000000", # MC # O"01140000000000", # AL # O"14140000000000", # LL # ]; ITEM PAR$NCV U(00,42,12) = [ # CHARS ALLOWED FOR PARAM VALUE# 3, # UP TO 3 DEC CHARS FOR NIN # 7, # UP TO 7 DEC CHARS FOR MC # 1, # ONLY 1 DEC CHARS FOR AL # 1, # ONLY 1 DEC CHARS FOR LL # ]; ITEM PAR$PRC B(00,54,06) = [ # PARAMETER PROCESSED FLAG # FALSE, FALSE, FALSE, FALSE, ]; END DEF L$PARERR # 6 #; DEF DM$PARERR # DM$SYSLOC+DM$ABORT #; ARRAY MSG$PARERR [RC$PARILL:RC$PARMIS] S(L$PARERR); BEGIN # CONTROL STATMENT ERROR DIANOSTICS # ITEM PEM$TEXT C(00,00,50) = [ # MESSAGE TEXT # " NV/UNRECOGNIZED CONTROL STATEMENT PARAMETER.", " NV/CONTROL STATEMENT PARAMETER SYNTAX ERROR.", " NV/INVALID CONTROL STATEMENT PARAMETER VALUE.", " NV/DUPLICATE CONTROL STATEMENT PARAMETER.", " NV/NIN IS NOT SPECIFIED.", ]; ITEM PEM$END U(05,00,60) = [ RC$PARMIS(0) ]; END SWITCH PARTYPE , # SWITCHES FOR PARAMETERS # TYPE$NIN, TYPE$MC, TYPE$AL, TYPE$LL; CONTROL EJECT; # POINT BASED ARRAYS TO COMMNICATION AREA FOR PARAMETER LIST AND PARAMETER COUNT. # P = 2; P = O"64"; # INITIALIZE VALUES. # CRNT$DPN = 0; # CURRENT DUMP NUMBER # AL = DEFAL$; # AL VALUE # LLVAL = DEFLL$; # LL VALUE # MC = DEFMC$; # MC VALUE # # LOOP TO PROCESS ALL SPECIFIED PARAMETERS # NARGS = ACT$COUNT[0]; # NO OF ARGUMENTS # FOR ARGPTR=ARGPTR WHILE ARGPTR LS NARGS AND ERRCODE EQ 0 DO # SCAN RA+2 THRU RA+22 FOR ARGUMENTS # BEGIN ARGPTR = ARGPTR + 1; # MOVE POINTER TO NEXT ARGUMENT # MATCH = FALSE; FOR I=1 STEP 1 WHILE I LQ PAR$COUNT AND NOT MATCH DO BEGIN IF ARG$SYMBO[ARGPTR] EQ PAR$KEY[I] THEN # FOUND VALID KEYWORD # BEGIN MATCH = TRUE; K = I; # SET TO KEYWORD INDEX # END END IF MATCH THEN # FOUND VALID PARAMETER # BEGIN I = ARGPTR + 1; # POINTER TO PARAMETER VALUE # IF (ARG$SEPAR[ARGPTR] EQ EQUAL) AND (I LQ NARGS) THEN # PARAMETER FORMAT OK # BEGIN ARGPTR = I; # UPDATE POINTER TO NEXT ARG # J = PAR$NCV[K]; # CHARS ALLOWED FOR VALUE # IF J EQ 7 OR CARG$SYMBO[ARGPTR] EQ 0 THEN # PARAMETER VALUE NOT EXCEEDING # BEGIN # MAX NUMBER OF CHARS ALLOWED # # SWITCH TO PARAMETER PROCESSING CASES # GOTO PARTYPE[K]; TYPE$NIN: I = PAR$NIN; NVFUCDB(ARG$WORD[ARGPTR],K,J,ERR); # CONVERT DEC TO BIN # CRNT$NIN = K; # SET NETWORK INVOCATION NUMBER # GOTO ENDPRC; TYPE$MC: I = PAR$MC; NVFUCDB(ARG$WORD[ARGPTR],K,J,ERR); # CONVERT DEC TO BIN # MC = K; GOTO ENDPRC; TYPE$AL: I = PAR$AL; NVFUCDB(ARG$WORD[ARGPTR],K,J,ERR); # CONVERT DEC TO BIN # IF K GQ MINAL$ AND K LQ MAXAL$ THEN BEGIN AL = K; END ELSE BEGIN ERR = TRUE; END GOTO ENDPRC; TYPE$LL: I = PAR$LL; NVFUCDB(ARG$WORD[ARGPTR],K,J,ERR); # CONVERT DEC TO BIN # IF K GQ MINLL$ AND K LQ MAXLL$ THEN # IF VALUE IS WITHIN RANGE # BEGIN LLVAL = K; # SAVE LL VALUE # END ELSE # VALUE IS NOT IN RANGE # BEGIN ERR = TRUE; # SET ERROR FLAG # END GOTO ENDPRC; ENDPRC: IF NOT ERR THEN # NO ERROR FOUND # BEGIN IF NOT PAR$PRC[I] THEN # PARAMETER NOT PROCESSED # BEGIN PAR$PRC[I] = TRUE; # SET PARAMETER PROCESSED FLAG # END ELSE # DUPLICATE PARAMETER # ERRCODE = RC$PARDUP; END ELSE # BAD PARAMETER VALUE # ERRCODE = RC$PARVAL; END ELSE # CHARS EXCEED ALLOWED VALUE # ERRCODE = RC$PARVAL; END ELSE # PARAMETER FORMAT ERROR # ERRCODE = RC$PARFMT; END ELSE # INVALID PARAMETER # ERRCODE = RC$PARILL; END IF ERRCODE EQ 0 AND NOT PAR$PRC[PAR$NIN] THEN # NIN MUST BE SPECIFIED # ERRCODE = RC$PARMIS; IF ERRCODE NQ 0 THEN # ERROR FOUND # BEGIN MESSAGE(MSG$PARERR[ERRCODE],0); NVFIIAP; END RETURN; END TERM