Copy a PDS to other PDS.

All sort of Mainframes Interview Questions.
Post Reply
Harish Chandra
New Member
Posts: 7
Joined: Thu Jan 15, 2015 3:01 pm

Copy a PDS to other PDS.

Post by Harish Chandra »

hi,

I was asked, write all the JCL statements which are needed copying one PDS to another PDS. I don't know but I fumbled on this question, what is the correct answer, please help.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Copy a PDS to other PDS.

Post by Robert Sample »

IEBCOPY is used to copy a PDS to a PDS. It needs SYSIN, SYSOUT (or SYSPRINT -- I never remember which utility needs which so I usually just code both of them), an input DD and an output DD. The SYSIN needs the utility COPY statement. For more details, look up IEBCOPY in the Utilities manual in the DFSMS bookshelf.
Harish Chandra
New Member
Posts: 7
Joined: Thu Jan 15, 2015 3:01 pm

Re: Copy a PDS to other PDS.

Post by Harish Chandra »

Thanks Robert. I did some online finding and found that this job will work:

Code: Select all

//STEP01       EXEC PGM=IEBCOPY
 //SYSUT1   DD DISP=SHR,DSN=input.pds
 //SYSUT2   DD DISP=(,CATLG),DSN=output.pds,SPACE=(TRK,(50,50))
 //         UNIT=3390
 //SYSPRINT DD SYSOUT=*
 //SYSIN    DD *
  COPY INDD=SYSUT1,OUTDD=SYSUT2
 // 
But then I looked at the manual for IEBCOPY, http://publibz.boulder.ibm.com/cgi-bin/ ... 0113105507 and the first example is confusing:

"In this example, a partitioned data set (DATASET5) is copied from one disk volume to another. Figure 17 shows the input and output data sets before and after processing.

Code: Select all

       //COPY     JOB   ...
       //JOBSTEP  EXEC  PGM=IEBCOPY
       //SYSPRINT DD  SYSOUT=A
       //SYSUT1   DD  DSNAME=DATASET5,UNIT=disk,VOL=SER=111113,
       //             DISP=SHR
       //SYSUT2   DD  DSNAME=DATASET4,UNIT=disk,VOL=SER=111112,
       //             DISP=(NEW,KEEP),SPACE=(TRK,(5,1,2))
The control statements are discussed below:

SYSUT1 DD defines a partitioned data set, DATASET5, that contains two members (A and C).

SYSUT2 DD defines a new partitioned data set, DATASET4, that is to be kept after the copy operation. Five tracks are allocated for the data set; two blocks are allocated for directory entries.

Because the partitioned data set has only two members, SYSUT3 and SYSUT4 DD are not needed.

Because the input and output data sets are identified as SYSUT1 and SYSUT2, the SYSIN data set is not needed. The SYSUT1 data set will be copied in full to the SYSUT2 data set. After the copy operation is finished, DATASET4 will contain the same members that are in DATASET5. However, there will be no embedded, unused space in DATASET4. If you are copying a PDSE, the processing is the same, except that there is no embedded, unused space in a PDSE."

--

I could not understand why they say like this,"Because the partitioned data set has only two members, SYSUT3 and SYSUT4 DD are not needed."? Can you please help in knowing this?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Copy a PDS to other PDS.

Post by Robert Sample »

The Utilities manual in the IEBCOPY job control statements section explains that SYSUT3 is used to provide overflow space for the input data set directory should it be too large to fit in memory, and SYSUT4 is the same for the output data set directory. With only two members, the directory of each won't be too large to fit in memory. With the expansion of system capacity over the last couple of decades, I seriously doubt many (if any) PDS copies with IEBCOPY have used SYSUT3 or SYSUT4 in many years. Back when an S/360 system could be installed and operate just fine with 64K of memory (I was using such a machine in 1975), SYSUT3 and SYSUT4 got used a lot more.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Interview Questions.”