Pages

JCL DD statements


DD (Data Definition) statement is used to specify input and output files for a job step.

The DD statement defines a dataset or file name, attributes, and location and assigns it a DDname to be referenced within the job step.

The maximum number of DD statements in a single step is 3273

DDname should start from the 3rd column

DDname can be 1-8 characters

DDname is a combination of alphanumeric and special characters (@,#, and $).

 

 

DSN

to specify the name of a dataset (PS/PDS/VSAM/tape)

syntax : //DDname DD DSN=datasetname

//DD01   DD  DSN=MTH.DATA.PSFILE,DISP=SHR


 

 

 

 

 

 

 

 

DISP

tells the system what to do with the dataset after the job step execution

syntax: DISP=(status[,normal-termination-action][,abnormal-termination-action])


STATUS :

NEW - new dataset is to be created

SHR - Specifies the dataset already exists before the step and used only for reading

OLD - Specifies that the dataset already exists and used with exclusive control on the dataset

MOD - Specifies dataset exists before this step and used to append the data to the dataset


Normal-termination-action:

specifies the system what action needs to be taken on the dataset when the job step executed successfully.

Applicable actions are - KEEP, CATLG, UNCATLG, PASS, DELETE


Abnormal-termination-action:

tells the system what action needs to be performed on the dataset when the step execution is unsuccessful (terminates abnormally).
Applicable actions are - KEEP, CATLG, UNCATLG, DELETE.

KEEP - Specifies that the dataset is to be retained on the volume.

CATLG - Specifies that the dataset is to be cataloged if it is not already cataloged.

UNCATLG - Specifies that the dataset is to be uncataloged.

PASS - Specifies that the dataset should pass and used in the next steps.

DELETE - Specifies that the dataset is to be deleted.

 

 

 

 

 

 

SYSOUT

to specify the destination of system output, such as job log, operator messages, and program output.


Syntax - SYSOUT={msg-class|*|output-class|output-device|(,)}


output-class - specifies the output class that is defined during JES initialization.

(,) - specifies a null class. Coding SYSOUT=(,) nullifies the SYSOUT class.

output-device - specifies output device name.


Example - Writing output on default printer (SPOOL)

//DD01    DD SYSOUT=*


 

 

 

SPACE

to specify the amount of disk space required for creating a new dataset

Syntax - SPACE=({Allocation-parameter,}(primary-qty[,second-qty][,directory]) [,RLSE][,CONTIG or MXIG or ALX][,ROUND])


Allocation-parameter - specifies the measurement unit for memory allocation. The valid values are - TRK, CYL, BLKLGTH, RECLGTH.


primary-qty - specifies the amount of primary space needed for the dataset.

secondary-qty - specifies the amount of additional space required for the dataset.

Directory - specifies amount of space in bytes that is reserved for directory blocks.

RLSE - releases the memory allocated to the dataset when the dataset is closed.

CONTIG - specifies that the memory allocated should be contiguous and applies to primary memory allocation.

MXIG - specifies that the memory allocation should be done on the largest contiguous memory location.

ALX - specifies to the system that the memory to the dataset allocation is to up to 5 largest available locations on the same volume.


 

 

 

UNIT

to specify the system to place the dataset on a specific device or a group of devices.

Syntax - UNIT=([ddd] [,unit-count] [,DEFER])[device-type][group-name ]

device-number - Specifies device by a 3-digit or 4-digit hexadecimal number.

device-type - Specifies a device by its generic name, which is an IBM-supplied name.

group-name - Specifies a group of devices by a symbolic name.

unit-count - Specifies the number of devices from 1 through 59.

DEFER - Specifies the system to assign the dataset to device(s).


UNIT=SYSDA à Defines a dataset on DASD(Direct Access Storage Device - SYSDA).

 

 

 

DSORG

specifies the organization of the dataset.

Syntax - DSORG=PS|PO|DA

PS - specifies the dataset organization is sequential.

PO - specifies the dataset organization is partitioned (PDS).

DA - specifies the dataset organization is direct access.

 

 

 

 

RECFM

to define the record format for the new dataset

Syntax - DCB=(RECFM=V|VB|F|FB|U)

F - Specifies the records are fixed length.

V - Specifies the records are variable length.

B - Specifies the records are blocked.

U - Specifies the records are undefined length.

 


LRECL

LRECL (Logical Record Length) parameter is used to specify the record length for new datasets during their creation.

Syntax - DCB=(LRECL=record_length)

record_length - Specifies the physical record length in bytes. The value is 1 to 32,767 for non-VSAM datasets.


 

 

BLKSIZE

to specify the size of the physical blocks used when reading or writing a dataset.

Syntax - BLKSIZE={value|valueK|valueM|valueG}

Value - specifies the storage in bytes.

ValueK - specifies the storage in Kilobytes.

ValueM - specifies the storage in Megabytes.

ValueG - specify the storage in Gigabytes.





DCB


DCB (Data Control Block) is a parameter that is used to define how a dataset is to be processed. The DCB parameter provides information about the organization, record format, record length, block size, and other dataset attributes.

Syntax - DCB=(subparameter[,subparameter]...)

Frequently used parameters -

Some mostly used DCB parameters and their meanings include -

BLKSIZE - Specifies the block size of the dataset.

DSORG - Specifies the organization of the dataset. Valid values include PS (physical sequential), PO (partitioned organization), and PDS (partitioned dataset).

KEYLEN - Specifies the key length of the dataset.

LRECL - Specifies the record length of the dataset.

RECFM - Specifies the record format of the dataset. Valid values include F (fixed length), V (variable length), and U (undefined).

DSNTYPE - Specifies the type of dataset. Valid values include LIBRARY (for a PDS), and BASIC or EXTENDED (for a PS dataset).

 


VOLUME

to specify the name of the DASD (Direct Access Storage Device) volume on which a dataset is stored or is to be stored.

Syntax - {VOL}=([PRIVATE][,RETAIN][,volume-sequence-number][,volume-count] {VOL}=[SER=(serial-number[,serial-number]...)]

PRIVATE - requests a private volume.

volume-sequence-number - specifies the unique number to identify the volume. Values are 1 - 255.

volume-count - specifies the maximum number of volumes.

SER=serial-number - specifies the volume serial number.

Eg: VOLUME=SER=DEVHD4,

 

 

 

 

LIKE

allows you to create a new dataset with the attributes of an existing dataset.

Syntax - LIKE=old-dataset-name

old-dataset-name - Specifies the model dataset full name.

//STEP01   EXEC PGM=PROG1

//INPUT    DD DSN=MTH.OLD.DATASET,DISP=SHR

//OUTPUT   DD DSN=MTH.NEW.DATASET,

//            DISP=(NEW,CATLG,DELETE),

//            LIKE=INPUT

 

RECORG

Specifies the record organization

DSNTYPE

Specifies the type of the dataset

DEST

Sends the sysout dataset to specified destination

EXPDT

Specifies the expiration date for the dataset

KEYLEN

Specifies the length of the key in the dataset

OUTLIM

Specifies the logical records limit in the dataset

RETPD

Specifies the retention period of the dataset

DYNAM

DYNAM parameter to provide the compatibility with previous system.

OUTPUT

Associates with one or more output datasets

LABEL

Specifies the information about the dataset label

No comments:

Post a Comment