z/OS MVS Using the Subsystem Interface
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 5 — Subsystem Requesting Routine (TSYSCALL)

z/OS MVS Using the Subsystem Interface
SA38-0679-00

 
TSYSCALL CSECT
TSYSCALL AMODE ANY
TSYSCALL RMODE ANY
************************************************************************
*                                                                      *
*  Function:                                                           *
*                                                                      *
*     This routine runs as a problem program and invokes the TSYS      *
*     subsystem.  It requests the SSI to invoke the WRITEIT function   *
*     to issue its WTO.  Ten seconds later it requests the SSI to      *
*     invoke the DELETEIT function to delete the WTO.                  *
*                                                                      *
*     For the WTO to be broadcast to all subsystems, this routine      *
*     must be run SUB=MSTR.                                            *
*                                                                      *
************************************************************************
*                                                                      *
*  Name of the module:  TSYSCALL                                       *
*                                                                      *
*  System macros used:                                                 *
*                       ABEND                                          *
*                       CVT                                            *
*                       IEFJESCT                                       *
*                       IEFJSSIB                                       *
*                       IEFSSOBH                                       *
*                       IEFSSREQ                                       *
*                       RETURN                                         *
*                       STIMER                                         *
*                                                                      *
*  Base register:  12                                                  *
*                                                                      *
*  Other register use:                                                 *
*                  10   SSOB                                           *
*                  11   SSIB                                           *
*                                                                      *
*  Attributes:                                                         *
*     None                                                             *
*                                                                      *
************************************************************************
*
************************************************************************
* Chain saveareas                                                      *
************************************************************************
         USING TSYSCALL,12
         SAVE  (14,12)                 Save caller registers
         LR    12,15                   Establish module base register
         LR    1,13
         LA    13,SAVEAREA             Point to this module's savearea
         ST    13,8(1)                 Chain saveareas foreword
         ST    1,SAVEAREA+4            Chain saveareas backward
*
         LA    10,SSOBD                Establish addressability
         USING SSOB,10                  to the SSOB
         LA    11,SSIBD                Establish addressability
         USING SSIB,11                  to the SSIB
*
************************************************************************
* Format the SSOB                                                      *
************************************************************************
         MVC   SSOBID,=C'SSOB'         Set control block identifier
         LA    8,SSOBHSIZ
         STH   8,SSOBLEN               Set control block size
         ST    11,SSOBSSIB             Set pointer to SSIB
         MVC   SSOBINDV,=A(MSGIDEXT)   Set pointer to function
*                                       dependent area
*
************************************************************************
* Format the SSIB                                                      *
************************************************************************
         MVC   SSIBID,=C'SSIB'         Set control block identifier
         LA    8,SSIBSIZE
         STH   8,SSIBLEN               Set control block size
         MVC   SSIBSSNM,=C'TSYS'       Set subsystem name
*
************************************************************************
* Call the TSYS subsystem                                              *
************************************************************************
         MVC   SSOBFUNC,WRITEIT        Request the TSYS001 WTO message
         OI    PARMLST,X'80'           Mark end of parameter list
         LA    1,PARMLST               Point to the parameter list
         IEFSSREQ
         LTR   15,15                   Check return code from SSI
         BNZ   ERROR
         CLC   SSOBRETN,=F'0'          Check return code from subsystem
         BNZ   ERROR
*
         STIMER WAIT,BINTVL=TENSEC
*
         MVC   SSOBFUNC,DELETEIT       Request DOM of the TSYS001 WTO
*                                       message
         LA    1,PARMLST               Point to the parameter list
         IEFSSREQ
         LTR   15,15                   Check return code from SSI
         BNZ   ERROR
         CLC   SSOBRETN,=F'0'          Check return code from subsystem
         BNZ   ERROR
         B     RETURN
*
ERROR    EQU   *
         ABEND 1001,,,USER             Indicate function failure
*
************************************************************************
* Restore registers and return                                         *
************************************************************************
RETURN   EQU   *
         L     13,SAVEAREA+4           Pointer to caller's savearea
         RETURN (14,12),RC=0
*
*
TENSEC   DC    F'1000'                 Ten seconds in 1/100ths
WRITEIT  DC    H'254'
DELETEIT DC    H'255'
*
SAVEAREA DC    18F'0'
*
PARMLST  DC    A(SSOBD)                IEFSSREQ parameter list
*
SSOBD    DS    0F                      SSOB data
         DC    (SSOBHSIZ)X'00'
*
MSGIDEXT DS    0F                      Function dependent area
MSGIDLEN DC    AL2(MSGIDSIZ)
MSGIDENT DC    F'0'                    Message identifier from TFUNC1
MSGIDSIZ EQU   *-MSGIDEXT
*
SSIBD    DS    0F                      SSIB data
         DC    (SSIBSIZE)X'00'
*
         IEFSSOBH
*
         IEFJSSIB
*
         CVT DSECT=YES
*
         IEFJESCT
*
         END

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014