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


Example

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

An installation writes a Tape Device Selection function routine to ensure that tape devices 270 and 271 are available only for HSM tape requests. (This example is included in SYS1.SAMPLIB as member IEFTASSI.)
TAPESSI  CSECT
TAPESSI  AMODE  31
TAPESSI  RMODE  ANY
******************* START OF SPECIFICATIONS ***************************
*                                                                     *
*01*   NAME=                                                          *
*                                                                     *
*01*   TYPE= Sample Subsystem                                         *
*                                                                     *
*01*   FIRST ELIGIBLE PRODUCT= HBB5520                                *
*                                                                     *
*01*   FIRST INELIGIBLE PRODUCT= HBB5510                              *
*                                                                     *
*01*   OPERATION=                                                     *
*        This is a sample taple allocation subsystem. It will         *
*        reserve devices 270 and 271 for only HSM jobs.               *
*                                                                     *
*        1.  Chain save areas                                         *
*        2.  See if the JOBNAME is HSM*                               *
*        3.  If it is not then will ensure that                       *
*            devices 270 and 271 are not eligible                     *
*        4.  Return to SSI                                            *
*                                                                     *
*03*     SOFTWARE DEPENDENCIES:                                       *
*                                                                     *
*04*            REQUIRED PRODUCTS= HBB5520                            *
*                                                                     *
*02*     OUTPUT:                                                      *
*                                                                     *
*03*            MSGIDS= NONE                                          *
*                                                                     *
*03*            ABENDCODES=  NONE                                     *
*                                                                     *
******************** END OF SPECIFICATIONS ****************************
***********************************************************************
*                                                                     *
*  Base register:  12                                                 *
*                                                                     *
*  Other register use:                                                *
*                  10   SSCVT                                         *
*                   2   SSOB                                          *
*                   9   SSIB                                          *
*                   8   SSTA                                          *
*                                                                     *
*  Attributes:                                                        *
*     This routine must be reentrant and reside in a library          *
*     accessible at the time subsystem initialization occurs.         *
*     Supervisor state, AMODE(31), RMODE(ANY)                         *
*                                                                     *
***********************************************************************
***********************************************************************
* Chain saveareas                                                     *
***********************************************************************
         USING TAPESSI,12
         SAVE  (14,12)                 Save caller registers
         LR    12,15                   Establish module base register
*
         LR    10,0                    Establish addressability
         USING SSCT,10                  to the SSCVT
         LR    2,1                     Establish addressability
         USING SSOB,2                   to the SSOB
*
         GETMAIN R,LV=84,SP=230        Get working storage
         ST    13,4(1)                 Chain saveareas forward
         ST    1,8(13)                 Chain saveareas backward
         LR    13,1                    Point to this module's savearea
         LR    11,1                    Point to dynamic storage
         USING DYNAM,11                Base dynamic storage
*
***********************************************************************
* Validate the request                                                *
***********************************************************************
         L     9,SSOBSSIB              Establish addressability
         USING SSIB,9                   to the SSIB
         CLC   SSIBSSNM,SSCTSNAM       Verify the subsystem name
         BNE   ERROR                   This should never happen
         L     8,SSOBINDV              Pointer to function dependent
*                                       area
***********************************************************************
* Check for job name beginning with HSM                               *
***********************************************************************
         USING SSTA,8                  Set basing
         CLC   HSMNAME,SSTAJNAM        Check job name
         BE    NOCHECK                 Skip checks if not HSM*
***********************************************************************
* Job name does not begin with HSM so must not allow devices          *
* 0270 and 0271 to be eligible to satisfy request.                    *
***********************************************************************
         L     7,SSTADDAP              Get address of DD entries
         USING SSTADDA,7               Base DD entries
         L     4,SSTANDDS              Get number of DDs
         LTR   4,4                     Check for zero
         BZ    NOCHECK                 If zero then no DDs to check
         ST    4,NUMDDS                Else save in local storage
DDLOOPS  EQU   *                       Start looping through DDs
         L     6,SSTADRAP              Get address of first request
         USING SSTADRA,6               Base request entries
         L     4,SSTANDRA              Get number of requests
         LTR   4,4                     Check for zero
         BZ    DDLOOPE                 If zero then no requests
         ST    4,NUMREQS               Else save in local storage
REQLOOPS EQU   *                       Start looping through requests
         L     5,SSTADEVP              Get address of first device
         USING SSTAEDA,5               Base device entries
         L     4,SSTANDVS              Get number of devices eligible
         LTR   4,4                     Check for zero
         BZ    REQLOOPE                If zero then no devices
         ST    4,NUMDEVS               Else save in local storage
***********************************************************************
* Check each eligible device entry to make sure that devices          *
* 0270 and 0271 are not eligible to this request.                     *
***********************************************************************
DEVLOOPS EQU   *                       Start looping through devices
         CLC   SSTADNUM,HSMDEV1        Is device reserved for HSM?
         BE    MAKEINEL                Yes, go make ineligible
         CLC   SSTADNUM,HSMDEV2       Is device reserved for HSM?
         BNE   DEVLOOPE                No, bypass making ineligible
MAKEINEL EQU   *
         OI    SSTAUSE1,B'10000000'    Mark device ineligible
DEVLOOPE EQU   *                       End of eligible device loop
         LA    3,12                    Get size of SSTAEDA entry
         ALR   5,3                     Add to pointer to get next
         L     4,NUMDEVS               Get local counter
         LA    3,1                     Get amount to decrement count
         SLR   4,3                     Decrement count
         ST    4,NUMDEVS               Save device count
         LTR   4,4                     Check device count
         BNZ   DEVLOOPS                Loop back if more to process
REQLOOPE EQU   *                       End of request loop
         L     6,SSTADRAN              Get address of next request
         L     4,NUMREQS               Get local counter
         LA    3,1                     Get amount to decrement count
         SLR   4,3                     Decrement count
         ST    4,NUMREQS               Save request count
         LTR   4,4                     Check request count
         BNZ   REQLOOPS                Loop back if more to process
DDLOOPE  EQU   *                       End of DD loop
         L     7,SSTADDAN              Get address of next DD entry
         L     4,NUMDDS                Get local counter
         LA    3,1                     Get amount to decrement count
         SLR   4,3                     Decrement count
         ST    4,NUMDD                 Save DD count
         LTR   4,4                     Check DD count
         BNZ   DDLOOPS                 Loop back if more to process
NOCHECK  EQU   *
         MVC   SSOBRETN,=F'0'          Indicate function success
         B     RETURN
ERROR    EQU   *
         MVC   SSOBRETN,=F'20'         Indicate function failure
***********************************************************************
***********************************************************************
* Return to the SSI                                                   *
***********************************************************************
RETURN   EQU   *
         L     8,4(13)                 Pointer to caller's savearea
         FREEMAIN R,LV=84,A=(13),SP=230
         LR    13,8
         LM    14,12,12(13)            Restore caller' registers
         LA    15,0                    RC=0
         BSM   0,14                    Return to the SSI
*
HSMNAME  DC    CL3'HSM'                HSM Jobname
HSMDEV1  DC    CL4H'270'                  Device reserved for HSM
HSMDEV2  DC    CL4H'271'                  Device reserved for HSM
*
DYNAM    DSECT                         Dynamic storage
SAVEAREA DS    18F                     Module save area
NUMDDS   DS    F                       Number of DDs
NUMREQS  DS    F                       Number of requests
NUMDEVS  DS    F                       Number of eligible devices
*
         IEFJSCVT
         IEFSSOBH
         IEFJSSIB
         IEFSSTA
         END

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014