GDG GDGs are a group of datasets related to each other chronologically and functionally. Features: 1. All datasets within a GDG will ...
GDG
GDGs are a group of datasets related to each other chronologically and functionally.
Features:
1. All datasets within a GDG will have the same name.
2. The generation number of a dataset within the GDG is automatically assigned by the OS when it is created. GnnnnVnn
3. Datasets within a GDG can be referenced by the absolute generation names or by their relative generation number. Generation 0 always references the current generation.
4. 2 GDD versions(GDSs) can exist in different formats.
5. No more than 255 datasets can exist within one GDG
6. GDGs must reside on a tape or DASD
7. The DSN and UNIT parameters must be coded for all new generation datasets.
8. GDGs must be cataloged. The DISP parameter must be set to CATLG for all new generation datasets.
Creating GDGs
Step 1: Create an Index for a GDG or creating a GDG base
Before a GDS is created, an index or GDG base is created. The IDCAMS utility is used to create an index which uses the DEFINE GDG control statement.
DEFINE GDG (NAME(datasetname) -
LIMIT(n) -
SCRATCH / NOSCRATCH -
EMPTY / NOEMPTY
NAME – This is the parameter that contains the actual dataset name minus the generation and version number part.
LIMIT – this indicates how many generations you wish to maintain within the GDG.
SCRATCH – This is the default and it specifies that if the entry of a dataset from a GDG is removed from the index, then it should also be physically deleted from the volume it resides. NOSCRATCH indicates that the dataset should only be uncataloged and not physically deleted.
EMPTY – This is the default and specifies that all the existing generations of the GDG are to be uncataloged once the limit of possible generations has reached. NOEMPTY specifies that only the oldest generation is to be uncataloged.
Step 2: Create an GDG Model
The model prototype will contain the specifications for the DCB subparameters for all the datasets that will belong to that GDG. The model should reside in the same volume as its index entry. Each time a dataset is created, it will use the DCB parameters from the model.
Step 3: Creating a GDS
Specify DSN, UNIT and DISP=(NEW,CATLG,DELETE), DCB=([MODEL.DCB],LRECL=80,RECFM=FB,BLKSIZE=800) for creating anew GDS.
Generations are created at the end of the JOB and not at the end of each job step.
Note: You can omit the MODEL.DCB for SMS managed datasets.
Step 1 – COMPANY.EMPLOYEE(+1)
Step 2 - COMPANY.EMPLOYEE(+1)
Will result in JCL error.
Modifying Features of a GDG
ALTER gdg-name
LIMIT(n)
SCRATCH/NOSCRATH
EMPTY/NOEMPTY
Deleting GDG Index/GDG base
DELETE gdg-name GDG
PURGE
FORCE
Deleting a GDS
Individual GDS can be deleted coding a DELETE on DISP parameter in the DD statement for that GDS. Or it can be deleted directly from the 3.4(DSLIST) panel by specifying a ‘d’ against the GDS. Or it can deleted using the IDCAMS DELETE command itself.
GDGs and SMS
When you create a SMS managed GDS and do not catalog it, SMS does catalog it even if you don’t, but it will NOT place the GDS within the GDG structure. Such a state for a GDS is called as DEFERRED state. The Deferred state can be found from the allocation messages as “RETAINED” and not “CATALOGED”.
The GDS needs to be ROLLED IN to the GDG to make it usable. It can be done in 2 ways:
- To force a GDS to be added to the GDG structure use the ALTER IDCAMS command.
ALTER generation-dataset-name ROLLIN
- The second method is to reuse it with the DISP=(NEW,CATLG)
No comments
Post a Comment