Copy from GDG to GDG using REXX



IBM's Command List programming language & Restructured Extended Executor

Copy from GDG to GDG using REXX

Postby nbdkygs » Mon Aug 04, 2008 1:33 pm

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.
nbdkygs
 
Posts: 8
Joined: Mon Jun 23, 2008 12:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Copy from GDG to GDG using REXX

Postby MrSpock » Mon Aug 04, 2008 5:27 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post