|
View previous topic :: View next topic
|
| Author |
Message |
anu_kannu
New User

Joined: 20 Sep 2005 Posts: 6
|
|
|
|
Hi all,
Im new to the forum.. I have a query..
How could I clear the data from all the versions of a GDG?
please help |
|
| Back to top |
|
 |
Kevin
Active User

Joined: 25 Aug 2005 Posts: 234
|
|
|
|
In a Generation Data Group (GDG), there is the GENERATION:
HLQ.MY.GDG.G0001V00
and there is the VERSION:
HLQ.MY.GDG.G0001V00
What exactly do you mean by "Clear all the Versions"?
To clear all the Generations, a simple DISP=(OLD,DELETE) or (MOD,DELETE) allocation is all that is required:
| Code: |
//DEL EXEC PGM=IEFBR14
//DD1 DD DSN=HLQ.MY.GDG,DISP=(MOD,DELETE,DELETE),...
|
|
|
| Back to top |
|
 |
anu_kannu
New User

Joined: 20 Sep 2005 Posts: 6
|
|
|
|
Hi Kevin,
I want to make all the generations (files) empty, rather than delete.
HLQ.MY.GDG.G0001V00
HLQ.MY.GDG.G0002V00 |
|
| Back to top |
|
 |
Kevin
Active User

Joined: 25 Aug 2005 Posts: 234
|
|
|
|
To empty a dataset, you can use this logic:
| Code: |
//STEP0001 EXEC PGM=SORT
//SORTIN DD DISP=SHR,DSN=HLQ.MY.GDG.G0001V00
//SORTOUT DD DISP=SHR,DSN=HLQ.MY.GDG.G0001V00
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OMIT COND=ALL
//*
|
However, there is no special trick to make this work in just one step for all of the generations. This step would have to be repeated, either manually or programatically, for every generation as needed. |
|
| Back to top |
|
 |
anu_kannu
New User

Joined: 20 Sep 2005 Posts: 6
|
|
|
|
| Thanks Kevin |
|
| Back to top |
|
 |
|
|