Page 1 of 1

Copy from GDG to GDG using REXX

PostPosted: Mon Aug 04, 2008 1:33 pm
by nbdkygs
I have a requirement of copying the current generation of one GDG to +1 generation of another GDG. The new GDG getting created must have similar properties to the GDG from where we are copying. I tried by the following way:

 /*****************************REXX*************************************/                                     
 "NEWSTACK" /* CREATE A NEW DATA STACK FOR INPUT ONLY */                 
 "EXECIO * DISKR DATAIN (FINIS"                                         
 QUEUE '' /* ADD A NULL LINE TO INDICATE THE END OF THE INFORMATION */   
 "EXECIO * DISKW DATAOUT (FINIS"                                         
 "DELSTACK" /* DELETE THE NEW DATA STACK */                             
 "FREE F(DATAIN DATAOUT)"


But i didnt the result. Please tell me how can I proceed to get this done.

Re: Copy from GDG to GDG using REXX

PostPosted: Mon Aug 04, 2008 5:27 pm
by MrSpock
Let's start by getting some of the terminology straightened out. A dataset that is a member of a Generation Data Group has two components - a generation number and a version number. The generation number is represented by the Gnnnn part of the name, and the version is represented by the Vnn part of the name. The generation number is managed automatically by the system. The version number is not, and can only be managed by the programmer.

The concept of referring to a generation dataset by its relative generation is strictly a batch-oriented (JCL) construct. Any other use of a GDG must be by its fully-qualified dataset name. Please note this comment concerning the use of the TSO ALLOCATE command from the command documentation:
To allocate a member of a generation data group, specify the fully-qualified data set name, including the generation number.


In your post, you stated

nbdkygs wrote:The new GDG getting created must have similar properties to the GDG from where we are copying.


What do you mean by this? The program that you invoke to perform the copy (IEBGENER or SORT) should handle this for you.