View previous topic :: View next topic
|
Author |
Message |
dilpreet
New User
Joined: 18 Mar 2008 Posts: 34 Location: INDIA
|
|
|
|
I have a GDG file . i want all GDG versions of that file to be merged into a single file.
But i dont know how many generations are there of tht GDG file.
How to get this??? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
You can use below...
Code: |
//STEP0200 EXEC PGM=SORT
//SORTIN DD DSN=gdgbase,DISP=SHR
//SORTOUT DD DSN=flatfile,DISP=(new,catlg,delete)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
/*
|
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Check the JCL manual (link at the top of the page) for using GDG base in your job. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Do you really mean merged or just want all of the data combined into one file? |
|
Back to top |
|
|
dilpreet
New User
Joined: 18 Mar 2008 Posts: 34 Location: INDIA
|
|
|
|
just want to merge all the data in the total no. of generations into a single file. For this i should know the total no. of generations? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Nope, referencing the GDG base will access all cataloged generations without requiring you to enumerate them. The order in which the data is retrieved, though, isn't from the lowest generation number to the highest so if that matters you may need a sort.
And be aware of terminology ... you said
Quote: |
I have a GDG file . i want all GDG versions of that file to be merged into a single file.
But i dont know how many generations are there of tht GDG file. |
and there is a BIG difference between versions and generations. |
|
Back to top |
|
|
dilpreet
New User
Joined: 18 Mar 2008 Posts: 34 Location: INDIA
|
|
|
|
Sorry for the mistake
But how would i get to know how many generations are there ?
Please elaborate |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You could do an IDCAMS LISTCAT.
Also, you didn't answer the "merge" question. . .
Quote: |
Do you really mean merged or just want all of the data combined into one file?
|
Combining all of the generations into a single "stacked" file is not the same as merging them. |
|
Back to top |
|
|
|