Jcl TopicsIntroduction to JCL Jcl coding sheet JOB Statement Exec statement DD Statement Concatenating Datasets Referback in JCL Special DD statements Utility Programs Utility program IEBGENER Utility programs IEBCOPY and IEBCOMPR DFSort DFSort reformat dataset DFSort INCLUDE OMIT COND Procedures generation data group (GDG) JCL quick study JCL Interview questions
IEBCOPY is a data set utility that is used to copy or merge members between one or more partitioned data sets.
IEBCOPY is used to perform the following tasks:
- Make a copy of a partitioned data set or PDSE.
- Merge partitioned data sets.
- Create a sequential form of a partitioned data set or PDSE for a backup.
- Reload one or more members from a PDSU into a partitioned data set or PDSE.
- Select specific members of a partitioned data set or PDSE to be copied, loaded, or unloaded.
- Replace members of a partitioned data set or PDSE.
- Rename selected members of a partitioned data set or PDSE when copied.
- Exclude members from a data set to be copied, unloaded, or loaded.
- Copy and reblock load modules.
- To compress a PDS.
- Convert a partitioned data set to a PDSE or a PDSE to a partitioned data set.
- To request a COPY operation, specify partitioned data sets as input and output. This is used to expand the space allocation, change the directory space or change the blocking size.
- To request an UNLOAD operation, specify a partitioned input data set and a sequential output data set. This is used to create a back-up copy on tape.
- To request a LOAD operation, specify a sequential input data set and a partitioned output data set. This is used to restore a PDS from tape to DASD.
IEBCOPY – To copy as a PDS
It is often used to expand the space allocation or change the directory space. For example, to increase the directory blocks
//STEP010 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=Existing PDS name,DISP=(SHR,Delete) (say, this PDS has 10 directory blocks) //SYSUT2 DD DSN=New PDS name, // // SPACE=(TRK,(10,5,50),RLSE), //SYSIN DD * COPY INDD=SYSUT1,OUTDD=SYSUT2 /*
You can merge many input PDSs too. DDnames are necessary for merge. Using IEBCOPY can be used to alter the BLKSIZE but not the LRECL.
IEBCOPY – To copy to a new PDS
To copy selective members from a PDS to a new PDS use SELECT MEMBER or EXCLUDE MEMBER in the control statement along with COPY operation. Select and Exclude are mutually exclusive.
//STEP010 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=Existing PDS name,DISP=SHR //SYSUT2 DD DSN=New PDS name,DISP=(New,Catlg), // …………………………… //SYSIN DD * COPY INDD=SYSUT1,OUTDD=SYSUT2 SELECT MEMBER=(member1,member2……..) /*
You can assign a new name to the copied member SELECT MEMBER=(member1,(member2,newname), ……..)
For a COPY operation on an PDS with existing members, you can replace identically named members in the output dataset SELECT MEMBER=(member1,,R)
IEBCOPY – To compress a PDS
Partioned data sets are compressed to free up unused space which can be reused for something else.
//STEP010 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //INOUT DD DSN=Existing PDS name,DISP=Old //SYSIN DD * COPY INDD=INOUT,OUTDD=INOUT /*
Since input and output datasets are the same, must code COPY control statement.
IEBCOMPR utility program is used to locate the data differences between two datasets by comparing at record level data. This program can be used to compare two sequential or partitioned datasets.
//STEP010 EXEC PGM=IEBCOMPR //SYSPRINT DD SYSOUT=* //SYSUT1 DD DSN=,DISP=Old //SYSUT2 DD DSN=,DISP=Old //SYSIN DD * COMPARE TYPORG=PO /*
The Return Code (RC) of 0 implies no data-differences and Return Code (RC) of 8 implies differences.