IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy GDG(more than 1 version) to PS file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajit sahu

New User


Joined: 06 Aug 2013
Posts: 3
Location: india

PostPosted: Mon Oct 28, 2013 11:44 pm
Reply with quote

HI,

I want to copy different GDG version to a PS file. I tried givin GDG base alone in the input file, so that it can read all GDG version availables( AS i dont know How many versions will be present).

The real problem , I am facing is , it is copying GDG starting from +0 till -10 ( latest first and oldest last), But I want to copy Oldest (V-10) to lates +0 version..

IS it possible by any utility to copy from Oldest version to latest version by giving Base alone , Or i need to manually specify the GDG ?

This is what I am coding:

Exec PGM = SORT/IEBCOPY ( I tried with both)
file in = GDG base
Fiel out = PS file:

Expected result:
GDG version copied
-2
-1
0

Actual result :
0
-1
-2
How i can get the expected oen?? is there any utility ??
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 28, 2013 11:55 pm
Reply with quote

Hello and welcome to the forum,

No, there is no automagic utility.

This Has been asked recently and using the forum SEARCH you shoule be aboe to fine these discussions.

Basically, you need to get a list of these and generate JCL in the order you need.

Also, you are not using versions, but rather Generations.
Back to top
View user's profile Send private message
ajit sahu

New User


Joined: 06 Aug 2013
Posts: 3
Location: india

PostPosted: Tue Oct 29, 2013 12:12 am
Reply with quote

Thanks for the reply.

Yes, pls read it as generation instead of version. I was searching shortcut as i was not sure how many genrations will be present . But, I believe I need to code my JCL accordingly in absence of utility.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Oct 29, 2013 8:55 pm
Reply with quote

Hello,

Yes, you will need to create the needed JCL. It can be automated rather than doing it by hand every run. . .

The method has been posted before and if you look a bit, you should be able to get it.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Oct 29, 2013 10:40 pm
Reply with quote

If you give GDG Base as input to a 'COPY operation', it will copy all the generations associated with it. However, the records are copied will be in last in, first out order (LIFO) as has been mentioned.

If you want the records copied in first in, first out order (FIFO), so that the records of the first generation will appear first, followed by the records of the second generation and so on, you can also use the smart DFSORT trick " Copy GDG records in first in, first out order" which is shown here www-01.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094 .
Back to top
View user's profile Send private message
ajit sahu

New User


Joined: 06 Aug 2013
Posts: 3
Location: india

PostPosted: Thu Oct 31, 2013 12:35 am
Reply with quote

Thanks Anuj.. it helped me a lot..
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 31, 2013 1:14 pm
Reply with quote

Glad that we had been helpful.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top