Concatenating Datasets


Concatenating datasets combines two or more same types of datasets into a single logical dataset that can be accessed as a single unit. Concatenation allows a program to read from multiple datasets as a single dataset without accessing each dataset separately.

To concatenate datasets in JCL, we can use the DD statement and multiple datasets with the same DDname.

Syntax -

//DDname DD DSN=dataset1,...
//       DD DSN=dateset2,...
//       DD  .....
//       DD DSN=datasetn,...

Examples -


Scenario 1 - Concatenating multiple datasets.

//STEP01  EXEC PGM=PROG1
//INPUT   DD   DSN=MATEPK.INPUT.PS,DISP=SHR
//        DD   DSN=MATEPK.INPUT.PS1,DISP=SHR