Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Diff between a GDG and a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
akshathan

New User


Joined: 18 Aug 2006
Posts: 45

PostPosted: Thu Aug 31, 2006 4:04 pm    Post subject: Diff between a GDG and a dataset
Reply with quote

Hi all,

I want to know the major difference between the dataset and GDG.


reagrds
akshatha
Back to top
View user's profile Send private message

cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Aug 31, 2006 6:16 pm    Post subject: Re: Diff between a GDG and a dataset
Reply with quote

A GDG is a dataset, however, a dataset if not necessarily a GDG.

When you create a dataset in a job, you give that dataset a name and you may also give it a retention period or expiration date to specify when the dataset will be deleted from the catalog.

A GDG is a "generation data group". When you define a GDG to the system using the IDCAMS utility, you specify a limit. This limit indicates how many versions of the dataset to keep.

For example:
Code:

//DEFINE EXEC PGM=IDCAMS                                   
//SYSPRINT DD SYSOUT=*                                     
//SYSIN    DD *                                           
  DEF GDG  (NAME(HLQ.DATASET.NAME.FILE) LIMIT(7) SCRATCH) 
  ALTER 'HLQ.DATASET.NAME.FILE'  LIMIT(4)
  DEL 'HLQ.DATASET.NAME.FILE' GDG
/*                     


The 1st example is a DEFINE. You are creating a GDG by the name of HLQ.DATASET.NAME.FILE. The limit is set to 7.

The 2nd example is a ALTER. This would change the limit to 4.

The 3rd example is a DELETE. This would delete the GDG definition on the system.

Once a GDG is defined, you can then start creating GDG datasets. When you run your job to create this dataset, you specify:
//TAPEOA DD DSN=HLQ.DATASET.NAME.FILE(+1),UNIT=SYSDA...etc.

This would create a file called:
HLQ.DATASET.NAME.FILE.G0001V00

The next time you create the dataset it would be called:
HLQ.DATASET.NAME.FILE.G0002V00

The next time:
HLQ.DATASET.NAME.FILE.G0003V00

Each time the version goes up 1.

When you create the 8th version with the limit set to 7. The system will delete the 1st version (G0001V00). That way you always keep 7 versions of the dataset.

If you want to read the last created version of the dataset, You would code:
HLQ.DATASET.NAME.FILE(0)

If you wanted to read the last 5 versions into a sort, you would code:
//SORTIN DD DSN=HLQ.DATASET.NAME.FILE(0),DISP=SHR
// DD DSN=HLQ.DATASET.NAME.FILE(-1)DISP=SHR
// DD DSN=HLQ.DATASET.NAME.FILE(-2),DISP=SHR
// DD DSN=HLQ.DATASET.NAME.FILE(-3),DISP=SHR
// DD DSN=HLQ.DATASET.NAME.FILE(-4),DISP=SHR

Note that the versions are not created until a job ends, so if you write a GDG with:
//TAPEOA DD DSN=HLQ.DATASET.NAME.FILE(+1),UNIT=SYSDA...etc.
and you want to read the GDG in a later step, you must code:
//TAPEIA DD DSN=HLQ.DATASET.NAME.FILE(+1),DISP=SHR

However, if you want to READ it into another job, you must code:
//TAPEIA DD DSN=HLQ.DATASET.NAME.FILE(0),DISP=SHR

Also, you can always reading a specific version by coding:
//TAPEIA DD DSN=HLQ.DATASET.NAME.FILE.G0003V00,DISP=SHR
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us