REXX uses the command ALLOCATE (TSO COMMAND) to allocate a dataset to a DDNAME and then read through the dataset using that DDNAME.
There might be scenarios where you need to concatenate multiple datasets and read them all together. This can be achieved by mentioning the multiple datasets in the ALLOCATE command and assigning all of them to a DDNAME and then using it.
ALLOCATE FILE(DDNAME1) DATASET(FILE1,FILE2,FILE3) SHR REUSE
You can also reorder the datasets based on how you like to access those files. If FILE3 needs to be accessed first, then ALLOCATE command as below.
ALLOCATE FILE(DDNAME1) DATASET(FILE3,FILE1,FILE2) SHR REUSE
Also ensure that all the 3 files have the same block size. If the files have different block size, then ensure you give the file with higher block size as the first file (same when you do concatenation in JCL as well).
Other option to skip the block size issue is to explicitly mentioning BLKSIZE in the ALLOCATE command which will be used for all the datasets
ALLOCATE FILE(DDNAME1) DATASET(FILE1,FILE2,FILE3) BLKSIZE(10000) SHR REUSE
More details can be found in below IBM link
If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog
You may also like to look at: