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

Copy all the generations of GDG1 to a new GDG2


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

New User


Joined: 27 Sep 2013
Posts: 4
Location: UK

PostPosted: Mon Oct 14, 2013 9:05 pm
Reply with quote

I need to copy all the generations of GDG(LRECL=1500) to new GDG with increased LRECL of 2500.
I am using below Sort card and it works fine
Code:
//SYSIN    DD  *                                                       
 SORT FIELDS=COPY                         COPY SORT COMMAND           
 OUTREC FIELDS=(1:1,1500,                 REFORMAT OUTPUT RECORD ADDING
             1501:1000X)                       1000 BYTES OF SPACES   
/*       



But to repeat the same process everytime for all the generations is a tidious job.
I need to automate it.
1. Did a listcat for the desired nodes and formated the listcat output with ezt. Now I have a dataset with all the gdg generations which needs to be changed.
2. Created base with new DSN and now just need to copy all the generations from old dsn to the new DSN.

Cud you plz help if I can automate it to read gdg gene

Input - XXXX.ABC207M.IDCAMS.XX.AK.YE
Desired output (with all the generation copied and increased LRECL)-XXXX.ABC156G.IDCAMS.XX.AK.YE

Code'd
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Mon Oct 14, 2013 9:09 pm
Reply with quote

Write a little bit of Rexx or COBOL to read the input data set and fabricate JCL and *sort control cards; either use the TSO SUBMIT command (in Rexx) or write the JCL to the internal reader (in COBOL) to execute the job.
Back to top
View user's profile Send private message
Minaxi Singh

New User


Joined: 27 Sep 2013
Posts: 4
Location: UK

PostPosted: Tue Oct 15, 2013 1:50 pm
Reply with quote

Cud you plz help me with sample rexx code
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 15, 2013 2:03 pm
Reply with quote

Do you mean: "Could you please..."?

Plenty of examples on the forum - have you searched? Or asked your colleagues? Or your local Rexx Guru?
Back to top
View user's profile Send private message
Minaxi Singh

New User


Joined: 27 Sep 2013
Posts: 4
Location: UK

PostPosted: Tue Oct 15, 2013 2:20 pm
Reply with quote

Nic, Even I can post relpy like you on every post. Its so simple rather than providing any help just write something weird. I think it was my mistake to ask a question here. Anyways, Thanks for nothing.
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 15, 2013 6:19 pm
Reply with quote

Hello,

Quote:
I think it was my mistake to ask a question here.
You did not make a mistake posting a question. . .

You did make a mistake asking others to do your work for you. . .

We are here to help, not do the work.

If you post what you have tried and where you are stuck, someone may be able to offer suggestions.
Back to top
View user's profile Send private message
Minaxi Singh

New User


Joined: 27 Sep 2013
Posts: 4
Location: UK

PostPosted: Wed Oct 16, 2013 2:41 pm
Reply with quote

Basically I am a beginner in RExx,Just got the basic idea abt rexx from manuals.
In my Input dataset I have the list of all gdg generations to be converted into 2500 LrecL with a new name or i can have same name and just inrement version num.
I am stuck at a point how the file name will be sent to JCL. The JCL shud be called for every file from the REXX routine in a loop.
Even if i am able to pass gdg for sort in, how do i interpret the sortout gdg generation as the desired output is like this.
Input - XXXX.ABC207M.IDCAMS.XX.AK.YE.g***
Desired output (with increased LRECL)-XXXX.ABC156G.IDCAMS.XX.AK.YE .g***
2nd option is to use just version number 01 instead of 00 for the generations and in this case i can keep the same dsn name XXXX.ABC207M.IDCAMS.XX.AK.YE.g***v01
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Oct 16, 2013 4:50 pm
Reply with quote

You can dynamically allocate and process each of the input and output files in a loop within the batch job that you submit.

Do not use the version number solution because only ONE version of a given generation can exist, so if your copy fails you may well delete the input data for that generation.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 582
Location: London

PostPosted: Thu Oct 17, 2013 8:26 pm
Reply with quote

Read all generations in one go like this...

//INPUT DD DSN=input.gdg.base.name,DISP=SHR
//OUTPUT DD DSN=output.gdg.base.name(+1),DISP=(,CATLG)...

to create one new output generation on your new GDG
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Oct 17, 2013 8:30 pm
Reply with quote

I think she wants one output generation per input generation. However, that's a trivial enough thing that the hints she's been given so far should be more than adequate.
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 VB to VB copy - Full length reached SYNCSORT 8
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
Search our Forums:

Back to Top