JCL DD DSNAME

JCL – DD DISP JCL – DD DSNTYPE

Advertisements


DSNAME specifies the name of the dataset.

DSNAME can require the existing dataset or new dataset.

For the new dataset, the specified name is assigned to dataset.

For the existing dataset, the specified name used to locate the dataset.

DSNAME required some additional keyword parameters like DISP, SPACE, DCB etc,.

The DSNAME is referred with DSNAME or DSN.

Blanks can be included in the dataset name if the name enclosed with apostrophes.

If the dataset name started with space, then the system treats it as a temporary dataset and ignores the remaining name specified.

System ignores the blank characters at the end of the dataset name.

System does not check the dataset names enclosed with apostrophes for valid length or valid characters.


Valid special characters:

  • .(Period)
  • &&(double ampersands)
  • ()(Parentheses)
  • +(plus)
  • -(minus)
  • *(asterisk)

Syntax:

{DSNAME}  =dsname
 {DSN   }

name for permanent data set:

     dsname
     dsname(member)
     dsname(generation)

name for temporary data set:

     &&dsname
     &&dsname(member)

name for in-stream or sysout data set:

     &&dsname

name copied from earlier DD statement:

     *.ddname
     *.stepname.ddname
     *.stepname.procstepname.ddname

name for dummy data set:

     NULLFILE

dsname dsname can be a qualified name or unqualified name.
Unqualified name Name can be 1 through 8 characters.

Name allows alphanumeric or national ($, #, @) characters, a hyphen, or a character X'C0'.

The first character must be alphabetic or national ($, #, @).
Qualified name Multiple unqualified names combined through period.

Each qualifier should be like unqualified name.

The name must contain a period after every 8 character.

The maximum length of the dataset name is 44 characters including period.

For generation datasets, the name is 35 characters including period.
&&dsname Specifies the name of a temporary data set.
&&dsname(member) Specifies the name of a PDS/PDSE and a member within that data set.
member Member name is 1 through 8 characters.

Member name allows alphanumeric or national characters, or a character X'C0'.

The first character must be alphabetic or national.
*.ddname Specifies the system to copy the data set name from earlier DD statement ddname.
*.stepname.ddname Specifies the system to copy the data set name from DD statement(ddname) in an earlier step(stepname) in the same job.
*.stepname.procstepname.ddname Specifies the system to copy the data set name from a DD statement in a cataloged or in-stream procedure.
NULLFILE Specifies a dummy data set.

NULLFILE has the same outcome as coding the DD DUMMY parameter.

Example 1:

//DD01   DD  DSNAME=MTHDATA,DISP=(NEW,KEEP),
//        UNIT=3390

DD statement DD01 defines a new data set and names it MTHDATA.


Example 2:

//DD01   DD  DSNAME=MTH.DATA,DISP=(NEW,KEEP),DATACLAS=DCLAS7,
//          MGMTCLAS=MCLAS7,STORCLAS=SCLAS7

DD statement DD01 defines a new SMS-managed data set and names it MTH.DATA.


Example 3:

//DDIN  DD  DATA,DSNAME=&&MTHIN
        .
        data
        .
/*

DD statement DDIN defines MTHIN as the last qualifier of the system-generated data set name for the in-stream data set.


Example 4:

//DDOUT  DD  DSNAME=&&MTHOUT,SYSOUT=M

DD statement DDOUT defines MTHOUT as the last qualifier of the system-generated data set name for the sysout data set.


Example 5:

//DD01   DD  DSNAME=&&MTHWORK,UNIT=3390

DD statement DD01 defines a temporary data set.


JCL – DD DISP JCL – DD DSNTYPE

Advertisements