Content deleted Content added
m →GDG JCL & features: {{pslink}} |
Guy Harris (talk | contribs) →Generation Data Group: Copy the "Generation Data Group" section from z/OS to here, as it's not z/OS-specific. Next step: edit it to clean it up. |
||
Line 154:
|title=IDCAMS – Create and delete GDG base using JCL
|url=http://code.xmlgadgets.com/2011/05/16/idcams-create-and-delete-gdg-base/comment-page-1}}</ref>
A Generation Data Group (GDG) is a description of how many generations of a file are to be kept and at what age a generation will be deleted. Whenever a new generation is created, the system checks whether one or more obsolete generations are to be deleted.
The purpose of GDGs is to automate archival, using the command language [[Job Control Language|JCL]], the file name given is generic. When DSN appears, the GDG name appears along with the history number, where
(0) is the most recent version
(-1), (-2), ... are previous generations
(+1) a new generation (see DD)
Another use of GDGs is to be able to address all generations simultaneously within a JCL script without having to know the number of currently available generations. To do this, you have to omit the parentheses and the generation number in the JCL when specifying the dataset.
====Example====
Creation of a standard GDG for five safety scopes, each at least 35 days old:
<syntaxhighlight lang="jcl">
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE GDG (NAME('DB2.FULLCOPY.DSNDB04.TSTEST') LIMIT(5) SCRATCH FOR(35))
/*
</syntaxhighlight>
Delete a standard GDG:
<syntaxhighlight lang="jcl">
//STEP3 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE DB2.FULLCOPY.DSNDB04.TSTEST GDG FORCE
/*
</syntaxhighlight>
==References==
|