TITLE  'CONFIGURE ROUTINE'                                     CON00010
*********************************************************************** CON00020
*                                                                     * CON00030
*  MODULE NAME =  CONFIG                                              * CON00040
*                                                                     * CON00050
*  FUNCTION =  READ THE ICATS CONFIGURATION FILE AND CONFIGURE        * CON00060
*              THE ICATS VIRTUAL MACHINE.                             * CON00070
*                                                                     * CON00080
*  ENTRY POINTS =  CONFIG                                             * CON00090
*                                                                     * CON00100
*  LINKAGE =  BALR R14,R15 FROM ICATS MAINLINE.                       * CON00110
*                                                                     * CON00120
*  REGISTER CONTENTS UPON ENTRY =                                     * CON00130
*      R2  = USED TO ADDRESS THE ICATS COMMON DATA AREA.              * CON00140
*      R14 = RETURN ADDRESS BACK TO ICATS MAINLINE                    * CON00150
*      R15 = ENTRY POINT TO THIS MODULE                               * CON00160
*                                                                     * CON00170
*  REGISTER USAGE =                                                   * CON00180
*      R0-R1 = USED TO PASS PARAMETERS TO SUBROUTINES.                * CON00190
*      R2 = USED TO ADDRESS THE ICATS COMMON DATA AREA.               * CON00200
*      R3 =  FREE                                                     * CON00210
*      R4 =  USED TO ADDRESS CURRENT UTS CONTROL BLOCK.               * CON00220
*      R5 =  USED TO ADDRESS CURRENT USER CONTROL BLOCK.              * CON00230
*      R6 =  USED TO ADDRESS CURRENT DISK CONTROL BLOCK.              * CON00240
*      R11 = MY FIRST BASE REGISTER                                   * CON00250
*      R12 = MY SECOND BASE REGISTER                                  * CON00260
*      R13 = FREE                                                     * CON00270
*      R14 = MY RETURN ADDRESS WHEN I CALL SOMEBODY                   * CON00280
*      R15 = SUBROUTINE ADDRESS                                       * CON00290
*                                                                     * CON00300
*                                                                     * CON00310
*  MODULE LOGIC:                                                      * CON00320
*      1)  OPEN THE FILE 'ICATS CONFIG A'.  IF NOT THERE, ISSUE AN    * CON00330
*          ERROR MESSAGE AND RETURN (IT'S OK TO NOT HAVE THE          * CON00340
*          CONFIGURATION FILE, IT JUST MEANS THAT WE WON'T BE         * CON00350
*          SERVICING ANY UTS MACHINES.  CONSOLE AND SMSG COMMANDS     * CON00360
*          ARE STILL GOOD THOUGH).                                    * CON00370
*      2)  START READING THE RECORDS IN UNTIL THE END OF FILE.        * CON00380
*          THERE ARE 6 TYPES OF CONFIGURATION RECORDS:                * CON00390
*          1)  BLANK LINE - THESE ARE JUST IGNORED.                   * CON00400
*          2)  COMMENT - THESE BEGIN WITH AN ASTERISK "*".            * CON00410
*          3)  UTS - THESE DEFINE A UTS MACHINE.                      * CON00420
*          4)  USER - THESE DEFINE A UTS USER UNDER THIS UTS MACHINE. * CON00430
*          5)  MDISK - THESE DEFINE THE MINIDISKS FOR THIS USER.      * CON00440
*          6)  TERM  - DIAL-ABLE LINES TO LOG ONTO THE UTS WITH.      * CON00450
*      3)  VALIDATE ALL THE REQUIRED PARAMETERS FOR EACH TYPE OF      * CON00460
*          STATEMENT AND IF ALL CHECK OUT OK, THEN BUILD THE          * CON00470
*          ASSOCIATED CONTROL BLOCK.  ELSE REPORT THE ERROR           * CON00480
*          AND WHERE IT WAS AND SKIP PAST FURTHER LOWER LEVEL         * CON00490
*          CONFIGURATION FILE STATEMENTS.  FOR EXAMPLE, IF WE         * CON00500
*          FIND AN ERROR IN A USER STATEMENT, SKIP UNTIL THE          * CON00510
*          NEXT USER OR UTS STATEMENT.  THIS WAY, THERE'LL BE         * CON00520
*          NO SECURITY EXPOSURE IF THERE'S A BAD USER STATEMENT.      * CON00530
*                                                                     * CON00540
*                                                                     * CON00550
*          THERE ARE 4 LINKED LIST CONTROL BLOCK STRUCTURES:          * CON00560
*          1)  THE UTS CONTROL BLOCK CHAIN (ONE ENTRY FOR EACH UTS),  * CON00570
*          2)  THE USER CONTROL BLOCK CHAIN (ONE ENTRY FOR EACH       * CON00580
*                                            USER ON EACH UTS),       * CON00590
*          3)  THE DISK CONTROL BLOCK CHAIN (ONE ENTRY FOR EACH       * CON00600
*                                            DISK FOR EACH USER).     * CON00610
*          4)  THE TERMINAL CONTROL BLOCK CHAIN (ONE ENTRY FOR        * CON00620
*                                                EACH TERMINAL).      * CON00630
*          SEE THE CBUTS, CBUSER, CBDISK, AND CBTERM DSECTS FOR       * CON00640
*          DETAILS.                                                   * CON00650
*                                                                     * CON00660
*  RETURN CODES                                                       * CON00670
*      R15 = 0 = EVERYTHING WENT OK.  ABSOLUTELY NO ERRORS FOUND.     * CON00680
*      R15 = 4 = WE FOUND A MINOR ERROR BUT CONFIGURATION STILL       * CON00690
*                TOOK PLACE.  WE PROBABLY MISSED A UTS USER OR A      * CON00700
*                DISK DEFINITION HOWEVER.                             * CON00710
*      R15 = 8 = WE FOUND A MAJOR ERROR THAT SERIOUSLY AFFECTED       * CON00720
*                THIS CONFIGURATION ATTEMPT.  WE EITHER               * CON00730
*                1)  COULDN'T FIND THE CONFIGURATION FILE,            * CON00740
*                2)  RAN OUT OF CONTROL BLOCK MEMORY,                 * CON00750
*                3)  FOUND AN INVALID UTS CARD, OR                    * CON00760
*                4)  FOUND A CARD WE DIDN'T UNDERSTAND AT ALL.        * CON00770
*                                                                     * CON00780
*  EXTERNAL REFERENCES = ICDATA                                       * CON00790
*                                                                     * CON00800
*  MACROS =                                                           * CON00810
*            ICDATA = ICATS COMMON DATA AREA                          * CON00820
*            ETTE   = ENTER TRACE TABLE ENTRY SUBROUTINE              * CON00830
*                                                                     * CON00840
*  CHANGE ACTIVITY                                                    * CON00850
*    DATE        NAME       REASON FOR CHANGE                         * CON00860
*  01/31/83  RICK JASPER    INITIAL PROGRAM CREATION                  * CON00870
*  05/06/83  RICK JASPER    GENERAL CLEAN UP FROM FIRST DRAFT AND     * CON00880
*                           ADDED THIRD PARM ON USER STATEMENT.       * CON00890
*  05/20/83  RICK JASPER    ADDED TERMINAL SUPPORT.                   * CON00900
*                                                                     * CON00910
*********************************************************************** CON00920
         PRINT   GEN,NODATA                                             CON00930
         ENTRY CONFIG                                                   CON00940
CONFIG   CSECT                                                          CON00950
         USING ICDATA,R2            ADDRESS ICATS COMMON DATA AREA      CON00960
         USING CBTERM,R3         USE R3 TO ADDRESS TERM CONTROL BLOCK   CON00970
         USING CBUTS,R4          USE R4 TO ADDRESS UTS CONTROL BLOCK    CON00980
         USING CBUSER,R5         USE R5 TO ADDRESS USER CONTROL BLOCK   CON00990
         USING CBDISK,R6         USE R6 TO ADDRESS DISK CONTROL BLOCK   CON01000
         USING *,R15      USE R15 FOR BASE REG NEXT INSTRUCTION ONLY    CON01010
         STM   R0,R14,FIGSAVE       SAVE CALLER'S REGISTERS             CON01020
         DROP  R15                                                      CON01030
         USING CONFIG,R11,R12       R11 WILL BE BASE REGISTER           CON01040
         LR    R11,R15              ESTABLISH FIRST BASE REGISTER       CON01050
         LA    R12,4095(R11)        ESTABLISH SECOND BASE REGISTER      CON01060
         LA    R12,1(R12)                                               CON01070
*                                                                       CON01080
         XC    CBFIRST,CBFIRST   INITIALIZE POINTER TO FIRST UTS CB     CON01090
         MVC   CBNEXT,CBSTART    RESET NEXT AVAILABLE BYTE POINTER      CON01100
         FSSTATE FSCB=MYFSCB                                            CON01110
         LTR   R15,R15                                                  CON01120
         BZ    FIGSKIP6          CONTINUE ON IF ALL'S OK                CON01130
         LA    R1,FIGMSGA        GIVE A MESSAGE SAYING 'CANNOT FIND THE CON01140
         L     R15,AMESSAGE      CONFIGURATION FILE ('ICATS CONFIG A'). CON01150
         BALR  R14,R15           CONFIGURATION WILL NOT TAKE PLACE'     CON01160
         OI    FIGFLAG,MAJORERR        REMEMBER WE HAD A MAJOR ERROR    CON01170
         B     FIGBYE                                                   CON01180
FIGSKIP6 FSOPEN FSCB=MYFSCB                                             CON01190
         XC    RCDCOUNT,RCDCOUNT     INITIALIZE MY RECORD COUNTER       CON01200
FIGLOOP  DS    0H                                                       CON01210
         MVI   FIGINBUF,C' '         CLEAN OUT BUFFER BEFORE YOU USE IT CON01220
         MVC   FIGINBUF+1(79),FIGINBUF                                  CON01230
         L     R15,RCDCOUNT      IN CMS RELEASE 5, THE RECORD COUNTER   CON01240
         LA    R15,1(R15)        IS NOT READILY AVAILABLE, SO I'VE GOT  CON01250
         ST    R15,RCDCOUNT      TO KEEP MY OWN RECORD COUNTER.         CON01260
         FSREAD FSCB=MYFSCB                                             CON01270
         LTR   R15,R15               HAVE WE HIT EOF YET ??             CON01280
         BNZ   FIGOUT                                                   CON01290
         LA    R0,MYPARM1        PUT PARSED PARMS IN MY BUFFER          CON01300
         LA    R1,FIGBUFL        GET ADDRESS OF INPUT BUFFER LENGTH     CON01310
         L     R15,APARSE     GET ADDRESS OF PARSE ROUTINE              CON01320
         BALR  R14,R15        GO PARSE THE COMMAND LINE                 CON01330
*                                                                       CON01340
*   NOW WE GOT THE LINE READ IN AND PARSED.  SEE WHAT KIND OF STATEMENT CON01350
*   IT IS (COMMENT, UTS, USER, OR DISK) AND DO THE APPROPRIATE THING.   CON01360
*                                                                       CON01370
         CLC   MYPARM1,=CL8'*'      CHECK THE EASY ONE FIRST            CON01380
         BE    ENDLOOP              IT'S A COMMENT LINE.  IGNORE IT.    CON01390
         CLC   MYPARM1,=CL8' '      CHECK FOR A BLANK LINE              CON01400
         BE    ENDLOOP              WE'LL ALLOW FOR BLANK LINES TOO.    CON01410
*                                                                       CON01420
         CLC   MYPARM1,=CL8'UTS'    CHECK FOR THE UTS STATEMENT.        CON01430
         BNE   CHCKUSER             NOPE, GO CHECK FOR USER STATEMENT.  CON01440
*   FIRST CHECK THE VALIDITY OF EACH PARM, MAKING SURE THE ADDRESSES    CON01450
*   ARE VALID, AND INSURE NO DUPLICATE UTS ID'S OR ADDRESSES.  IF       CON01460
*   EVERYTHING CHECKS OUT OK, ONLY THEN MAKE A NEW UTSCB.               CON01470
         CLC   MYPARM2,=CL8' '      MAKE SURE UTS ID WAS SPECIFIED      CON01480
         BE    UTSNO2               ERROR, SECOND PARM MISSING.         CON01490
         LA    R1,MYPARM3           CONVERT REAL ADDRESS TO HEX         CON01500
         L     R15,ACONHEX                                              CON01510
         BALR  R14,R15                                                  CON01520
         LTR   R15,R15              DID THE CONVERSION GO OK ??         CON01530
         BZ    FIGCONTA             YEP, CONTINUE ON                    CON01540
         C     R15,=F'4'            WHAT WENT WRONG, THEN ??            CON01550
         BE    UTSNO3               REAL ADDRESS NOT THERE              CON01560
         B     UTSBAD3              REAL ADDRESS INVALID                CON01570
FIGCONTA DS    0H                                                       CON01580
         STH   R0,FIGTEMPA          TEMPORARILY SAVE REAL ADDRESS       CON01590
         LA    R1,MYPARM4           CONVERT VIRTUAL ADDRESS TO HEX      CON01600
         L     R15,ACONHEX                                              CON01610
         BALR  R14,R15                                                  CON01620
         LTR   R15,R15              DID THE CONVERSION GO OK ??         CON01630
         BZ    FIGCONTB             YEP, CONTINUE ON                    CON01640
         C     R15,=F'4'            WHAT WENT WRONG, THEN ??            CON01650
         BE    UTSNO4               VIRTUAL ADDRESS NOT THERE           CON01660
         B     UTSBAD4              VIRTUAL ADDRESS INVALID             CON01670
FIGCONTB DS    0H                                                       CON01680
         STH   R0,FIGTEMPB          TEMPORARILY SAVE VIRTUAL ADDRESS    CON01690
         L     R1,CBNEXT            GET ADDRESS OF NEXT FREE BYTE       CON01700
         LA    R1,56(R1)            BUMP BY SIZE OF UTS CONTROL BLOCK   CON01710
         C     R1,CBEND             ARE WE OUT OF MEMORY YET ??         CON01720
         BNL   FIGNOMEM             YEP, ABORT                          CON01730
*     NOW ADJUST THE POINTER TO THIS NEW UTS CONTROL BLOCK.  FIRST      CON01740
*     CHECK OUT CBFIRST, IF 0, MAKE IT POINT TO THIS NEW UTSCB.  ELSE   CON01750
*     FOLLOW THE UTS CONTROL BLOCK CHAIN TO THE FIRST NULL FORWARD      CON01760
*     POINTER AND MAKE THAT POINT TO THIS NEW UTSCB.                    CON01770
         L     R4,CBFIRST      GET POINTER TO FIRST UTS CONTROL BLOCK   CON01780
         LTR   R4,R4           IS THE POINTER NULL ??                   CON01790
         BNZ   FIGCONTC        NOPE, THIS ISN'T THE FIRST UTSCB         CON01800
         MVC   CBFIRST,CBNEXT  ELSE POINT TO THIS ONLY UTSCB            CON01810
         B     FIGCONTD        GO BUILD THE CONTROL BLOCK               CON01820
UP8      L     R4,CBUTSFP      GO TO NEXT UTSCB                         CON01830
FIGCONTC CLC   CBUTSUID,MYPARM2    INSURE NO DUPLICATE UTS ID'S         CON01840
         BE    UTSDUPID            OOPS, DUPLICATE ID'S NOT ALLOWED     CON01850
         CLC   CBUTSRAD,FIGTEMPA   INSURE NO DUPLICATE REAL ADDRESSES   CON01860
*        BE    UTSDUPRA            OOPS, DUPLICATES NOT ALLOWED         CON01870
         CLC   CBUTSVAD,FIGTEMPB   NO DUP VIRTUAL ADDRESSES EITHER      CON01880
         BE    UTSDUPVA            OOPS, DUPLICATES NOT ALLOWED         CON01890
         CLC   CBUTSFP,=F'0'   IS THIS FORWARD POINTER NULL ??          CON01900
         BNE   UP8             NOPE, NOT AT END OF CHAIN YET.           CON01910
         MVC   CBUTSFP,CBNEXT  ELSE POINT TO THIS ONLY UTSCB            CON01920
*   NOW GO AHEAD AND BUILD THE NEW UTS CONTROL BLOCK.  THE FORWARD      CON01930
*   POINTER TO THIS NEW UTSCB HAS ALREADY BEEN TAKEN CARE OF AND ALL    CON01940
*   POSSIBLE ERROR CONDITIONS HAVE BEEN CHECKED FOR.                    CON01950
FIGCONTD DS    0H                                                       CON01960
         L     R4,CBNEXT        SET UP NEW UTS CONTROL BLOCK BASE REG   CON01970
         ST    R1,CBNEXT        STORE NEW NEXT BYTE FREE ADDRESS        CON01980
         XC    CBUTS(56),CBUTS     BLANK EVERYTHING OUT TO START WITH   CON01990
         MVC   CBUTSUID,MYPARM2        MOVE IN UTS UNIQUE ID            CON02000
         MVC   CBUTSRAD,FIGTEMPA       MOVE IN UTS REAL ADDRESS         CON02010
         MVC   CBUTSVAD,FIGTEMPB       MOVE IN UTS VIRTUAL ADDRESS      CON02020
         MVC   CBUTSDAT,=C'00/00/00'                                    CON02030
         MVC   CBUTSTIM,=C'00:00:00'                                    CON02040
         NI    FIGFLAG,ALL-NOUSER-NODISK   RESUME DOING USER/DISK CARDS CON02050
         B     ENDLOOP                                                  CON02060
         EJECT                                                          CON02070
UTSNO2   DS    0H                                                       CON02080
    LINEDIT TEXT='SECOND PARAMETER ON UTS STATEMENT IS MISSING ON RECOR-CON02090
               D NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYB-CON02100
               UFR                                                      CON02110
         B     UTSCONTA                                                 CON02120
UTSNO3   DS    0H                                                       CON02130
    LINEDIT TEXT='THIRD PARAMETER ON UTS STATEMENT IS MISSING ON RECORD-CON02140
                NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBU-CON02150
               FR                                                       CON02160
         B     UTSCONTA                                                 CON02170
UTSBAD3  DS    0H                                                       CON02180
    LINEDIT TEXT='THIRD PARAMETER ON UTS STATEMENT IS INVALID ON RECORD-CON02190
                NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBU-CON02200
               FR                                                       CON02210
         B     UTSCONTA                                                 CON02220
UTSNO4   DS    0H                                                       CON02230
    LINEDIT TEXT='FOURTH PARAMETER ON UTS STATEMENT IS MISSING ON RECOR-CON02240
               D NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYB-CON02250
               UFR                                                      CON02260
         B     UTSCONTA                                                 CON02270
UTSBAD4  DS    0H                                                       CON02280
    LINEDIT TEXT='FOURTH PARAMETER ON UTS STATEMENT IS INVALID ON RECOR-CON02290
               D NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYB-CON02300
               UFR                                                      CON02310
         B     UTSCONTA                                                 CON02320
UTSDUPID DS    0H                                                       CON02330
    LINEDIT TEXT='DUPLICATE UTS UNIQUE ID FOUND IN RECORD NUMBER ......-CON02340
               ',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR             CON02350
         B     UTSCONTA                                                 CON02360
UTSDUPRA DS    0H                                                       CON02370
    LINEDIT TEXT='DUPLICATE REAL UTS ADDRESS FOUND IN RECORD NUMBER ...-CON02380
               ...',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR          CON02390
         B     UTSCONTA                                                 CON02400
UTSDUPVA DS    0H                                                       CON02410
    LINEDIT TEXT='DUPLICATE VIRTUAL UTS ADDRESS FOUND IN RECORD NUMBER -CON02420
               .....',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR        CON02430
         B     UTSCONTA                                                 CON02440
         EJECT                                                          CON02450
CHCKUSER DS    0H                                                       CON02460
         CLC   MYPARM1,=CL8'USER'   CHECK FOR THE USER STATEMENT.       CON02470
         BNE   CHCKDISK             NOPE, GO CHECK FOR DISK STATEMENT.  CON02480
         TM    FIGFLAG,NOUSER       ARE WE SKIPPING USER STATEMENTS ??  CON02490
         BO    ENDLOOP              YEP, IGNORE THIS STATEMENT.         CON02500
         CLC   MYPARM2,=CL8' '      INSURE USER ID IS SPECIFIED         CON02510
         BE    USERNO2              UTS USER ID IS MISSING              CON02520
*   LET'S FIND OUT WHICH UTS THIS USER BELONGS TO.  IT'LL BE THE        CON02530
*   LAST UTSCB IN THE UTSCB CHAIN.                                      CON02540
         L     R4,CBFIRST           GET ADDRESS OF FIRST UTSCB          CON02550
         LTR   R4,R4                IS IT NULL ??                       CON02560
         BE    USERSEQ              SEQUENCE ERROR - USER BEFORE UTS    CON02570
USERUP3  CLC   CBUTSFP,=F'0'        IS THIS THE LAST IN THE CHAIN ??    CON02580
         BE    USERCONA             YEP, CONTINUE ON                    CON02590
         L     R4,CBUTSFP           GET ADDRESS OF NEXT UTSCB THEN      CON02600
         B     USERUP3              CHECK IT OUT                        CON02610
USERCONA DS    0H                                                       CON02620
         LA    R1,MYPARM3           CONVERT USER FILE ID TO HEX         CON02630
         L     R15,ACONHEX          THIS NUMBER IS USED WHEN READING    CON02640
         BALR  R14,R15              DOWN FILES IN SOURCE FORMAT.        CON02650
         LTR   R15,R15              DID THE CONVERSION GO OK ??         CON02660
         BZ    USERCONB             YEP, CONTINUE ON                    CON02670
         C     R15,=F'4'            WHAT WENT WRONG, THEN ??            CON02680
         BE    USERNO3              USER FILE ID NOT THERE              CON02690
         B     USERBAD3             USER FILE ID INVALID                CON02700
USERCONB DS    0H                                                       CON02710
         STH   R0,FIGTEMPA          TEMPORARILY SAVE USER FILE ID       CON02720
         L     R1,CBNEXT            GET ADDRESS OF NEXT FREE BYTE       CON02730
         LA    R1,36(R1)            BUMP BY SIZE OF USER CONTROL BLOCK  CON02740
         C     R1,CBEND             ARE WE OUT OF MEMORY YET ??         CON02750
         BNL   FIGNOMEM             YEP, ABORT                          CON02760
         L     R5,CBUTSUP    GET ADDRESS OF FIRST USERCB FOR THIS UTS   CON02770
         LTR   R5,R5         IS THIS THE FIRST USER FOR THIS UTS ??     CON02780
         BNZ   USERCONC      NOPE, NOT THAT EASY                        CON02790
         MVC   CBUTSUP,CBNEXT      POINT TO THIS NEW USERCB             CON02800
         B     USERCOND                                                 CON02810
*  RUN THROUGH THE LIST OF USERS FOR THIS UTS, CHECKING FOR DUPLICATE   CON02820
*  USER ID'S AS YOU GO, UNTIL YOU FIND THE END OF THE CHAIN.            CON02830
USERUP5  L     R5,CBUSRFP         GET ADDRESS OF NEXT USERCB IN CHAIN   CON02840
USERCONC DS    0H                                                       CON02850
         CLC   CBUSRUID,MYPARM2   INSURE NO DUPLICATE USER ID'S         CON02860
         BE    USERDUP2           AHA, GOTCHA                           CON02870
         CLC   CBUSRFP,=F'0'      IS THE THE LAST USERCB IN THE CHAIN?  CON02880
         BNE   USERUP5            NOPE, CHECK OUT NEXT ONE              CON02890
         MVC   CBUSRFP,CBNEXT     POINT TO THE NEW USERCB               CON02900
*   NOW GO AHEAD AND BUILD THE NEW USER CONTROL BLOCK.  THE FORWARD     CON02910
*   POINTER TO THIS NEW USERCB HAS ALREADY BEEN TAKEN CARE OF AND ALL   CON02920
*   POSSIBLE ERROR CONDITIONS HAVE BEEN CHECKED FOR.                    CON02930
USERCOND DS    0H                                                       CON02940
         L     R5,CBNEXT        SET UP NEW USER CONTROL BLOCK BASE REG  CON02950
         ST    R1,CBNEXT        STORE NEW NEXT BYTE FREE ADDRESS        CON02960
         XC    CBUSER(36),CBUSER    BLANK EVERYTHING OUT TO START WITH  CON02970
         MVC   CBUSRUID,MYPARM2        MOVE IN USER ID                  CON02980
         MVC   CBUSRFID,FIGTEMPA+1     MOVE IN USER FILE ID             CON02990
         NI    FIGFLAG,ALL-NODISK   RESUME DOING DISK STATEMENTS        CON03000
         B     ENDLOOP                                                  CON03010
         EJECT                                                          CON03020
USERNO2  DS    0H                                                       CON03030
    LINEDIT TEXT='USER ID IS MISSING IN USER STATEMENT ON RECORD NUMBER-CON03040
                ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR      CON03050
         B     USERCONE                                                 CON03060
USERNO3  DS    0H                                                       CON03070
    LINEDIT TEXT='USER FILE ID IS MISSING IN USER STATEMENT ON RECORD N-CON03080
               UMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR CON03090
         B     USERCONE                                                 CON03100
USERBAD3 DS    0H                                                       CON03110
    LINEDIT TEXT='USER FILE ID IS INVALID IN USER STATEMENT ON RECORD N-CON03120
               UMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR CON03130
         B     USERCONE                                                 CON03140
USERSEQ  DS    0H                                                       CON03150
    LINEDIT TEXT='SEQUENCE ERROR - USER STATEMENT IN RECORD NUMBER ....-CON03160
               .. FOUND BEFORE A UTS STATEMENT',SUB=(DECA,RCDCOUNT),DIS-CON03170
               P=NONE,BUFFA=MYBUFR                                      CON03180
         B     USERCONE                                                 CON03190
USERDUP2 DS    0H                                                       CON03200
    LINEDIT TEXT='DUPLICATE USER ID FOUND FOR THIS UTS IN RECORD NUMBER-CON03210
                ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR      CON03220
*                                                                       CON03230
*   DELIVER THE MESSAGE THAT'S SITTING IN MYBUFR.  THEN,                CON03240
*   SINCE WE GOT AN ERROR IN AN USER STATEMENT, GIVE THE MESSAGE        CON03250
*   "INPUT UP TO NEXT USER OR UTS STATEMENT IS IGNORED", AND SKIP       CON03260
*   OVER FUTURE DISK CARDS UNTIL ANOTHER USER STATEMENT IS REACHED.     CON03270
*                                                                       CON03280
USERCONE DS    0H                                                       CON03290
         LA    R1,MYBUFR                                                CON03300
         L     R15,AMESSAGE                                             CON03310
         BALR  R14,R15                                                  CON03320
         LA    R1,FIGMSGC           SAY 'INPUT UP TO NEXT USER OR UTS   CON03330
         L     R15,AMESSAGE              STATEMENT IS IGNORED'          CON03340
         BALR  R14,R15                                                  CON03350
         OI    FIGFLAG,NODISK       TURN ON SKIP DISK FLAG              CON03360
         OI    FIGFLAG,MINORERR     REMEMBER WE HAD A MINOR ERROR       CON03370
         B     ENDLOOP                                                  CON03380
         EJECT                                                          CON03390
CHCKDISK DS    0H                                                       CON03400
         CLC   MYPARM1,=CL8'DISK'   CHECK FOR THE DISK STATEMENT.       CON03410
         BNE   CHCKTERM             GO LOOK FOR TERM STATEMENT.         CON03420
         TM    FIGFLAG,NODISK       ARE WE SKIPPING DISK STATEMENTS ??  CON03430
         BO    ENDLOOP              YEP, IGNORE THIS STATEMENT.         CON03440
*   CHECK THE ACCESS MODE (MYPARM2) - IT MUST BE ONE ALPHABETIC LETTER  CON03450
         CLC   MYPARM2,=CL8' '      MAKE SURE ACCESS MODE WAS GIVEN     CON03460
         BE    DISKNO2              NOPE, NOT THERE                     CON03470
         CLC   MYPARM2+1(7),=CL7' ' MAKE SURE ONLY ONE CHARACTER        CON03480
         BNE   DISKBAD2             NOPE, TOO BAD                       CON03490
         CLI   MYPARM2,C'A'         IS IT A-I ??                        CON03500
         BL    DISKBAD2             NOPE, NO GOOD                       CON03510
         CLI   MYPARM2,C'I'                                             CON03520
         BNH   FIGCONTE             YEP, IT'S A-I                       CON03530
         CLI   MYPARM2,C'J'         IS IT J-R ??                        CON03540
         BL    DISKBAD2             NOPE, NO GOOD                       CON03550
         CLI   MYPARM2,C'R'                                             CON03560
         BNH   FIGCONTE             YEP, IT'S J-R                       CON03570
         CLI   MYPARM2,C'S'         IS IT S-Z ??                        CON03580
         BL    DISKBAD2             NOPE, NO GOOD                       CON03590
         CLI   MYPARM2,C'Z'                                             CON03600
         BH    DISKBAD2             NOPE, THIS THING'S NO GOOD          CON03610
*                  OK, OK, THE SECOND PARM IS GOOD.  CHECK THE THIRD    CON03620
FIGCONTE DS    0H                                                       CON03630
         LA    R1,MYPARM3           CONVERT MINIDISK ADDRESS TO HEX     CON03640
         L     R15,ACONHEX                                              CON03650
         BALR  R14,R15                                                  CON03660
         LTR   R15,R15              DID THE CONVERSION GO OK ??         CON03670
         BZ    FIGCONTF             YEP, CONTINUE ON                    CON03680
         C     R15,=F'4'            WHAT WENT WRONG, THEN ??            CON03690
         BE    DISKNO3              MINIDISK ADDRESS NOT THERE          CON03700
         B     DISKBAD3             MINIDISK ADDRESS INVALID            CON03710
FIGCONTF DS    0H                                                       CON03720
*   I DECIDED I WANTED THE MINIDISK ADDRESS STORED IN EBCDIC, NOT HEX   CON03730
*   BUT I STILL USE THE CONHEX ROUTINE TO CHECK ITS VALIDITY, THOUGH.   CON03740
*        STH   R0,FIGTEMPB          TEMPORARILY SAVE MINIDISK ADDRESS   CON03750
         CLC   MYPARM4,=CL8' '      INSURE READ PASSWORD WAS GIVEN      CON03760
         BE    DISKNO4                                                  CON03770
         CLC   MYPARM5,=CL8' '      INSURE WRITE PASSWORD WAS GIVEN     CON03780
         BE    DISKNO5                                                  CON03790
*  OK, ALL THE PARAMETERS ARE THERE AND THEY ARE VALID.  NOW LET'S      CON03800
*  MAKE SURE THERE'S ENOUGH MEMORY AND THAT THIS ISN'T A DUPLICATE      CON03810
*  ACCESS MODE FOR THIS USER.  FIND OUT WHICH USER THIS DISK BELONGS    CON03820
*  TO.  IT'LL BE THE LAST USER IN THE USERCB CHAIN OF THE LAST UTS      CON03830
*  IN THE UTSCB CHAIN.  SO, FIRST FIND THE LAST UTSCB IN THAT CHAIN.    CON03840
         L     R4,CBFIRST           GET ADDRESS OF FIRST UTSCB          CON03850
         LTR   R4,R4                IS IT NULL ??                       CON03860
         BE    DISKSEQA             SEQUENCE ERROR - DISK BEFORE UTS    CON03870
DISKUP3A CLC   CBUTSFP,=F'0'        IS THIS THE LAST IN THE CHAIN ??    CON03880
         BE    DISKCONA             YEP, CONTINUE ON                    CON03890
         L     R4,CBUTSFP           GET ADDRESS OF NEXT UTSCB THEN      CON03900
         B     DISKUP3A             CHECK IT OUT                        CON03910
*  NOW FIND THE LAST USERCB IN THE USERCB CHAIN.                        CON03920
DISKCONA DS    0H                                                       CON03930
         L     R5,CBUTSUP           GET ADDRESS OF FIRST USERCB         CON03940
         LTR   R5,R5                IS IT NULL ??                       CON03950
         BE    DISKSEQB             SEQUENCE ERROR - DISK BEFORE USER   CON03960
DISKUP3B CLC   CBUSRFP,=F'0'        IS THIS THE LAST IN THE CHAIN ??    CON03970
         BE    DISKCONB             YEP, CONTINUE ON                    CON03980
         L     R5,CBUSRFP           GET ADDRESS OF NEXT UTSCB THEN      CON03990
         B     DISKUP3B             CHECK IT OUT                        CON04000
*  NOW WE'VE GOT R4 & R5 POINTING TO THIS UTSCB & USERCB.  CHECK        CON04010
*  FOR OUT OF MEMORY AND FOR THIS BEING THIS GUY'S FIRST DISK.          CON04020
DISKCONB DS    0H                                                       CON04030
         L     R1,CBNEXT            GET ADDRESS OF NEXT FREE BYTE       CON04040
         LA    R1,44(R1)            BUMP BY SIZE OF DISK CONTROL BLOCK  CON04050
         C     R1,CBEND             ARE WE OUT OF MEMORY YET ??         CON04060
         BNL   FIGNOMEM             YEP, ABORT                          CON04070
         L     R6,CBUSRDP    GET ADDRESS OF FIRST DISKCB FOR THIS USER  CON04080
         LTR   R6,R6         IS THIS HIS FIRST DISK ??                  CON04090
         BNZ   DISKCONC      NOPE, NOT THAT EASY                        CON04100
         MVC   CBUSRDP,CBNEXT      POINT TO THIS NEW DISKCB             CON04110
         B     DISKCOND                                                 CON04120
*  RUN THROUGH THE LIST OF DISKS FOR THIS USER, CHECKING FOR DUPLICATE  CON04130
*  ACCESS MODES AS YOU GO, UNTIL YOU FIND THE END OF THE CHAIN.         CON04140
DISKUP5  L     R6,CBDSKFP         GET ADDRESS OF NEXT DISKCB IN CHAIN   CON04150
DISKCONC DS    0H                                                       CON04160
         CLC   CBDSKMOD,MYPARM2   INSURE NO DUPLICATE ACCESS MODES.     CON04170
         BE    DISKDUP2           AHA, GOTCHA                           CON04180
         CLC   CBDSKFP,=F'0'      IS THIS THE LAST DISKCB IN THE CHAIN? CON04190
         BNE   DISKUP5            NOPE, CHECK OUT NEXT ONE              CON04200
         MVC   CBDSKFP,CBNEXT     POINT TO THE NEW USERCB               CON04210
*   NOW GO AHEAD AND BUILD THE NEW DISK CONTROL BLOCK.  THE FORWARD     CON04220
*   POINTER TO THIS NEW DISKCB HAS ALREADY BEEN TAKEN CARE OF AND ALL   CON04230
*   POSSIBLE ERROR CONDITIONS HAVE BEEN CHECKED FOR.                    CON04240
DISKCOND DS    0H                                                       CON04250
         L     R6,CBNEXT        SET UP NEW DISK CONTROL BLOCK BASE REG  CON04260
         ST    R1,CBNEXT        STORE NEW NEXT BYTE FREE ADDRESS        CON04270
         XC    CBDISK(44),CBDISK    BLANK EVERYTHING OUT TO START WITH  CON04280
         MVC   CBDSKMOD,MYPARM2        MOVE IN USER'S ACCESS MODE       CON04290
*   I DECIDED I WANTED THE MINIDISK ADDRESS STORED IN EBCDIC, NOT HEX   CON04300
*   BUT I STILL USE THE CONHEX ROUTINE TO CHECK ITS VALIDITY, THOUGH.   CON04310
*        MVC   CBDSKDAD,FIGTEMPA       MOVE IN MY MINIDISK ADDRESS      CON04320
         MVC   CBDSKDAD,MYPARM3        MOVE IN MY MINIDISK ADDRESS      CON04330
         MVC   CBDSKRPW,MYPARM4        MOVE IN USER'S READ PASSWORD     CON04340
         MVC   CBDSKWPW,MYPARM5        MOVE IN USER'S WRITE PASSWORD    CON04350
         B     ENDLOOP                                                  CON04360
         EJECT                                                          CON04370
DISKNO2  DS    0H                                                       CON04380
    LINEDIT TEXT='ACCESS MODE IS MISSING IN DISK STATEMENT ON RECORD NU-CON04390
               MBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR  CON04400
         B     DISKCONE                                                 CON04410
DISKBAD2 DS    0H                                                       CON04420
    LINEDIT TEXT='INVALID ACCESS MODE GIVEN IN DISK STATEMENT ON RECORD-CON04430
                NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBU-CON04440
               FR                                                       CON04450
         B     DISKCONE                                                 CON04460
DISKNO3  DS    0H                                                       CON04470
    LINEDIT TEXT='MINIDISK ADDRESS IS MISSING IN DISK STATEMENT ON RECO-CON04480
               RD NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MY-CON04490
               BUFR                                                     CON04500
         B     DISKCONE                                                 CON04510
DISKBAD3 DS    0H                                                       CON04520
    LINEDIT TEXT='INVALID MINIDISK ADDRESS GIVEN IN DISK STATEMENT ON R-CON04530
               ECORD NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA-CON04540
               =MYBUFR                                                  CON04550
         B     DISKCONE                                                 CON04560
DISKNO4  DS    0H                                                       CON04570
    LINEDIT TEXT='READ PASSWORD NOT GIVEN IN DISK STATEMENT ON RECORD N-CON04580
               UMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR CON04590
         B     DISKCONE                                                 CON04600
DISKNO5  DS    0H                                                       CON04610
    LINEDIT TEXT='WRITE PASSWORD NOT GIVEN IN DISK STATEMENT ON RECORD -CON04620
               NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUF-CON04630
               R                                                        CON04640
         B     DISKCONE                                                 CON04650
DISKSEQA DS    0H                                                       CON04660
    LINEDIT TEXT='SEQUENCE ERROR - DISK STATEMENT IN RECORD NUMBER ....-CON04670
               .. FOUND BEFORE A UTS STATEMENT',SUB=(DECA,RCDCOUNT),DIS=CON04680
               P=NONE,BUFFA=MYBUFR                                      CON04690
         B     DISKCONE                                                 CON04700
DISKSEQB DS    0H                                                       CON04710
    LINEDIT TEXT='SEQUENCE ERROR - DISK STATEMENT IN RECORD NUMBER ....-CON04720
               .. FOUND BEFORE A USER STATEMENT',SUB=(DECA,RCDCOUNT),DI-CON04730
               SP=NONE,BUFFA=MYBUFR                                     CON04740
         B     DISKCONE                                                 CON04750
DISKDUP2 DS    0H                                                       CON04760
    LINEDIT TEXT='DUPLICATE ACCESS MODE FOUND FOR THIS USER IN DISK STA-CON04770
               TEMENT ON RECORD NUMBER ......',SUB=(DECA,RCDCOUNT),DISP-CON04780
               =NONE,BUFFA=MYBUFR                                       CON04790
*                                                                       CON04800
*   DELIVER THE MESSAGE THAT'S SITTING IN MYBUFR.  THEN,                CON04810
*   SINCE WE GOT AN ERROR IN AN DISK STATEMENT, GIVE A MESSAGE AND      CON04820
*   GO READ THE NEXT CARD.                                              CON04830
*                                                                       CON04840
DISKCONE DS    0H                                                       CON04850
         LA    R1,MYBUFR                                                CON04860
         L     R15,AMESSAGE                                             CON04870
         BALR  R14,R15                                                  CON04880
         LA    R1,FIGMSGD           SAY 'THIS DISK STATEMENT WILL       CON04890
         L     R15,AMESSAGE              BE IGNORED'                    CON04900
         BALR  R14,R15                                                  CON04910
         OI    FIGFLAG,MINORERR     REMEMBER WE HAD A MINOR ERROR       CON04920
         B     ENDLOOP                                                  CON04930
*                                                                       CON04940
CHCKTERM DS    0H                                                       CON04950
         CLC   MYPARM1,=CL8'TERM'   CHECK FOR THE TERMINAL STATEMENT.   CON04960
         BNE   SAYWHAT              HUH ??  DON'T KNOW WHAT THIS IS.    CON04970
*    CHECK MY VIRTUAL ADDRESS OF THIS TERMINAL.                         CON04980
         LA    R1,MYPARM2           CONVERT TERMINAL ADDRESS TO HEX     CON04990
         L     R15,ACONHEX                                              CON05000
         BALR  R14,R15                                                  CON05010
         LTR   R15,R15              DID THE CONVERSION GO OK ??         CON05020
         BZ    TERMCONA             YEP, CONTINUE ON                    CON05030
         C     R15,=F'4'            WHAT WENT WRONG, THEN ??            CON05040
         BE    TERMNO2              TERMINAL ADDRESS NOT THERE          CON05050
         B     TERMBAD2             TERMINAL ADDRESS INVALID            CON05060
TERMCONA DS    0H                                                       CON05070
*   I'M GOING TO SAVE THE TERMINAL VIRTUAL ADDRESS IN BOTH EBCDIC AND   CON05080
         STH   R0,FIGTEMPB           HEX, SO TEMPORARILY SAVE IT AWAY.  CON05090
*                                                                       CON05100
*    NOW LET'S GO AHEAD AND DEFINE A GRAPHICS DEVICE AT THIS ADDRESS.   CON05110
*    ISSUE THE CP COMMAND "DEFINE GRAF XXX 3270".                       CON05120
*                                                                       CON05130
         MVC   GRAFCUU,MYPARM2  PUT TERMINAL ADDRESS INTO COMMAND       CON05140
         LA    R1,DEFGRAF       PICK UP ADDRESS OF THE DEFINE COMMAND   CON05150
         SVC   202                                                      CON05160
         DC    AL4(*+4)                                                 CON05170
         LTR   R15,R15                                                  CON05180
         BZ    TERMCONB         EVERYTHING'S COOL.  CONTINUE ON.        CON05190
         C     R15,=F'92'       CHECK FOR ALREADY DEFINED.              CON05200
         BNE   TERMBAD          SOMETHING WENT WRONG.  NOT SURE WHAT.   CON05210
*  OK, THE ONLY PARAMETER IS THERE AND IT'S VALID.  NOW LET'S           CON05220
*  MAKE SURE THERE'S ENOUGH MEMORY AND THAT THIS ISN'T A DUPLICATE      CON05230
*  TERMINAL VIRTUAL ADDRESS.                                            CON05240
TERMCONB L     R1,CBNEXT        GET ADDRESS OF NEXT FREE BYTE           CON05250
         LA    R1,160(R1)       GET NEW CBNEXT (KEEP IN R1)             CON05260
         C     R1,CBEND         ARE WE OUT OF MEMORY YET ??             CON05270
         BNL   FIGNOMEM         YEP, ABORT                              CON05280
         L     R3,TERM1ST    GET ADDRESS OF FIRST TERMINAL CB           CON05290
         LTR   R3,R3         IS THIS THE FIRST TERMINAL STATEMENT ??    CON05300
         BNZ   TERMCONC      NOPE, NOT THAT EASY                        CON05310
         MVC   TERM1ST,CBNEXT      POINT TO THIS NEW TERM CB            CON05320
         B     TERMCOND                                                 CON05330
*  RUN THROUGH THE LIST OF DISKS FOR THIS USER, CHECKING FOR DUPLICATE  CON05340
*  ACCESS MODES AS YOU GO, UNTIL YOU FIND THE END OF THE CHAIN.         CON05350
TERMUP5  L     R3,CBTERMFP        GET ADDRESS OF NEXT TERMCB IN CHAIN   CON05360
TERMCONC DS    0H                                                       CON05370
         CH    R0,CBTERMHA       INSURE NO DUPLICATE TERMINAL ADDRESSES CON05380
         BE    TERMDUP2          AHA, GOTCHA                            CON05390
         CLC   CBTERMFP,=F'0'    IS THIS THE LAST TERM CB IN THE CHAIN? CON05400
         BNE   TERMUP5           NOPE, CHECK OUT NEXT ONE               CON05410
         MVC   CBTERMFP,CBNEXT    POINT TO THE NEW TERMCB               CON05420
TERMCOND DS    0H                                                       CON05430
*    TELL CMS THAT WE WANT TO HANDLE INTERRUPTS FROM THIS DEVICE.       CON05440
         LR    R13,R1          SAVE R1 'CAUSE HNDINT CHANGES IT         CON05450
         MVC   HNDLABEL+16(4),MYPARM2          REPLACES C'JUNK'         CON05460
         MVC   HNDLABEL+20(4),=V(TERMIOIH)     REPLACES A'HNDLABEL'     CON05470
         MVC   HNDLABEL+24(2),FIGTEMPB         REPLACES H'444'          CON05480
         CNOP  0,4                                                      CON05490
HNDLABEL HNDINT SET,(JUNK,HNDLABEL,444,ASAP)                            CON05500
         LTR   R15,R15          INSURE THAT HNDINT WORKED OK            CON05510
         BNZ   TERMHND                                                  CON05520
         LR    R1,R13           RESTORE R1                              CON05530
*   NOW GO AHEAD AND BUILD THE NEW TERMINAL CONTROL BLOCK.  THE FORWARD CON05540
*   POINTER TO THIS NEW TERM CB HAS ALREADY BEEN TAKEN CARE OF AND ALL  CON05550
*   POSSIBLE ERROR CONDITIONS HAVE BEEN CHECKED FOR.                    CON05560
         L     R3,CBNEXT        SET UP NEW TERM CONTROL BLOCK BASE REG  CON05570
         ST    R1,CBNEXT        STORE NEW NEXT BYTE FREE ADDRESS        CON05580
         XC    CBTERM(160),CBTERM   BLANK EVERYTHING OUT TO START WITH  CON05590
         MVC   CBTERMST,=C'$$$$'       DEFAULT SESSION TERMINATE STRING CON05600
         MVC   CBTERMHA,FIGTEMPB       TERMINAL ADDRESS IN HEX          CON05610
         MVC   CBTERMEA,MYPARM2        TERMINAL ADDRESS IN EBCDIC       CON05620
         MVC   CBTERMDA,=C'00/00/00'   DATE OF LAST INTERRUPT           CON05630
         MVC   CBTERMTI,=C'00:00:00'   TIME OF LAST INTERRUPT           CON05640
         B     ENDLOOP                                                  CON05650
         EJECT                                                          CON05660
TERMNO2  DS    0H                                                       CON05670
    LINEDIT TEXT='VIRTUAL ADDRESS IS MISSING IN TERMINAL STATEMENT ON R-CON05680
               ECORD NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA-CON05690
               =MYBUFR                                                  CON05700
         B     TERMCONE                                                 CON05710
TERMBAD2 DS    0H                                                       CON05720
    LINEDIT TEXT='VIRTUAL ADDRESS IS INVALID IN TERMINAL STATEMENT ON R-CON05730
               ECORD NUMBER ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA-CON05740
               =MYBUFR                                                  CON05750
         B     TERMCONE                                                 CON05760
TERMBAD  DS    0H                                                       CON05770
         LR    R3,R15                                                   CON05780
    LINEDIT TEXT='GOT A BAD RETURN CODE FROM THE CP DEFINE GRAF XXX 327-CON05790
               0 COMMAND.  RETURN CODE = ....',SUB=(DEC,(R3)),DISP=NONE-CON05800
               ,BUFFA=MYBUFR                                            CON05810
         B     TERMCONE                                                 CON05820
TERMHND  DS    0H                                                       CON05830
         LR    R3,R15                                                   CON05840
    LINEDIT TEXT='GOT A BAD RETURN CODE FROM THE CMS MACRO, HNDINT.  RE-CON05850
               TURN CODE = ....',SUB=(DEC,(R3)),DISP=NONE,BUFFA=MYBUFR  CON05860
         B     TERMCONE                                                 CON05870
TERMDUP2 DS    0H                                                       CON05880
    LINEDIT TEXT='DUPLICATE VIRTUAL ADDRESS FOUND FOR THIS TERMINAL STA-CON05890
               TEMENT ON RECORD NUMBER ......',SUB=(DECA,RCDCOUNT),DISP-CON05900
               =NONE,BUFFA=MYBUFR                                       CON05910
*                                                                       CON05920
*   DELIVER THE MESSAGE THAT'S SITTING IN MYBUFR.  THEN,                CON05930
*   WHAT THE ERROR WAS ON THIS TERMINAL STATEMENT AND GO READ IN THE    CON05940
*   NEXT CARD.                                                          CON05950
*                                                                       CON05960
TERMCONE DS    0H                                                       CON05970
         LA    R1,MYBUFR                                                CON05980
         L     R15,AMESSAGE                                             CON05990
         BALR  R14,R15                                                  CON06000
         LA    R1,FIGMSGE           SAY 'THIS TERMINAL STATEMENT        CON06010
         L     R15,AMESSAGE              WILL BE IGNORED'               CON06020
         BALR  R14,R15                                                  CON06030
         B     ENDLOOP                                                  CON06040
*                                                                       CON06050
SAYWHAT  DS    0H                   UNKNOWN FIRST WORD IN STATEMENT     CON06060
    LINEDIT TEXT='RECORD NUMBER ...... IS BAD - UNKNOWN FIRST WORD',SUB-CON06070
               =(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR                  CON06080
*                                                                       CON06090
*   DELIVER THE MESSAGE THAT'S SITTING IN MYBUFR.  THEN,                CON06100
*   SINCE WE GOT AN ERROR IN AN UTS STATEMENT OR WE COULDN'T TELL       CON06110
*   WHAT KIND OF STATEMENT IT WAS (IT MIGHT BE A UTS STATEMENT), SKIP   CON06120
*   FORWARD IN THE INPUT STREAM UNTIL WE FIND ANOTHER UTS STATEMENT.    CON06130
*                                                                       CON06140
UTSCONTA DS    0H                                                       CON06150
         LA    R1,MYBUFR                                                CON06160
         L     R15,AMESSAGE                                             CON06170
         BALR  R14,R15                                                  CON06180
         LA    R1,FIGMSGB           SAY 'INPUT UP TO NEXT UTS           CON06190
         L     R15,AMESSAGE              STATEMENT IS IGNORED'          CON06200
         BALR  R14,R15                                                  CON06210
         OI    FIGFLAG,NOUSER+NODISK   TURN ON SKIP USER & DISK FLAGS   CON06220
         OI    FIGFLAG,MAJORERR        REMEMBER WE HAD A MAJOR ERROR    CON06230
ENDLOOP  DS    0H                                                       CON06240
         B     FIGLOOP           CONTINUE UNTIL END OF FILE IS REACHED  CON06250
*                                                                       CON06260
*   COME HERE WHEN WE'VE RAN OUT OF MEMORY TO PUT THE CONTROL BLOCKS    CON06270
*   AT.  ISSUE A MESSAGE AND ABORT THIS CONFIGURATION.                  CON06280
*                                                                       CON06290
FIGNOMEM DS    0H                                                       CON06300
    LINEDIT TEXT='RAN OUT OF CONTROL BLOCK MEMORY READING RECORD NUMBER-CON06310
                ......',SUB=(DECA,RCDCOUNT),DISP=NONE,BUFFA=MYBUFR      CON06320
         LA    R1,MYBUFR                                                CON06330
         L     R15,AMESSAGE              STATEMENT IS IGNORED'          CON06340
         BALR  R14,R15                                                  CON06350
         OI    FIGFLAG,MAJORERR        REMEMBER WE HAD A MAJOR ERROR    CON06360
*                                                                       CON06370
*            CLOSE THE ICATS CONFIG FILE AND RETURN.                    CON06380
FIGOUT   DS    0H                                                       CON06390
         FSCLOSE FSCB=MYFSCB                                            CON06400
FIGBYE   DS    0H                                                       CON06410
         SR    R15,R15            PREPARE RETURN CODE REGISTER          CON06420
         TM    FIGFLAG,MINORERR      DID WE GET ANY MINOR ERROR ??      CON06430
         BNO   FIGCONTY              NOPE, CONTINUE ON                  CON06440
         LA    R15,4                                                    CON06450
FIGCONTY DS    0H                                                       CON06460
         TM    FIGFLAG,MINORERR      DID WE GET A MAJOR ERROR ??        CON06470
         BNO   FIGCONTZ              NOPE, CONTINUE ON                  CON06480
         LA    R15,8                                                    CON06490
FIGCONTZ DS    0H                                                       CON06500
         LM    R0,R14,FIGSAVE    RESTORE THE REST OF THE REGISTERS      CON06510
         BR    R14               GOODBYE.                               CON06520
DEFGRAF  DS    0D                                                       CON06530
         DC    CL8'CP'                                                  CON06540
         DC    CL8'DEFINE'                                              CON06550
         DC    CL8'GRAF'                                                CON06560
GRAFCUU  DS    CL8                                                      CON06570
         DC    CL8'3270'                                                CON06580
         DC    8X'FF'                                                   CON06590
FIGSAVE  DS    15F       CONFIGR ROUTINE SAVE AREA                      CON06600
RCDCOUNT DS    F         MY OWN RECORD COUNTER SINCE I CAN'T FIND CMS'S CON06610
FIGTEMPA DS    H            TEMPORARY SAVE AREA                         CON06620
FIGTEMPB DS    H            ANOTHER ONE                                 CON06630
MYFSCB   FSCB   'ICATS CONFIG A',BUFFER=FIGINBUF,BSIZE=80               CON06640
FIGFLAG  DC    X'00'        STATUS FLAG FOR CONFIGURATION ROUTINE       CON06650
NOUSER       EQU   X'80'        DON'T ACT ON USER STATEMENTS            CON06660
NODISK       EQU   X'40'        DON'T ACT ON DISK STATEMENTS            CON06670
MAJORERR     EQU   X'20'        I'VE GOTTEN A MAJOR ERROR               CON06680
MINORERR     EQU   X'10'        I'VE GOTTEN A MINOR ERROR               CON06690
*********************************************************************** CON06700
*                CONFIGURATION ROUTINE MESSAGES                       * CON06710
*********************************************************************** CON06720
FIGMSGA  DC    AL1(FIGMSGAE)                                            CON06730
         DC    C'CANNOT FIND THE CONFIGURATION FILE '                   CON06740
         DC    C'(''ICATS CONFIG A'').  '                               CON06750
         DC    C'CONFIGURATION WILL NOT TAKE PLACE.'                    CON06760
FIGMSGAE EQU   *-FIGMSGA-1                                              CON06770
FIGMSGB  DC    AL1(FIGMSGBE)                                            CON06780
         DC    C'INPUT UP TO NEXT UTS STATEMENT IS IGNORED'             CON06790
FIGMSGBE EQU   *-FIGMSGB-1                                              CON06800
FIGMSGC  DC    AL1(FIGMSGCE)                                            CON06810
         DC    C'INPUT UP TO NEXT USER OR UTS STATEMENT IS IGNORED'     CON06820
FIGMSGCE EQU   *-FIGMSGC-1                                              CON06830
FIGMSGD  DC    AL1(FIGMSGDE)                                            CON06840
         DC    C'THIS DISK STATEMENT WILL BE IGNORED'                   CON06850
FIGMSGDE EQU   *-FIGMSGD-1                                              CON06860
FIGMSGE  DC    AL1(FIGMSGEE)                                            CON06870
         DC    C'THIS TERMINAL STATEMENT WILL BE IGNORED'               CON06880
FIGMSGEE EQU   *-FIGMSGE-1                                              CON06890
FIGBUFL  DC    X'48'        ONLY PARSE FIRST 72 BYTES OF INPUT RECORD   CON06900
MYBUFR   EQU   *            USE FIGINBUF FOR ANY ERROR MESSAGES ALSO    CON06910
FIGINBUF DS    CL80         INPUT BUFFER FOR THE CONFIGURATION FILE     CON06920
MYPARM1  DS    D                                                        CON06930
MYPARM2  DS    D                                                        CON06940
MYPARM3  DS    D                                                        CON06950
MYPARM4  DS    D                                                        CON06960
MYPARM5  DS    D                                                        CON06970
MYPARM6  DS    D                                                        CON06980
MYPARM7  DS    D                                                        CON06990
MYPARM8  DS    D                                                        CON07000
MYPARM9  DS    D                                                        CON07010
MYPARM10 DS    D                                                        CON07020
MYPARM11 DS    D                                                        CON07030
MYPARM12 DS    D                                                        CON07040
MYPARM13 DS    D                                                        CON07050
MYPARM14 DS    D                                                        CON07060
MYPARM15 DS    D                                                        CON07070
*                                                                       CON07080
         LTORG                                                          CON07090
         ICDATA                                                         CON07100
         END                                                            CON07110