Page 1 of 1

One-to-one copy of GDG generation files

PostPosted: Tue Aug 02, 2016 5:22 pm
by Namrata_Singri
Hi,

I need to copy a GDG generation files into another new GDG generation files.

Like:
Say I have genarations for GDG base A as
A.1
A.2
A.3

I need to do one to one copy
like A.1 to B.1
A.2 to B.2
A.3 to B.3 where B is the another GDG base

Please suggest me.

Re: One-to-one copy of GDG generation files

PostPosted: Tue Aug 02, 2016 5:47 pm
by NicC
What is the problem that you are having? It seems a trivial IEBGENER/ICEGENER/DFSORT task - input:A.1(0) output B.1(+1) etc for each generation.

Re: One-to-one copy of GDG generation files

PostPosted: Tue Aug 02, 2016 6:11 pm
by Aki88
Hello,

IMHO this is less DFSORT more of JCL/UTILITIES/VSAM question.
From DFSORT stand-point, use a simple SORT FIELDS=COPY to copy datasets.

Coming to A.1 to B.1 and so on, there are multiple ways of achieving it, depending on what you have; for instance:
a. In case both the GDG base (for A and B datasets) have same starting generation, then a simple +1, +2 and so on coupled with a 'NEW,CATLG' in your JCL would yield similar generation numbers
b. In case they are not same or can be different depending on how they were created, then it can require a bit of coding. Assuming that you can use REXX, do a LISTCAT on the GDG base of A, refer the 'Associations', use SUBSTR to get the GDG generation details from here. Append the generation name to B dataset name. Here you can use ALLOC to allocate the generation or even better, submit a JCL to INTRDR which would create the new GDG generation with the name you've just built, and then subsequently copy A to B in the next step.

A word of caution, how do you plan to ensure that the generations are always serialized, meaning - say two generations of A G0011V00 and G0016V00 are to be copied to B. Now basis the requirement A.G0011V00 is to be copied to B.G0011V00 and A.G0016V00 to B.G0016V00. Now, since A never had such a naming convention restriction, hence it'll have G0012 etc generations as well; how do you plan to control this for B?
Also, why go through this ordeal at all?

Re: One-to-one copy of GDG generation files

PostPosted: Tue Aug 02, 2016 7:19 pm
by Namrata_Singri
Hi,

I apologize for posting here...

As suggested, if i consider instance a, i dont know how many generation A have,When i will be processing copy step i may have one or more than one A generations. So i cant give +1, +2 and so on.

can you suggest me without using REXX how can i achieve this

Re: One-to-one copy of GDG generation files

PostPosted: Tue Aug 02, 2016 7:56 pm
by Aki88
Hello,

Okies; going with option- a, you can add the concepts of option- b and drive the results. Basically, perform a LISTCAT, route the output of the same to a DS (use ALLOC/EXECIO/DISKW), use EXECIO/DISKR to read the LISTCAT output, filter out data under 'ASSOCIATIONS' using a DO-WHILE loop. Now you'll have the generation names which you need to build.
After this you can use QUEUE command to tailor/build your JCL in the REXX.
Use the aforementioned keywords to search the forum and the web to understand their usage, build a logic around it, test it with TRACE option. If you're stuck, share it here and we can guide you further.

Hope this helps.

Re: One-to-one copy of GDG generation files

PostPosted: Tue Aug 02, 2016 8:26 pm
by Robert Sample
can you suggest me without using REXX how can i achieve this
Write a program in the language of your choice (REXX doesn't have to be the choice) to parse the output of a LISTCAT, generating JCL to be submitted via the internal reader to copy each generation from A to B. Or, use dynamic allocation to copy them inside the program without submitting a job. But if you are looking for a solution that can copy an unknown number of generations, one at a time, you MUST either submit another job or use dynamic allocation -- period.

Re: One-to-one copy of GDG generation files

PostPosted: Tue Aug 02, 2016 10:45 pm
by enrico-sorichetti
if gdg B is empty why not use a plain simple DFDSS COPY RENAME

Re: One-to-one copy of GDG generation files

PostPosted: Wed Aug 03, 2016 12:47 pm
by Namrata_Singri
yea.. gdg B is empty.. because after the completion of the process i am deleting gdg generations.

Re: One-to-one copy of GDG generation files

PostPosted: Wed Aug 03, 2016 4:20 pm
by BillyBoyo
So, a rename is much faster than a copy/delete.