z/OS DFSMSdfp Advanced Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


DEVTYPE—Example 3—Building a Parameter List and Using IHADVA

z/OS DFSMSdfp Advanced Services
SC23-6861-01

This example is the same as the previous one, but it uses the IHADVA macro to map the DEVTYPE output and several unusual techniques to demonstration the possibilities.
         MVC DTLIST,KDTLIST    Build parameter list in dynamic storage
***********************************************************************
* Retrieve four-byte UCBTYP for SYSUT1 device in 20-byte area.
***********************************************************************
         DEVTYPE ,(DVAIDASD,L'DVAIDASD+LenDEVTYPE),MF=(E,DTLIST)
DTUsing  USING DVAUCBTY,DVAIDASD        Map DSECT on CSECT
           *
           *
***********************************************************************
* Retrieve 20 bytes (DASD INFO and UCBTYP) for the unit described by
* the UCB that UCBAD points to.  The area address and length are still
* in the parameter list from the DEVTYPE execution performed above.
***********************************************************************
         DEVTYPE UCBLIST=(UCBAD,1),INFOLIST=ILIST2,MF=(E,DTLIST)
DTUsing  USING DVAUCBTY,DVAIDASD+L'DVAIDASD   Map DSECT on CSECT
           *
           *
KDTLIST  DEVTYPE FIRSTDD,MF=L,INFOLIST=ILIST1  Read-only parameter list
LDTLIST  EQU   *-KDTLIST         Length of parameter list
FIRSTDD  DC    CL8'SYSUT1'       DD name
ILIST1   DEVTYPE INFO=DEVTYPE    DEVTYPE INFO list
ILIST2   DEVTYPE INFO=(DASD,DEVTYPE)  Another INFO list
* End of CSECT.
DYNAMIC  DSECT      **** Dynamic storage for reentrancy
UCBAD    DS    A                   Address of UCB
DTLIST   DS    CL(LDTLIST)         DEVTYPE parameter list (modifiable)
         DS    0F                  Alignment for efficiency
* Output from INFO=(DASD,DEVTYPE) begins here.
* Next line defines symbols for DVAIDASD, which is 16 bytes.
         IHADVA DSECT=NO,INFO=DASD Info from DEVTYPE INFO=DASD
         DS    CL(LenDEVTYPE) Info from DEVTYPE INFO=DEVTYPE
* Next line defines the DVAUCBTY DSECT, which is 4 bytes.
         IHADVA DSECT=YES,INFO=DEVTYPE Info from DEVTYPE INFO=DEVTYPE
LenDEVTYPE EQU *-DVAUCBTY          Length of DSECT (4 b
Example 3 of DEVTYPE builds a parameter list in dynamically-acquired storage so the program can be reentrant. It then supplies additional parameters in the first execute form and overrides some of them in the second execute form. In effect, the first specification of DEVTYPE is:
 DEVTYPE FIRSTDD,(DVAIDASD,L'DVAIDASD+LenDEVTYPE),INFOLIST=ILIST1
ILIST1 describes four bytes to be returned at the beginning of a 20-byte area. The length attribute of the INFO=DASD area is L'DVAIDASD, which is 16. The constant LenDEVTYPE is the length of the INFO=DEVTYPE area, which is four bytes. DEVTYPE clears the extra 16 bytes. The list form at KDTLIST specifies parameters that will not be overridden by the first execute form. The execute form specifies parameters that are determined during execution.

The DTUsing USING DVAUCBTY,DVAIDASD line is a labeled dependent USING statement. It applies the 4-byte DVAUCBTY DSECT on top of the storage at DVAIDASD. One purpose of the symbol DTUsing could be to allow a later DROP statement to end the addressability but that is not the purpose of the label here. The purpose here is to avoid an assembler warning message ASMA303W. Multiple address resolutions may result from this USING and the USING on statement number nn". It would be on the second labeled USING if it did not have the same label.

In effect, the second specification of DEVTYPE is:
 DEVTYPE ,(L'DVAIDASD+LenDEVTYPE),INFOLIST=ILIST2,UCBLIST=(UCBAD,1)
The INFOLIST describes 20 bytes to be returned. The second USING with the label DTUsing defines addressability to the last four of the 20 bytes. The first 16 bytes have no USING because they are a part of the DYNAMIC DSECT and already have addressability that is not shown. This technique of using one DSECT (defined by IHADVA DSECT=YES,INFO=DEVTYPE) apply to two places in different areas of the program is allowed by named USINGs without loading another base register.

The IHADVA DSECT=NO,INFO=DASD line defines 16 bytes of variables that DEVTYPE sets. The first symbol is DVAIDASD and its length attribute is 16.

The DS CL(LenDEVTYPE) line defines variables that are described by the DSECT generated by the IHADVA DSECT=YES,INFO=DEVTYPE line.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014