Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
GDG in JCL

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

New User


Joined: 10 Jan 2007
Posts: 13
Location: Chennai

PostPosted: Wed Feb 14, 2007 10:51 am    Post subject: GDG in JCL
Reply with quote

hi can someone tell me how to create a GDG using JCL
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Feb 14, 2007 10:58 am    Post subject:
Reply with quote

GDG is a group of chronologically related datasets.

Please find attached jcl

Code:
//* TO CREATE GDG                                               
//STEP1  EXEC PGM=IDCAMS                                       
//SYSIN  DD     *                                               
   DEFINE GDG(                    -                             
          NAME(TBH2.DECE001.DATA) -                             
          LIMIT(10)               -                             
          NOEMPTY                 -                             
          SCRATCH)                                             
/*                                                             
//SYSPRINT  DD SYSOUT=*                                         
//STEP2  EXEC PGM=IEFBR14                                       
//MODEL1 DD   DSN=TBH2.DECE001.DATA(+1),DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,25),RLSE),UNIT=DISK,               
//            DCB=(LRECL=145,RECFM=FB)                         
//*                                                             
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 14, 2007 9:03 pm    Post subject:
Reply with quote

Hello,

The IDCAMS step will define the new gdg.

The IEFBR14 step can cause problems. Creating a +1 with BR14 basically makes a catalog entry and allocates space. If an open/read is issued to a file created by this method there may be problems. This is NOT a truly empty file - it has no end-of-file mark. There have been posts lately from people who have had problems with allocated but not usable files.

I'd recommend doing the DEFINE but letting a "real" job create the new version(s). That way abends may be avoided.
Back to top
View user's profile Send private message
HARIBHARAT

New User


Joined: 05 Jul 2006
Posts: 65
Location: pune

PostPosted: Thu Feb 15, 2007 12:59 pm    Post subject: Re: How to create a GDG in JCL
Reply with quote

Hi ektha

What is doing second step,idcam create the gdg,remain step what will do
STEP2 EXEC PGM=IEFBR14
//MODEL1 DD DSN=TBH2.DECE001.DATA(+1),DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,25),RLSE),UNIT=DISK,
// DCB=(LRECL=145,RECFM=FB)
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Feb 15, 2007 1:53 pm    Post subject:
Reply with quote

Hi There,

It will create new version for gdg
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Feb 15, 2007 8:16 pm    Post subject:
Reply with quote

Hello,

Yes, it will create a new version.

The new version will have no data in it and if it is not on an SMS dasd, it may cause problems (it won't have an end-of-file). If the previous data at that place on the disk had the same dcb info as the "new" file, a program reading it will either abend (i.e. s0c7) or produce incorrect results. If the dcb info does not match, the program typically abends with an s013-20.

Is there a business reason to have gdg version of this kind?
Back to top
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Fri Feb 16, 2007 2:23 pm    Post subject: Re: How to create a GDG in JCL
Reply with quote

Code:
STEP2 EXEC PGM=IEFBR14
//MODEL1 DD DSN=TBH2.DECE001.DATA(+1),DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,25),RLSE),UNIT=DISK,
// DCB=(LRECL=145,RECFM=FB)


When i checked the above code,it creates new generation G001V00,Can somebody please tell me how to create a new version G001V01?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Fri Feb 16, 2007 5:52 pm    Post subject: Re: How to create a GDG in JCL
Reply with quote

muthuvel wrote:
Can somebody please tell me how to create a new version G001V01?


Code:
STEP2 EXEC PGM=IEFBR14
//MODEL1 DD DSN=TBH2.DECE001.DATA.G0001V01,DISP=(,CATLG,DELETE),
// SPACE=(TRK,(10,25),RLSE),UNIT=DISK,
// LRECL=145,RECFM=FB
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Feb 16, 2007 10:49 pm    Post subject:
Reply with quote

Hello,

Please explain what you mean by "create a new version G001V01".

Once a generation is created, you typically will not want/need to create a "new" file with that same version.

If you have created a version with incorrect/imcomplete data, uncatalog/delete that version and re-run the process that created the (+1) version.

Keep in mind that if you try to catalog a "new" G001V01, and one already exista, that will fail.

Another consideration with GDG datasets is that normally the relative version number (i.e. 0, -1, +1, etc) is used to reference the dataset. There is little reason to code specific GxxxVx levels in your JCL.

If you want to create/use a dataset and then create a "new" one, you don't need to define it as a GDG.
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:


Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us