|
View previous topic :: View next topic
|
| Author |
Message |
Rupesh Gupta
New User
Joined: 10 Jan 2007 Posts: 13 Location: Chennai
|
|
|
|
| hi can someone tell me how to create a GDG using JCL |
|
| Back to top |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
HARIBHARAT
New User
Joined: 05 Jul 2006 Posts: 65 Location: pune
|
|
|
|
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 |
|
 |
guptae
Moderator

Joined: 14 Oct 2005 Posts: 1209 Location: Bangalore,India
|
|
|
|
Hi There,
It will create new version for gdg |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
muthuvel
Active User

Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
| 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 |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
| 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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|