Page 1 of 1

copy data from a pds to 3 pds

PostPosted: Thu Jul 29, 2010 4:16 pm
by maxcc
How can we copy data from a pds which has 30 records to 3 pds all having equal 10 records?

Re: copy data from a pds to 3 pds

PostPosted: Thu Jul 29, 2010 4:23 pm
by expat
Huh, I think that you need to explain in a lot more detail to be able to get any help here

Re: copy data from a pds to 3 pds

PostPosted: Thu Jul 29, 2010 4:39 pm
by NicC
You need to read up on file types - PDS (partitioned Data Set (a library)), PS (physical sequential (also known as a sequential or flat file)), VSAM (Virtual Storage Access Method) and others.

I think you mean you want to split a sequential file into multiple files - I suggest you google for DFSort Tricks and read the examples that specify how to do this.

Re: copy data from a pds to 3 pds

PostPosted: Thu Jul 29, 2010 5:02 pm
by smita257
I think , you can use sort technique, with skiprec(skiprecord) and stopaft(stopafter) options.
Thanks.

Re: copy data from a pds to 3 pds

PostPosted: Fri Jul 30, 2010 4:32 am
by dick scherrer
Hello,

Sort will not help "splitting a pds". . .
How can we copy data from a pds which has 30 records to 3 pds all having equal 10 records?
A pds does not directly have records. . . A pds contains members that may contain records or be empty.

What exactly are you asking?

Re: copy data from a pds to 3 pds

PostPosted: Sun Aug 01, 2010 4:34 pm
by maxcc
Sorry It is from 1 PS to 3 PS and I will try with skiprec(skiprecord) and stopaft(stopafter) options. it should work.

Re: copy data from a pds to 3 pds

PostPosted: Sun Aug 01, 2010 5:56 pm
by steve-myers
I have to admit when I first read this I took it to mean one PDS member, which is roughly equivalent to a sequential data set to 3 PDS members, which are roughly equivalent to 3 sequential data sets.

One thing you do not want to do is try to create the 3 members into 1 data set in one step at the same time using JCL. This will not work! You want to do something like -
//A       EXEC ---
//INPUT    DD  DISP=SHR,DSN=INPUT(MEMBER1)
//OUTPUT1  DD  DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(...)
//OUTPUT2  DD  DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(...)
//OUTPUT3  DD  DISP=(NEW,PASS),UNIT=SYSDA,SPACE=(...)
//B       EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  DISP=OLD,DSN=*.A.OUTPUT1
//SYSUT2   DD  DISP=OLD,DSN=OUTPUT(MEMBER1)
//C       EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  DISP=OLD,DSN=*.A.OUTPUT2
//SYSUT2   DD  DISP=OLD,DSN=OUTPUT(MEMBER2)
//D       EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//SYSUT1   DD  DISP=OLD,DSN=*.A.OUTPUT3
//SYSUT2   DD  DISP=OLD,DSN=OUTPUT(MEMBER3)
I suspect this is much less elegant than what you were thinking, but this skeleton will actually work!

Re: copy data from a pds to 3 pds

PostPosted: Mon Aug 02, 2010 10:31 am
by dick scherrer
Hello,

If you are splitting one sequential file (either a ps or a member of a pds) and you are creating 3 separate ps files and you want to use your sort product, you can do as you mention with skiprec and stopaft.

Re: copy data from a pds to 3 pds

PostPosted: Mon Aug 02, 2010 11:24 am
by NicC
You can also use SPLIT or SPLITBY or SPLIT1R - see the section '5 Ways To Split a Dataset' in the aforementioned DFSort tricks.pdf

Re: copy data from a pds to 3 pds

PostPosted: Wed Aug 04, 2010 11:56 pm
by maxcc
Thankyou all!