z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Using ISITMGD to Determine Whether the Data Set Is System Managed

z/OS DFSMS Using Data Sets
SC23-6855-00

You can use the ISITMGD macro to determine if an open data set is system managed and if it is a PDSE. The ISITMGD macro sets some bits in the ISITMGD parameter list that you should test to see what type of data set is being processed. The IGWCISM macro maps the ISITMGD parameter list. In the assembler example in Figure 1, ISITMGD was issued for the second data set in the concatenation (CONCAT=1).
Figure 1. ISITMGD Example
         OPEN  (PDSEDCB,(INPUT))          OPEN PDSE
         ...
*************************************************************
* ISSUE ISITMGD FOR SECOND DATA SET IN THE CONCATENATION
*************************************************************
         ISITMGD DCB=PDSEDCB,MF=(E,ISITPARM),CONCAT=1
         USING ISM,1
         LTR   15,15                     Did it complete successfully
         BNZ   ISITERR                   No, branch to error routine
         TM    ISMOFLG1,ISMMGD           Is data set system-managed?
         BZ    NOTMGD                    No, branch to non-SMS routine
         TM    ISMOFLG2,ISMPDSE          Is data set a PDSE
         BO    ANPDSE                    Yes, branch to PDSE routine
OTHER    WTO   'PDS: system-managed data set'
         B     EXIT
*************************************************************
* PROCESS A NON-SMS MANAGED PDS
*************************************************************
NOTMGD   EQU   *
         TM    ISMOFLG2,ISMPDSE          Is data set a PDSE
         BO    ANUMPDSE                  Yes, branch to PDSE routine
         WTO   'PDS: non-system-managed data set'
         B     EXIT
*************************************************************
* PROCESS AN UNMANAGED MANAGED PDSE
*************************************************************
ANUMPDSE EQU   *
         WTO   'PDSE: unmanaged data set'
         B     EXIT
*************************************************************
* PROCESS A MANAGED PDSE
*************************************************************
ANPDSE   EQU   *
         WTO   'PDSE: system-managed data set'
         ...
PDSEDCB  DCB     DSORG=PO,DDNAME=PDSEDDN,MACRF=(R)
ISITPARM ISITMGD MF=L                    Defines space for parameter list
         IGWCISM                         Maps parameter list
         ...

If you are testing a single data set, use the CONCAT default, which is 0. The CONCAT parameter is used only for partitioned concatenation, not sequential concatenation. For sequential concatenation, the current data set is tested. The return code in register 15 shows whether the function failed or is not supported on the system.

You can also use ISITMGD to determine:
  • The type of library, data or program. Specifying the DATATYPE option on the ISITMGD macro sets the library type in the parameter list. See constants ISMDTREC, ISMDTPGM, and ISMDTUNK in macro IGWCISM for the possible data type settings.
  • Start of change The version (1 or 2) of a PDSE. End of change

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014