TITLE  'ICATS REJECT-THIS-COMMAND ROUTINE'                     REJ00010
*********************************************************************** REJ00020
*                                                                     * REJ00030
*  MODULE NAME =  REJECT                                              * REJ00040
*                                                                     * REJ00050
*  FUNCTION =  FOR SOME REASON OR ANOTHER, A COMMAND MODULE WANTS     * REJ00060
*              TO REJECT THIS COMMAND.  WE ARE TO SEND A MESSAGE      * REJ00070
*              TO THE SOURCE OF THIS COMMAND INFORMING HIM THAT       * REJ00080
*              THIS COMMAND IS INVALID.                               * REJ00090
*                                                                     * REJ00100
*  ENTRY POINTS =  REJECT                                             * REJ00110
*                                                                     * REJ00120
*  LINKAGE =  BALR R14,R15 FROM ANYWHERE IN ICATS PROGRAM.            * REJ00130
*             THE ADDRESS OF THIS ROUTINE IS KEPT IN AN ADDRESS       * REJ00140
*             CONSTANT IN THE ICATS COMMON DATA AREA (ICDATA).        * REJ00150
*             FOR EXAMPLE,                                            * REJ00160
*                 L     R15,AREJECT                                   * REJ00170
*                 BALR  R14,R15                                       * REJ00180
*                                                                     * REJ00190
*  REGISTER CONTENTS UPON ENTRY =                                     * REJ00200
*     R2  = POINTS TO THE ICATS COMMON DATA AREA AS ALWAYS.           * REJ00210
*     R14 = RETURN ADDRESS BACK TO CALLER.                            * REJ00220
*     R15 = ADDRESS OF THIS SUBROUTINE (USED FOR BASE REG).           * REJ00230
*                                                                     * REJ00240
*  REGISTER USAGE:                                                    * REJ00250
*     R0  = FREE                                                      * REJ00260
*     RX  = XXXX                                                      * REJ00270
*     R11 = MY BASE REGISTER                                          * REJ00280
*     R14 = RETURN ADDRESS FOR WHEN I CALL SUBROUTINES                * REJ00290
*     R15 = SUBROUTINE ADDRESS                                        * REJ00300
*                                                                     * REJ00310
*  MODULE LOGIC =                                                     * REJ00320
*      I)  IF A SMSG OR A CONSOLE COMMAND, GIVE THE REJECTION MESSAGE.* REJ00330
*          1)  MOVE IN THE BAD COMMAND INTO THE MESSAGE.              * REJ00340
*          2)  GO GIVE IT TO THE REQUESTOR.                           * REJ00350
*      I)  ELSE IT'S A UTS REQUEST.  GIVE THE REJECTION NOTICE.       * REJ00360
*          1)  GIVE A RETURN CODE = X'2000'.                          * REJ00370
*          2)  SET THE NUMBER OF DATA BYTES FOLLOWING TO ZERO.        * REJ00380
*          3)  GIVE THE REPLY CONTROL BLOCK TO THE UTS.               * REJ00390
*                                                                     * REJ00400
*  NORMAL EXIT =                                                      * REJ00410
*      R15 = 0                                                        * REJ00420
*                                                                     * REJ00430
*  EXTERNAL REFERENCES =                                              * REJ00440
*                                                                     * REJ00450
*  CONTROL BLOCKS =  ICDATA   (ICATS COMMON DATA AREA)                * REJ00460
*                                                                     * REJ00470
*  NON-STANDARD MACROS (FOUND IN ICATS MACLIB)                        * REJ00480
*            ICDATA = ICATS COMMON DATA AREA DSECT.                   * REJ00490
*                                                                     * REJ00500
*  CHANGE ACTIVITY                                                    * REJ00510
*    DATE        NAME       REASON FOR CHANGE                         * REJ00520
*  04/19/83  RICK JASPER    BROKEN AWAY FROM ICATS MAINLINE INTO      * REJ00530
*                           SEPARATE SUBROUTINE                       * REJ00540
*                                                                     * REJ00550
*********************************************************************** REJ00560
         EJECT                                                          REJ00570
         PRINT   GEN,NODATA                                             REJ00580
REJECT   CSECT                                                          REJ00590
         USING ICDATA,R2            ADDRESS ICATS COMMON DATA AREA      REJ00600
         USING *,R15              USE R15 FOR NEXT INSTRUCTION ONLY     REJ00610
         STM   R0,R14,REJREG      SAVE ALL THE REGISTERS                REJ00620
         DROP  R15                                                      REJ00630
         USING REJECT,R11         SWITCH BASE REGISTER TO R11           REJ00640
         LR    R11,R15                                                  REJ00650
         TM    FLAGB,UTSCMD       UTS COMMAND ??                        REJ00660
         BO    REJCONA            GO HANDLE UTS REJECTION NOTICE        REJ00670
         MVC   REJNAME,PARM1    PUT THE INVALID COMMAND IN THE MESSAGE  REJ00680
         LA    R1,REJMSG        GET ADDRESS OF REJECTION MESSAGE        REJ00690
         L     R15,AMESSAGE     SAY "XXX IS AN INVALID ICATS COMMAND"   REJ00700
         BALR  R14,R15                                                  REJ00710
         B     REJBYE           BYE BYE                                 REJ00720
*                                                                       REJ00730
REJCONA  DS    0H                                                       REJ00740
*    SET RETCODE = X'2000' AND DATA LENGTH = 0                          REJ00750
         MVC   PARM15,=X'2000000000000000'                              REJ00760
         LA    R0,128           PREPARE FOR REPLY-TO-UTS ROUTINE        REJ00770
         LA    R1,PARM0                                                 REJ00780
         L     R15,AWRITUTS     GIVE THE REPLY CONTROL BLOCK TO THE UTS REJ00790
         BALR  R14,R15          IGNORE ANY ERRORS.                      REJ00800
REJBYE   DS    0H                                                       REJ00810
         LM    R0,R14,REJREG                                            REJ00820
         SR    R15,R15                RETURN CODE = 0                   REJ00830
         BR    R14                                                      REJ00840
REJREG   DS    15F                                                      REJ00850
REJMSG   DC    AL1(REJMSGE)                                             REJ00860
REJNAME  DS    CL8                                                      REJ00870
         DC    C' IS AN INVALID ICATS COMMAND'                          REJ00880
REJMSGE  EQU   *-REJMSG-1                                               REJ00890
         LTORG                                                          REJ00900
         ICDATA                                                         REJ00910
         END                                                            REJ00920