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


DEVTYPE—Example 2—Includes Building a Parameter List

z/OS DFSMSdfp Advanced Services
SC23-6861-01

 
         MVC   DTLIST,KDTLIST     BUILD PARAMETER LIST IN DYNAMIC STORAGE
*************************************************************************
* RETRIEVE FOUR BYTE UCBTYP FOR SYSUT1 DEVICE
*************************************************************************
         DEVTYPE MF=(E,DTLIST),,(AREA,L'AREA)
         •
         •
         •
*************************************************************************
* 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)
         •
         •
         •
KDTLIST  DEVTYPE FIRSTDD,MF=L,INFOLIST=ILIST1  NON-MODIFIABLE PARAMETER
*                                                LIST
LDTLIST  EQU   *-KDTLIST
FIRSTDD  DC    CL8'SYSUT1'
ILIST1   DEVTYPE INFO=DEVTYPE
ILIST2   DEVTYPE INFO=(DASD,DEVTYPE)  REQUEST DATA AT AREA
DYNAMIC  DSECT
UCBAD    DS    A                      ADDRESS OF UCB
DTLIST   DS    CL(LDTLIST)            DEVTYPE PARAMETER LIST(MODIFIABLE)
         DS    0F                     ALIGNMENT FOR TRKCYL
AREA     DS    0CL20                  INFORMATION FROM
*                                       DEVTYPE INFO=(DASD,DEVTYPE)
TYP1     DS    0CL4                   INFORMATION FROM
*                                       DEVTYPE INFO=DEVTYPE (UCBTYP)
*                                       FOR FIRSTDD
NUMCYL   DS    F                      NUMBER OF CYLINDERS ON VOLUME
TRKCYL   DS    F                      NUMBER OF TRACKS PER CYLINDER
         DS    CL8                    MISCELLANEOUS
TYP2     DS    CL4                    UCBTYP FROM UCB POINTED TO
*                                       FROM UCBAD
Example 2 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,(AREA,L'AREA),INFOLIST=ILIST1
ILIST1 describes four bytes to be returned. They are at the beginning of a 20-byte area - 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. In effect, the second specification of DEVTYPE is:
DEVTYPE ,(AREA,L'AREA),INFOLIST=ILIST2,UCBLIST=(UCBAD,1)

The INFOLIST describes 20 bytes to be returned.

The first execute form illustrates an unusual technique of coding a keyword parameter (MF) before two positional parameters. The first positional value is null, and the second position is (AREA,L'AREA). This generally is not a good technique because it is confusing. It is used here only to show the flexibility that Assembler H and High Level Assembler allow.

For another example of DEVTYPE, see Figure 1.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014