Wednesday 11 July 2012


Generic Data Group (GDG).

Problem—In many situation we have to stored the data on daily basis. Suppose i have to record a customer data on daily basis. So each day i have to create a new file and store the data into it.
Solution-- So instead of this if i am using GDG i can create the new dataset on daily basis just submitting the one job on daily basis.
It will create a new version of the datset.
It is the group of dataset which are related to each other.
Every GDG dataset have unique generation number and version number.

 Steps for creating GDG.

         1)First we have to create GDG base. Then we are going to create its version USING IEFBR14 UTILITY   just we have to change file name.

2)    In the version created Dataset we can store our data.

Creation of GDG base.
Below program will create GDG base here we can define how many version of this dataset will be created.




This job will create my GDG base with name ‘ak999.gdg.bill’
I will explain each parameter in my control card.

Limit( ) – 

This field indicates how many versions of my Base GDG will be created.
Eg. Ak999.gdg.bill. G0001V00
       Ak999.gdg.bill. G0002V00
       Ak999.gdg.bill. G0003V00 etc.

The generation number GxxxxVyy where xxxx is in between 0001 to 9999 and the version no yy is 00.
When we have created a version you can use it as Current version i.e. ak999.gdg.bill (0)
Next version which you are going to create is ak999.gdg.bill (+1).

What is maximum limit for version ?
You can create upto 255 versions from one GDG base.
It means you can have 255 dataset with same functionality.

Name (dataset name)- 

You can give your dataset name which you wanted to be created.

Empty\ Noempty -  

Empty parameter specifies that when the versions of GDG reached to it’s limit then all existing generation of GDG are to be uncatloged.
NOEMPTY specifies that only oldest generation of GDG is to be uncatloged.

Scratch/Noscratch -

 Scratch specifies that if  entry of dataset will get removed from GDG index then the dataset will get physically removed from Volume so gives free space.
NOSCRATCH specifies that if dataset get removed from index it will just uncatloged not physically deleted.



Is there is another way to create GDG ?
Yes you can create a GDG by simple way.
Type “TSO gdgp” in command line and press Enter.

 
You will get screen below.


   
Now you wanna build an GDG base so give GDG base name and enter option “1” in command line. So your GDG base will get created.
Similarly you can delete,Alter GDG base.



How to create GDG versions ?
Once you have created GDG base you can’t sore data into GDG base. If you are going to edit GDG base it will gives you error like “ GDG base “
As you know IEFBR14 utility used to create a new dataset same way GDG is also a new dateaset so you have to give only dataset name i.e your Base name it will create version with your base name + Generation number get added into it like GxxxxVyy.

See below program for creating a version.

    

Upon submitting the above job will create version automatically.


    

Can i change record length , blocksize field for every version ?
Yes you can change these parameter as per the requirement. The job will run with maxcc=0.



Altering GDG

How can I change the parameters which i have used to create my GDG ?
Alter command will help in this situation. You can change the parameters after you defined your GDG base.
You can’t change LIMIT(n) parameter.
You can alter scratch/Noscratch and Empty/Noempty parameter


 Program to alter GDG.


    

Deleting a GDG –

How to delete a GDG version ?
As we can create a GDG version using IEFBR14 utility same utility is used to delete a GDG version.
Here we can delete only GDG version Not GDG base.

   
How to delete GDG base and it’s versions ?
To delete GDG base with its version use IDCAMS utility with purge and force subparameters.
Purge parameter- when we create GDG base it has it’s time period to exit is called as retention period after that period the GDG will get automatically deleted. So if you want to delete GDG before this time period you can use Purge option.



   

The expiration date is defined by system admin.

    

GDG with force option will delete GDG base as well as all it’s versions.

   






1 comment:

  1. Hi Avinash,

    Do you have any idea how can we rename the GDG base wihtout altering its any of the existing parameter.

    ReplyDelete