Summary -

In this topic, we described about the DD DSNTYPE with detailed example.

DSNTYPE parameter used to specify the type of the dataset to be created. DSNTYPE parameter can specify the below dataset types.

  • partitioned data set (PDS)
  • partitioned data set extended (PDSE)
  • hierarchical file system (HFS) data set
  • A first-in first-out (FIFO) special file
  • basic format data set
  • large format data set
  • extended format data set

DSNTYPE is optional parameter. DSNTYPE parameter always specifies with DD statement during the new dataset creation.

Syntax -

DSNTYPE= {LIBRARY}
         {(LIBRARY,1)}
         {(LIBRARY,2)}
         {HFS    }
         {PDS    }
         {PIPE   }
         {EXTREQ }
         {EXTPREF}
         {LARGE  }
         {BASIC  }

LIBRARY Specifies a partitioned dataset extended (PDSE).
A PDSE may contain data or program object members.
(LIBRARY,1) Specifies a version 1 partitioned dataset extended (PDSE).
A PDSE version 1 may contain data or program object members.
(LIBRARY,2) Specifies a version 2 partitioned dataset extended (PDSE).
A PDSE version 2 may contain data or program object members.
HFS Specifies an HFS dataset.
PDS Specifies a partitioned data set (PDS).
A PDS may contain data or program object members.
PIPE Specifies a FIFO special file.
EXTREQ | (EXTREQ,1) | (EXTREQ,2) Specifies for the data set to be extended format.
(EXTREQ,1) specifies a version 1 extended format data set.
(EXTREQ,2) specifies a version 2 extended format data set.
EXTPREF | (EXTPREF,1) | (EXTPREF,2) Specifies for the data set to be extended format.
If extended format is not possible, the system selects basic format.
(EXTPREF,1) specifies a version 1 extended format data set.
(EXTREQ,2) specifies a version 2 extended format data set.
LARGE The system will select large format if the data set is sequential (DSORG=PS or PSU).
DSORG is omitted from all sources and the data set is not VSAM.
BASIC The system will select basic format if the data set is sequential (DSORG=PS or PSU).
DSORG is omitted from all sources and the data set is not VSAM.

Example 1:

//DD01  DD  DSNAME=MTH.DATA(FILE),DISP=(NEW,KEEP)

The DD01 DD statement defines member FILE in the new PDSE named MTH.DATA.

Example 2:

//DD01   DD  DSNAME=MTH.DATA(FILE2),DISP=(NEW,KEEP),
// DATACLAS=DCLAS07,DSNTYPE=LIBRARY

The DD01 DD statement defines member FILE2 in the new PDSE named MTH.DATA.

Example 3:

//DD01   DD  DSNAME=MTH.DATA(FILE3),DISP=SHR,
// DATACLAS=DCLAS07,DSNTYPE=LIBRARY

DD01 DD statement adds a new member named FILE3 to the existing PDSE named MTH.DATA. DSNTYPE=LIBRARY overrides the DSNTYPE attribute in data class DCLAS07 but uses other data set attributes in DCLAS07.

Example 4:

//DD01   DD  DSNAME=MTH.DATA(FILE4),DISP=(NEW,KEEP),
// DATACLAS=DCLAS07,DSNTYPE=(LIBRARY,2)

The DD01 DD statement defines member FILE4 in the new PDSE named MTH.DATA. DSNTYPE=(LIBRARY,2) overrides the DSNTYPE attribute in data class DCLAS07 but uses other data set attributes in DCLAS07.

Example 5:

//DD01    DD DSNAME=MTH.DATA,DATACLAS=DCLAS07,
// DISP=(NEW,KEEP),DSNTYPE=HFS,SPACE=(CYL,(100,100,1))

The DD01 DD statement creates an HFS dataset to contain an HFS file system. The DCLAS07 in DATACLAS specifies allocation characteristics.