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

JCL to copy a GDG (all generations) to another GDG


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

New User


Joined: 15 Feb 2006
Posts: 32

PostPosted: Wed Apr 12, 2006 5:28 pm
Reply with quote

Hi

Do any of you have JCL to copy a GDG (all generations) to another GDG.

I have a GDG with 20 generations. I need to copy all the generations of this gdg to another GDG such that the second GDG will also have 20 generations.

I tried following step :

//STEP0010 EXEC PGM=ICEGENER
//SYSUT1 DD DISP=SHR,DSN=GDG.NAME1
//SYSUT2 DD DSN=GDG.NAME2(+1),
// DISP=(NEW,CATLG),
// SPACE=(CYL,(50,50),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*

But this copied all the generations to one generation of new GDG. Can I have 20 generations in the second GDG?

I know of one approach using idcams but I will appreciate any other suggestions.

Thanks
TG
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Apr 12, 2006 6:12 pm
Reply with quote

I'm not sure exactly what you're looking for from the forum members. If you want to copy 20 generations to another 20 generations, then you will have to perform 20 copy operations. How you go about that is entirely up to you - do you want a single job step with 20 input and 20 output DD's, a single job with 20 job steps, or one job run 20 times with varying input/output designations?

If it were me, I would write a program that would:

- determine all current generations via LISTCAT
- DEFINE the new target GDG base
- Loop through the LISTCAT data and copy each current generation to the same generation on the target GDG, i.e. OLD.GDG.G0001V00 copy to NEW.GDG.G0001V00, OLD.GDG.G0002V00 copy to NEW.GDG.G0002V00, and so on.
Back to top
View user's profile Send private message
tusharguptait

New User


Joined: 15 Feb 2006
Posts: 32

PostPosted: Thu Apr 13, 2006 8:55 am
Reply with quote

Hi,
Perhaps I was not able to explain my problem clearly. I need to copy all the generations of old gdg to new gdg ( with one-to-one relationship between input and output versions ) in one job step, with one input dd and one output dd. Can it be done?

Thanks
TG
Back to top
View user's profile Send private message
yogesh

New User


Joined: 27 May 2005
Posts: 21

PostPosted: Thu Apr 13, 2006 4:40 pm
Reply with quote

I Dont think there is any JCL for coping all generations of one GDG to other.
Back to top
View user's profile Send private message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Thu May 11, 2006 10:08 am
Reply with quote

Post Removed, Complaint received...

Quote:
Hi,

This is ***** from Pune, India. The post named below in your forum (ibmmainframes.com) has critical information related to me any my company.

JCL to copy a GDG (all generations) to another GDG

The posting was made by some of your member named ranga_subham. I am not sure how he came to know about this critical information.

Please remove the posting from the site, and also inform Mr. ranga_subham not to post any such critical info in future.

This is on top of the priority and I am getting into lot of trouble here. I am under a lot of presure here. Please get the same removed.

I am anxiously waiting for your reply. Please respond to me in case of any concerns

Thanks & Regards,
******.
Back to top
View user's profile Send private message
Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Thu May 11, 2006 11:29 am
Reply with quote

I tried the code but got RC=4, with no action taken on either source or target GDGs. Here is the message:
Code:

 COPY                               -
 DATASET(                           -
 INCLUDE(                           -
 D09SE02.AAL.SCANEXT.C0K.**         -
 )                                  -
 )                                  -
 RENUNC(D09SE02.AAL.SCANEXT.C0K.**, -
 D09SE02.AAL.SCANEXT.C0K1.**)       -
 CATALOG TGTGDS(ACTIVE)             
ADR101I (R/I)-RI01 (01), TASKID 001 HAS BEEN ASSIGNED TO COMMAND 'COPY '       
ADR109I (R/I)-RI01 (01), 2006.131 00:47:06 INITIAL SCAN OF USER CONTROL STATEMENTS COMPLETED.
ADR016I (001)-PRIME(01), RACF LOGGING OPTION IN EFFECT FOR THIS TASK           
ADR006I (001)-STEND(01), 2006.131 00:47:06 EXECUTION BEGINS                     
ADR470W (001)-DDDS (04), NO DATA SETS SELECTED FOR PROCESSING                   
ADR006I (001)-STEND(02), 2006.131 00:47:08 EXECUTION ENDS                       
ADR013I (001)-CLTSK(01), 2006.131 00:47:08 TASK COMPLETED WITH RETURN CODE 0004
ADR012I (SCH)-DSSU (01), 2006.131 00:47:08 DFSMSDSS PROCESSING COMPLETE. HIGHEST RETURN CODE IS 0004 FROM:
                         TASK    001                                           


The source GDG has 2 gens & has data and target GDG has a base.
Am I forgetting something?
Back to top
View user's profile Send private message
ranga_subham

New User


Joined: 01 Jul 2005
Posts: 51

PostPosted: Thu May 11, 2006 1:01 pm
Reply with quote

Hi,

Make sure that the input and output GDG base names are of the same length.

If you see the "D09SE02.AAL.SCANEXT.C0K.**" is different than output "D09SE02.AAL.SCANEXT.C0K1.**". So, make sure that both the GDG bases have the equal qualifiers. Pls try and let me know.

HTH.
Back to top
View user's profile Send private message
Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Thu May 11, 2006 2:35 pm
Reply with quote

Actually length is not a problem, since it is unconditional renaming (RENUNC).
When I tried before, the gens were migrated. Usually, when migrated datasets are used in jobs, SMS would automatically receive a notification to bring them back to DASD. I assumed the same would happen with ADRDSSU, but regrettably it didn't. I manually HRECALLed them and submitted the same job again. This time I got the expected result.
Thanks!

Regards,
Bharani.
Back to top
View user's profile Send private message
tusharguptait

New User


Joined: 15 Feb 2006
Posts: 32

PostPosted: Fri May 12, 2006 5:33 pm
Reply with quote

Hi,
I have a query regarding this jcl. Can we specify storage class of the gdg to be created. In the present jcl , the target versions are taking the storage class of source one .

Regards
TG
Back to top
View user's profile Send private message
tusharguptait

New User


Joined: 15 Feb 2006
Posts: 32

PostPosted: Fri May 19, 2006 2:55 pm
Reply with quote

Hi All,
Can ADRDSSU be used to copy all the generations of gdg when the generations are residing on tape.

Regards
TG
Back to top
View user's profile Send private message
Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Mon May 22, 2006 4:58 pm
Reply with quote

I am afraid we don't seem to be blessed with such privilege because the ADRDSSU options DUMP and COPYDUMP, which can work with both tapes and DASD at the same time, are not having the RENUNC option, neither are they able to dump (as such) all the GDG versions if given as input in any format. So you have to be content with DASD operations for this facility.
Back to top
View user's profile Send private message
bharath.gct

New User


Joined: 03 May 2007
Posts: 1
Location: Chennai

PostPosted: Thu May 03, 2007 11:56 am
Reply with quote

Hi All,

POST REMOVED. Check:

ibmmainframes.com/viewtopic.php?t=20568


Thx in Advance!!!

Regards,
Bharath
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 03, 2007 2:55 pm
Reply with quote

If the source and target absolute generation numbers differ then you will need to copy the source inputs one by one. One job, just submitted many times.
Back to top
View user's profile Send private message
binuraj_s

New User


Joined: 14 Sep 2005
Posts: 4

PostPosted: Fri Feb 27, 2009 10:50 am
Reply with quote

Not sure whether somebody would be reading this topic anymore.Anyways my question is related to this topic.

I need to copy from one GDG to another, but I need to copy only the latest versions created in one gdg to the other.

For eg:- if there are 3 versions created in the original GDG everytime a Job runs. I will start by copying these 3 versions to my backup GDG using the above method. The original GDG has a limit of 3 and backup GDG has a limit of 500.

Going forward, whenever a new set of versions gets created in the original GDG , I need to back these versions to my backup GDG.

I tried the above method, but the above method always overwrite the entire GDG in the target everytime. I don't want the older versions to be overwritten.

Please let me know if this can be achieved using ADRDSSU.
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: Fri Feb 27, 2009 10:58 am
Reply with quote

Hello,

Quote:
but I need to copy only the latest versions created in one gdg to the other
What defines "the latest versions"? Actually, they are most likely NOT versions, but rather generations. And yes there is a considerable difference.

If the copy is always to be 3, you could use DSNOLD(-2), DSNOLD(-1), and DSNOLD(0) as input to a copy and DSNNEW(+1), DSNNEW(+2), and DSNNEW(+3) as output from the copy.

Possibly, there is something i misunderstand.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Feb 27, 2009 12:19 pm
Reply with quote

Also
Quote:
The original GDG has a limit of 3 and backup GDG has a limit of 500.

How did you manage to achieve this ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Feb 27, 2009 4:05 pm
Reply with quote

expat, dick's calculator is getting around .... icon_biggrin.gif
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Fri Feb 27, 2009 5:07 pm
Reply with quote

...just by defining two different GDG's, i think

Nce weekend
Back to top
View user's profile Send private message
binuraj_s

New User


Joined: 14 Sep 2005
Posts: 4

PostPosted: Fri Feb 27, 2009 8:59 pm
Reply with quote

Well I should have understood that I should be careful while mixing facts and fakes :-)...That GDG limit of 500 was a random number that came to my mind when I posted this query. Lets keep it at 255 to keep the question realistic. I hope that answers "Expat's" question.

Coming to Dick's solution, your assumption about "generations" is correct.I would like to add another twist to the question. The limit of original GDG is not known. In other words I need to copy all the generations of the original GDG to backup GDG appending it rather than overwriting the existing generations in the backup GDG.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Feb 27, 2009 9:26 pm
Reply with quote

You can take in all generations by specifying the base GDG name (no relative generation number). You may want to delete all generation so that they do not get taken in again next run. But how many output generations do you want from each run, 1 or the same number as the input generations read?
Back to top
View user's profile Send private message
binuraj_s

New User


Joined: 14 Sep 2005
Posts: 4

PostPosted: Sat Feb 28, 2009 3:01 am
Reply with quote

Hi Douglas,

I would want the O/P to have the same number of generations as in I/P.

Rgds,
Binu
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: Sat Feb 28, 2009 3:16 am
Reply with quote

Hello,

One way to do what you want would be to do a listcat on the "input" gdg and use that to generate the appropriate number of copy and dd statements.
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