Q. What is IEBCOPY? How it is used? | ||||||||||||||||||||||||||||||||||||
IEBCOPY can be used to perform several functions on a PDS. It can Copy, Merge, Compress, Backup and Restore PDS datasets. When we use IEBCOPY, we must supply the COPY control statement to indicate the Input and Output datasets. Depending on the Input Dataset and Output Dataset, IEBCOPY decides what to do. If it is a new output dataset, then IEBCOPY will copy source PDS to target PDS. If it is an old output dataset, then IEBCOPY will merge the members in input dataset with output dataset. If input dataset and output dataset are same, it compresses the dataset. IEBCOPY can be used to backup a PDS to a Tape Drive/DASD device. This is called as unloading. In case, the input is a tape drive sequential dataset, and output dataset is PDS, the process is called Loading(Restoring) the PDS – just the opposite of taking backup. | ||||||||||||||||||||||||||||||||||||
Q. How to COPY members one PDS to another using IEBCOPY? | ||||||||||||||||||||||||||||||||||||
IEBCOPY can be used to copy all members from one PDS to another, or selectively include and exclude certain members. Lets see, how we can copy from one PDS to another. Assume, Input PDS-> HERC04.INPUT.PDS having MEMBER1,MEMBER2,MEMBER3 Output PDS to be created –> HERC04.OUTPUT.PDS
The program to be executed is IEBCOPY, given in Job-step STEP01. The allocation,termination and all other messages related to the execution of the Job step should go to the default printer spool, so we keep SYSOUT=*. - DDIN specifies the source PDS. Since, it is being read, the DISP parameter must be SHR. - DDOUT specifies the target PDS. Since, it is going to be newly created, its DISP parameter must be (NEW,CATLG,DELETE). - It is necessary to code the SPACE parameter. The SPACE parameter has the following general format : SPACE=(<unit>,(primary,secondary,directory-blks),Release) It is important to mention directory blocks. DIRECTORY Blocks = 0 means that it is PS(Physical Sequential) file. DIRECTORY Blocks > 0 means, it is PDS(Partitioned Dataset). | ||||||||||||||||||||||||||||||||||||
<<Common Programming Error>> Forgetting to write the DIRECTORY-BLOCKS parameter, results in I/O read error, IEB139I. IEB139I I/O ERROR DURING READ - HERC04G ,STEP01,191,DA,DDOUT,9E-OP,WRNG.LEN.RECORD,00000022000501,EXCP | ||||||||||||||||||||||||||||||||||||
- COPY control parameter is given as instream JCL. Please note : COPY starts in column 2. There should be no spaces between DDOUT, and INDD. | ||||||||||||||||||||||||||||||||||||
Q. How do I use SELECT/EXCLUDE control statement? | ||||||||||||||||||||||||||||||||||||
Lets say the Input PDS HERC04.INPUT.PDS contains 3 members – MEMBER1,MEMBER2,MEMBER3. Suppose, we would like to copy only two members MEMBER1 and MEMBER2 to the Output PDS HERC04.OUTPUT.PDS. The syntax of the SELECT control statement is as follows : SELECT MEMBER=<member> or SELECT MEMBER=(member1,member2,…) If we want the members to be given new names in the target PDS, SELECT MEMBER=((member1,newname1),(member2,newname2),…) If we want to copy a selected list of members, and want to replace them, if they already exist in the output dataset, we must code R after the member names. SELECT MEMBER=((member1,,R),(member2,,R),...) Here’s the JCL, that uses the SELECT control statement to copy a select list of members. //HERC04I JOB A123,QUASAR //STEP01 EXEC PGM=IEBCOPY //SYSPRINT DD SYSOUT=* //DDIN DD DSN=HERC04.INPUT.PDS,DISP=SHR //DDOUT DD DSN=HERC04.OUTPUT.PDS,SPACE=(TRK,(1,1,1),RLSE), // DISP=(NEW,CATLG,DELETE),UNIT=SYSDA, // DCB=(RECFM=FB,DSORG=PO) //SYSIN DD * COPY OUTDD=DDOUT,INDD=DDIN SELECT MEMBER=(MEMBER1,MEMBER2) /* // The EXCLUDE statement works on the same lines. While copy from 1 PDS to another, we can specify which members to be excluded(not copied) by giving the EXCLUDE control statement. The syntax of the EXCLUDE control statement is as follows : Technorati Tags: IBM Utilities,IBM Utilities Tutorial,PDS,Copy,Merge,Compress,Backup,Restore,IEBCOPY,Copy PDS,Merge PDS,Compress PDS,Backup PDS,Restore PDS,Copy members from PDS to another,COPY control statement,SELECT,SELECT control Statement,EXCLUDE,EXCLUDE control statement,Loading,Unloading,Tape Drive,DASD,SPACE,SPACE Parameter,Directory,Directory Blocks,PS,IEB139I,I/O Error,I/O Error during Read,WRNG.LEN.RECORD,SELECT MEMBER,JCL,JCL Tutorial,Quasar Chunawalla |