JCL DD Statement

JCL - EXEC TIME JCL – DD BLKSIZE

Advertisements


Before proceding with EXEC statement, Refer the JCL Coding sheet topic.


DD stands for Data Definition.

DD specifies the data set to be used in the JOB step and responsible to provide the specification about how to use the data set.

DD statement is left justified.

DD Statement has the dataset and its physical characteristics details.

Each EXEC statement may have its corresponding DD statements that are used in application program or utility.

The DD name used in the program must be same as the DDname in the DD statement.

DD statement in the job contains the actual/full name of data set.

DD names may not be unique among the multiple steps and should be unique in the specific step.

The maximum number of DD statements per job step is 3273.

The 3273 is based on single DD statements allowed for a TIOT (task input output table) control block size of 64K.

The DD statements number can vary from system to system based on the TIOT control block size.


Syntax:

// [ddname             ] DD [positional-parameter][,keyword-parameter]...[comments]
   [proc-stepname.ddname]

// [ddname             ] DD
   [proc-stepname.ddname]

DD statement can be divided into the below parts.


  1. DD name
  2. Operation(DD)
  3. Parameters
  4. Comment

Note:

Do not code comment if the parameter field is blank.


DD name:


The DD name used in the program must be same as the DDname in the DD statement.

DD must be unique within the job step.

DD name can be ignored/omitted from the second dataset, if all the datasets are used for concatenation.

Use proc-stepname.ddname to override or add the DD name to the proc-stepname step.


Rules:

DD always begins in the column 3 and column 1 & 2 contains ‘//’.

DD name is 1 through 8 characters.

DD name is a combination of alphanumeric and national characters (@,# and $).

DD name first character should be alphabetic or national character.

DD name must be followed by one blank before DD.


Operation:


Operation field describes about the type of operand.

Operation field consists of DD characters.

Operation field can start in any column.

Operation field is mandatory with every DD name.

Operation field must be followed by one blank.


Parameters:


DD statement has two types of parameters.


  • Positional parameters
  • Keyword parameters

Positional parameter (positional-parm):

Positional parameters are optional.

The DD statement may contain one or more positional parameters.

Positional parameter must start after DD statement and before keyword parameters.

Positional parameters can start in any column.

Positional parameters are optional even though operation field is specified.

DD statement has two positional parameters.


Positional ParameterPurpose
*/DATABegins a instream dataset
DUMMYSpecifies no space allocation and no disposition processing.
DYNAMDYNAM parameter to provide the compatibility with previous system.

Keyword parameters (keyword-parameter):

DD statement can be coded with keyword parameters.

The keyword parameters can code in any order.

The DD statement can contain one or more keyword parameters with it.

Below keyword parameters are used with DD statement.


Keyword ParameterPurpose
BLKSIZESpecifies the maximum length of block
DCBData control block
DDnamePostpone defining dataset until later in same step
DESTSends the sysout dataset to specified destination
DISPSpecifies the status of the dataset
DSNAMESpecifies the name of the dataset
DSNTYPESpecifies the type of the dataset
EXPDTSpecifies the expiration date for the dataset
KEYLENSpecifies the length of the key in the dataset
LABELSpecifies the information about the dataset label
LIKESpecifies the attributes of the new dataset
LRECLSpecifies the length of the records
OUTLIMSpecifies the logical records limit in the dataset
OUTPUTAssociates with one or more output datasets
RECFMSpecifies the record format
RECORGSpecifies the record organization
RETPDSpecifies the retention period of the dataset
SPACERequests the space for the new dataset
SYSOUTDefines the dataset as a sysout dataset
UNITRequest the allocation to a specific device
VOLUMESpecifies the volume on which the dataset resides

Comment:


Comment used to make a note of current statement.

Comment field follows parameter field.

Comment field should be preceded with a blank after the parameter field.


Example 1:

//STEP01 EXEC PGM=SAMPLE
//INPUT1  DD  DSNAME=MTH.INPUT.FILE,DISP=SHR
//OUTPUT1 DD  DSNAME=MTH.INPUT.FILE,DISP=(NEW,CATLOG,DELETE)

In this example, INPUT1 is the input file for the program SAMPLE and OUTPUT1 is the new output file going to create.


Example 2:

//STEP01 EXEC PGM=SAMPLE
//INPUT1 DD  DSNAME=MTH.INPUT.FILE1,DISP=SHR
//       DD  DSNAME=MTH.INPUT.FILE2,DISP=SHR

In the above example, the ddname is missing from the second DD statement. Because the datasets specified to concatenate.


Example 3:

//STEP01 EXEC PROC=MTHPROC
//STEP02.INPUT DD DSNAME=MTH.INPUT.FILE1,DISP=SHR

In this example, if procedure step STEP01 contains a DD statement named INPUT, then the statement overrides parameters on DD statement STEP02.

If the step STEP02 does not contain DD statement INPUT, the system adds this statement to procedure step STEP02 of the job step.


JCL - EXEC TIME JCL – DD BLKSIZE

Advertisements