GDG (+1), DISP=New



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

GDG (+1), DISP=New

Postby reebahs » Sun Jan 15, 2012 5:34 pm

Hi All,

I have a Query reg GDG`s.

What happens if we use (+1),DISP=New in Step1 and (+1),DISP=New in Step2 ? How many generations will be created for my base ?

Eg:

//Step1 EXEC ..........
//DD1 DD DSN=Base(+1),DISP=(NEW,CATLG,DELETE)
//Step2 EXEC .........
//DD2 DD DSN=Base(+1),DISP=(NEW,CATLG,DELETE)

Thanks,
Reebahs.
reebahs
 
Posts: 28
Joined: Thu Dec 09, 2010 1:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: GDG (+1), DISP=New

 

Re: GDG

Postby BillyBoyo » Sun Jan 15, 2012 5:37 pm

One generation will be created for each step that gets a chance to complete successfully.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: GDG

Postby reebahs » Sun Jan 15, 2012 5:44 pm

ThankQ

Reg,
Reebahs.
reebahs
 
Posts: 28
Joined: Thu Dec 09, 2010 1:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: GDG

Postby nevilh » Sun Jan 15, 2012 6:14 pm

One generation will be created for each step that gets a chance to complete successfully.
Are you sure ? I have not done this for a while but GDG's always used to be rolled in at JOB end. If this is still the case only one GDG will be created
nevilh
 
Posts: 38
Joined: Wed Jun 01, 2011 8:28 pm
Has thanked: 0 time
Been thanked: 3 times

Re: GDG

Postby BillyBoyo » Sun Jan 15, 2012 6:33 pm

Now that you say that, nevilh, I am very far from sure. Maybe a "not catlg" or "duplicate dataset" is on the way. Now I will check.

Haven't used GDGs for a while myself, and looking more closely :oops: I've never used them that way. Thanks,

Reebahs, hold that thought, or let us know what happened when you did run it.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: GDG

Postby skankatala » Sun Jan 15, 2012 7:16 pm

reebahs wrote:Hi All,

I have a Query reg GDG`s.

What happens if we use (+1),DISP=New in Step1 and (+1),DISP=New in Step2 ? How many generations will be created for my base ?

Eg:

//Step1 EXEC ..........
//DD1 DD DSN=Base(+1),DISP=(NEW,CATLG,DELETE)
//Step2 EXEC .........
//DD2 DD DSN=Base(+1),DISP=(NEW,CATLG,DELETE)

Thanks,
Reebahs.


Reebhas,

I think you will get a JCL error saying "File already cataloged" at STEP2. If you use the Same GDG base repeatedly in a single job, you should use the generation number like this : +1, +2, +3 ......

If you use +2 in STEP02, then you will get 1 generation for each step.

Regards,
Srikanth K
skankatala
 
Posts: 42
Joined: Sun Dec 11, 2011 9:45 am
Location: Hyderabad
Has thanked: 0 time
Been thanked: 0 time

Re: GDG

Postby steve-myers » Sun Jan 15, 2012 7:50 pm

1.

The allocation will fail in the second step if the GDG is SMS managed, or if it is not SMS managed, in the second step a dataset will be allocated with the same dataset name as in the first step, but it will not be cataloged.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: GDG

Postby steve-myers » Sun Jan 15, 2012 8:13 pm

I tried this job -
//A       EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  *
DATA IN FIRST STEP
//SYSUT2   DD  DISP=(,CATLG),UNIT=SYSDA,
//             SPACE=(TRK,1),
//             DSN=XXXXXX.TESTGDG(+1)
//SYSIN    DD  DUMMY
//B       EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  *
DATA IN SECOND STEP
//SYSUT2   DD  DISP=(,CATLG),UNIT=SYSDA,SPACE=(TRK,1),
//             DSN=XXXXXX.TESTGDG(+1)
//SYSIN    DD  DUMMY
The GDG index existed when the job started, but it was empty, and the datasets are SMS managed. The job failed in the second step with message

IEF286I ... - DISP FIELD INCOMPATIBLE WITH DSNAME
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: GDG

Postby MrSpock » Mon Jan 16, 2012 8:01 pm

Of course, the answer is one because of the inevitable JCL error. Why would you want to attempt to create and catalog two datasets with the exact same name?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: GDG

Postby halfteck » Tue Jan 17, 2012 2:46 am

Regarding your question, is it possible you and a colleague were discussing this issue, with no real reason for doing it. As, although i have seen in the very very dim and distant past, where jobs created multiple new generations in the same job. Today i find this extremely unlikely.
But in answer to the errors above. The (+1) becomes (0) at END of JOB, not end of step, even though it can be catalogued earlier.
The 'DISP FIELD INCOMPATIBLE WITH DSNAME' is due to the fact that there is already a (+1) in existance, and with a DISP=(NEW,CATLG) you are trying to create something that dfihnately already exists.
I would be very interested to know in what context you consider it a requirement to create 2 or more generatoins of the same GDG base in the same job.
halfteck
 
Posts: 42
Joined: Tue Nov 08, 2011 8:47 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post