z/OS Communications Server: SNA Customization
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Sample command verification exit routine

z/OS Communications Server: SNA Customization
SC27-3666-00

ISTCMMND CSECT
         USING *,15
< standard linkage >
* Determine if this invocation is to activate the exit - Reg 0 = X'10'
         C     0,=X'00000010'
         BE    ACTIVE
* Determine if this invocation is to deactivate the exit - Reg 0 = X'20'
         C     0,=X'00000020'
         BE    INACT
* Otherwise this must be a command screening code
* Search for protected ID and OVERRIDE
         L     8,20(1)                 Get address of command string
         L     7,16(1)                 Get address of length
         LH    7,0(7)                  Get command length
         AR    7,8                     R7 has last address to check
         CLC   0(10,8),=C'VARY INACT'  Is this a VARY INACT
         BNE   FINAL                   Do no further checking
         A     8,=F'10'                Increment past VARY INACT
         SR    0,0                     Clear register 0
* Locate ID parameter to check node or OVERRIDE keyword
KEYCHECK .
         CLC   0(3,8),=C'ID='          Is this ID=
         BE    IDFOUND                 ID parameter found
         CLC   0(9,8),=C'OVERRIDE='    Is this OVERRIDE=
         BE    OVERRIDE                OVERRIDE parameter found
         .
* Check ID value to determine if this is a critical node
IDFOUND  CLC   0(8,8),=C'CRITICAL'     Is this node CRITICAL
         BE    MATCH                   Get current command length
         CLC   0(5,8),=C'CRITB'        Is this node CRITB
         BE    MATCH                   Get current command length
         .
* Indicate match found for ID, if OVERRIDE is not found
* the command will fail
MATCH    .
         B     KEYCHECK                Go back to check for OVERRIDE
* Search for OVERRIDE option - it is assumed to be at the end of the
string
OVERRIDE .
         A     8,=F'9'               Bump past override
         CLC   0(3,8),=C'YES'        YES OVERRIDE
         BE    YES                   Override found
         CLC   0(2,8),=C'NO'         NO OVERRIDE
         BE    NO                    Get current command length
* Override not found - if ID is in list of critical nodes, set
* command verification code to fail command
IDFOUND  .
         L     2,12(1)               Get address of exit code
         LA    9,0                   Use value 0 to set return code
         ST    9,0(2)                Set command verification code to 0
*                                    to allow command to continue
         B     FINAL
* Remove OVERRIDE=xxx specification from command string
REMOVE   .
* Indicate OVERRIDE parameter option
YES      L     2,12(1)               Get address of exit code
         LA    9,0                   Use value 0 to set return code
         ST    9,0(2)                Set command verification code to 0
*                                    to allow command to continue
         B     FINAL
NO       L     2,12(1)               Get address of exit code
         LA    9,4                   Use value 0 to set verification code
         ST    9,0(2)                Set command verification code to 4
*                                    to fail command (IST1201I issued)
         B     FINAL
* Do any processing needed at activation
ACTIVE   .
         B     FINAL
* Do any processing needed at inactivation
INACT    .
         B     FINAL
* If a severe error occurs and the invocation of the exit should
* be terminated, set register 15 to X'80' to deactivate the exit
SEVERE   LA    15,X'80'
         .
         B     FINAL
* Complete return linkage and return to caller
FINAL    .
         < standard linkage >
         BR    14
DATAD    DSECT
         DS    0F
         DS    18F
BLANK    DC    C' '
BASESAVE DS    F
RETCODE  DS    F
ENDDATAD EQU   *
         END   ISTCMMND

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014