kartheeswaran wrote:How to concatenate 2 dataset and write one dataset in jcl?
You are actually making 2 queries here
- How do you specify that 2 data sets are concatenated in JCL.
- How do I copy these data sets.
Mr. Sample's example is one way to perform the first query.
Generally speaking, you cannot use the concatenation unless the DCB attributes of the two data sets are similar. By "similar" I mean
- The record type in the RECFM attribute is the same. The "record type" is the F, V or U attribute in the record format.
- When the "record type" is F, the value of the logical record length must be the same.
- The two data sets must be on the same class of device. In other words, all the data sets in the concatenation must be on disk or all the data sets must be on tape.
Properly written Assembler programs are not bound by these restrictions, but they are rare. Quite often you will see JCL like this used for the Linkage Editor or Binder.
//SYSLIN DD ...,a disk data set
// DD *
This is an example of "unlike" concatenation. The Linkage Editor and Binder programs have be written to handle this, but most programs will fail when trying to read this concatenation.
Another type of concatenation is PDS concatenation, when two PDS data sets are specified without using member names. You will often see this used with compilers and the Linkage Editor and Binder. There used to be a restriction that the data set with the largest BLKSIXE had to be specified first in this type of concatenation. This restriction was removed many years ago, though you still see JCL like this
//xxx DD ...,DSN=a.PDS,DCB=BLKSIZE=32720
// DD ...,DSN=another.PDS
The DCB parameter in the first DD statement is no longer necessary.