cdc:nos2.source:nam5871:ns_cra
Table of Contents
NS$CRA
Table Of Contents
- [00005] PROC NS$CRA
- [00007] NS$CRA - CONTROL CARD CRACKER.
- [00011] CONTROL CARD CRACKER.
- [00052] PROC ABORT
- [00053] PROC NS$MSG
- [00054] PROC NS$CVD
- [00055] PROC NS$CVH
Source Code
- NS$CRA.txt
- *DECK NS$CRA
- USETEXT CYB$NS
- USETEXT COM$NS
- USETEXT DEF$NS
- PROC NS$CRA; # CONTROL CARD CRACKER #
- # TITLE NS$CRA - CONTROL CARD CRACKER. #
- BEGIN # NS$CRA #
- #
- ** NS$CRA - CONTROL CARD CRACKER.
- *
- * J.C. LEE 1981
- *
- * THIS ROUTINE IS PART OF THE INITIALIZATIN PROCESS FOR NS.
- * ITS FUNCTION IS TO CRACK THE NS CONTROL CARD, SAVE VALID
- * VALUES, AND FLAG ERRORS IF FOUND.
- *
- * PROC NS$CRA
- *
- * ENTRY:
- * ARGUMENT LIST IN COMMUNICATION AREA.
- *
- * EXIT:
- * 1. NIN, NDFCT, NSM, MC, AND RT VALUES
- * 2. ERROR MESSAGE(S) SENT IF FOUND.
- *
- * METHOD:
- * LOOP THROUGH THE ARGUMENT LIST. FOR EACH OPTION, SEARCH THE
- * PARAMETER TABLE FOR VALID OPTION. IF FOUND, JUMP TO THE
- * APPROPRIATE PARAGRAPH TO CONVERT AND SAVE VALUE, ELSE FLAG
- * AS ILLEGAL OPTION.
- *
- #
- XREF
- BEGIN # RA COMMUNICATION AREA #
- ARRAY ARG[1:22] S(1);
- BEGIN # RA.ARGR #
- ITEM ARG$SYMBO U(00,00,NL); # ARGUMENT VALUE #
- ITEM ARG$SEPAR U(00,NL,AL); # ARGUMENT SEPARATOR #
- ITEM ARG$WORD U(00,00,WL);
- END
- ARRAY ACT[0:0] S(1);
- BEGIN
- ITEM ACT$COUNT U(00,NL,AL); # ARGUMENT COUNT #
- END
- END
- XREF
- BEGIN
- PROC ABORT; # ABORT NS #
- PROC NS$MSG; # DISPATCH MESSAGE #
- PROC NS$CVD; # CONVERT DECIMAL DC TO BINARY #
- PROC NS$CVH; # CONVERT HEX DC TO BINARY #
- END
- #
- DEFINITIONS FOR PARAMETER INDEXES
- #
- DEF PAR$COUNT #05#; # NUMBER OF VALID NS PARAMETERS #
- DEF PAR$NIN #01#; # NIN INDEX #
- DEF PAR$NDFCT #02#; # NDFCT INDEX #
- DEF PAR$FDP #03#; # NSM INDEX #
- DEF PAR$MC #04#; # MC INDEX #
- DEF PAR$RT #05#; # RT INDEX #
- #
- MISCELLANEOUS DEFINITIONS
- #
- DEF COMMA # O"56" #;
- DEF EQUAL # O"54" #;
- DEF PERIOD # O"57" #;
- DEF YES #O"31052300000000"#;
- DEF NO #O"16170000000000"#;
- DEF CT$P #O"20000000000000"#; # FILE CATEGORY = PRIVATE #
- DEF CT$S #O"23000000000000"#; # FILE CATEGORY = SEMIPRIVATE#
- DEF CT$PU #O"20250000000000"#; # FILE CATEGORY = PUBLIC #
- #
- REASON CODES FOR CONTROL CARD ERRORS
- #
- DEF RC$PARILL #01#; # ILLEGAL 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 #
- ARRAY PAR [1:PAR$COUNT] S(1);
- BEGIN # VALID PARAMETER LIST #
- ITEM PAR$KEY U(00,00,42) = [ # KEYWORDS #
- O"16111600000000", # NIN #
- O"16040603240000", # NDFCT #
- O"06042000000000", # FDP #
- O"15030000000000", # MC #
- O"22240000000000", # RT #
- ];
- ITEM PAR$NCV U(00,42,12) = [ # CHARS ALLOWED FOR PARAM VALUE#
- 3, # UP TO 3 DEC CHARS FOR NIN #
- 2, # UP TO 2 CHARS FOR NDFCT #
- 3, # UP TO 3 CHARS FOR FDP #
- 7, # UP TO 7 DEC CHARS FOR MC #
- 3, # UP TO 3 CHARS FOR RT #
- ];
- ITEM PAR$PRC B(00,54,06) = [ # PARAMETER PROCESSED FLAG #
- FALSE,
- FALSE,
- FALSE,
- FALSE,
- FALSE,
- ];
- END
- DEF L$PARERR # 5 #;
- DEF DM$PARERR # DM$SYSLOC+DM$ABORT #;
- ARRAY MSG$PARERR [RC$PARILL:RC$PARMIS] S(L$PARERR);
- BEGIN # CONTROL CARD ERROR DIAGNOSTICS #
- ITEM PEM$TEXT C(00,00,40) = [ # MESSAGE TEXT #
- "NS/UNRECOGNIZED CONTROL CARD PARAMETER.",
- "NS/CONTROL CARD PARAMETER SYNTAX ERROR.",
- "NS/ILLEGAL CONTROL CARD PARAMETER VALUE.",
- "NS/DUPLICATE CONTROL CARD PARAMETER.",
- "NS/NIN IS NOT SPECIFIED.",
- ];
- ITEM PEM$END U(04,00,60) = [ RC$PARMIS(0) ];
- END
- BASED ARRAY DUMMY [1:PAR$COUNT] S(1);
- BEGIN
- ITEM PARAMWORD U(00,00,60);
- END
- SWITCH PARTYPE , # SWITCHES FOR PARAMETERS #
- TYPE$NIN,
- TYPE$NDFCT,
- TYPE$FDP,
- TYPE$MC,
- TYPE$RT;
- CONTROL EJECT;
- #
- 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 NC
- OR C<J,NC-J>ARG$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;
- NS$CVD(ARG$WORD[ARGPTR],K,J,ERR); # CONVERT DEC TO BIN #
- ZDMBID$NIN[0] = K; # SET NETWORK INVOCATION NUMBER #
- B<0,18>K = J + O"333333";# SET TO DISPLAY-CODED DEC #
- GOTO ENDPRC;
- TYPE$NDFCT:
- I = PAR$NDFCT;
- IF ARG$SYMBO[ARGPTR] EQ CT$P
- THEN # FILE CATEGORY IS PRIVATE #
- K = 0;
- ELSE
- BEGIN
- IF ARG$SYMBO[ARGPTR] EQ CT$S
- THEN # FILE CATEGORY IS SEMIPRIVATE #
- K = 1;
- ELSE
- BEGIN
- IF ARG$SYMBO[ARGPTR] EQ CT$PU
- THEN # FILE CATEGORY IS PUBLIC #
- K = 2;
- ELSE # UNRECOGNIZED PARAMETER VALUE #
- ERR = TRUE;
- END
- END
- GOTO ENDPRC;
- TYPE$FDP:
- I = PAR$FDP;
- GOTO CHECKYN;
- TYPE$MC:
- I = PAR$MC;
- NS$CVD(ARG$WORD[ARGPTR],K,J,ERR) ; # CONVERT DEC TO BIN #
- GOTO ENDPRC;
- TYPE$RT:
- I = PAR$RT;
- CHECKYN:
- IF ARG$SYMBO[ARGPTR] EQ YES
- THEN
- K = ASC$YY; # PARAMETER VALUE IS -YES- #
- ELSE
- BEGIN
- IF ARG$SYMBO[ARGPTR] EQ NO
- THEN
- K = ASC$NN; # PARAMETER VALUE IS -NO- #
- ELSE
- ERR = TRUE; # BAD PARAMETER VALUE #
- END
- 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 #
- P<DUMMY> = LOC(NIN);
- PARAMWORD[I] = K; # STORE PARAM VALUE IN COMMON #
- 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 # ILLEGAL 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 #
- NS$MSG(MSG$PARERR[ERRCODE],L$PARERR,DM$PARERR);
- RETURN;
- END
- TERM
cdc/nos2.source/nam5871/ns_cra.txt · Last modified: 2023/08/05 17:22 by Site Administrator