In this topic, we described about the below sections -
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.
// [ddname ] DD [positional-parameter][,keyword-parameter]...[comments] [proc-stepname.ddname] // [ddname ] DD [proc-stepname.ddname]
DD statement can be divided into the below parts.
- 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.
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 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.
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.
|*/DATA||Begins a instream dataset|
|DUMMY||Specifies no space allocation and no disposition processing.|
|DYNAM||DYNAM 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.
|BLKSIZE||Specifies the maximum length of block|
|DCB||Data control block|
|DDname||Postpone defining dataset until later in same step|
|DEST||Sends the sysout dataset to specified destination|
|DISP||Specifies the status of the dataset|
|DSNAME||Specifies the name of the dataset|
|DSNTYPE||Specifies the type of the dataset|
|EXPDT||Specifies the expiration date for the dataset|
|KEYLEN||Specifies the length of the key in the dataset|
|LABEL||Specifies the information about the dataset label|
|LIKE||Specifies the attributes of the new dataset|
|LRECL||Specifies the length of the records|
|OUTLIM||Specifies the logical records limit in the dataset|
|OUTPUT||Associates with one or more output datasets|
|RECFM||Specifies the record format|
|RECORG||Specifies the record organization|
|RETPD||Specifies the retention period of the dataset|
|SPACE||Requests the space for the new dataset|
|SYSOUT||Defines the dataset as a sysout dataset|
|UNIT||Request the allocation to a specific device|
|VOLUME||Specifies the volume on which the dataset resides|
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.
//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.
//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.
//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.