IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Create a new GDG generation in step 1 of my jcl


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dkalyan_c

New User


Joined: 06 Apr 2006
Posts: 17

PostPosted: Sun Feb 14, 2010 10:48 am
Reply with quote

hello !!

i want to create a new GDG generation in step 1 of my jcl
this generation should be input to step2 and step 2 creates a second generation.This second generation is input step3 and step3 creates a third generation.

now, how do i refer the generations in my JCL

STEP1 - generation(+1)
STEP2 - INPUT -generation(+1)
OUTPUT - generation(+2)

STEP3 - INPUT -generation(+2)
OUTPUT - generation(+3)


is the above one correct? or i should always refer the current generation as generation(0)?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun Feb 14, 2010 11:33 am
Reply with quote

Hello,

Suggest you reconsider the process. . . What reason is there to create 3 new generations of the same fle in one job?

There is probably no need to create 3 new generations in a job. If you create some intermediate files and then a new +1 at the end, you will have everything you need.

Unless there is something i misunderstand. . .

Quote:
is the above one correct?
That could work, but may cause problems if there is a need to restart after some abend.
Back to top
View user's profile Send private message
naveensrimf

New User


Joined: 04 Oct 2005
Posts: 34

PostPosted: Mon Feb 15, 2010 6:15 am
Reply with quote

Above one is correct.

Please see the example for you.
// Step1 exec=ABC1
//File1 dd DSN=XYZ.ABC.123(+1),Disp=shr
//File 2 dd DSN=XYZ.ABC.123(+2),Disp=(new,catlg,delete),
.
.
// Step2 exec=ABC2
//File2 dd DSN=XYZ.ABC.123(+1),Disp=shr
//File 3 dd DSN=XYZ.ABC.123(+2),Disp=(new,catlg,delete),
.
.
//Step3exec=ABC3
//File3 dd DSN=XYZ.ABC.123(+1),Disp=shr
//File4 dd DSN=XYZ.ABC.123(+2),Disp=(new,catlg,delete),
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Feb 15, 2010 6:45 am
Reply with quote

Hello,

Quote:
Please see the example for you.

The example posted is not correct. . . Do not post "solutions" that have not been tested.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Feb 15, 2010 7:57 am
Reply with quote

Generations are not cataloged until the end of the job; if you build a new generation it is (+1) throughout the entire job. If you build another new generation, it is (+2) throughout the entire job. and so forth.

However, as Dick said, you will have problems with such an approach. One thing that is pretty much guaranteed with production jobs is that they are going to have problems sooner or later. Having someone trying to figure out how to do a restart at 3 AM of a job that creates three new generations will be challenging, at the least.
Back to top
View user's profile Send private message
prem_ibm

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Mon Feb 15, 2010 10:31 am
Reply with quote

Hi All,

Please clarify below :--

Whether its Depend on JES....?

1) Generation will be Cataloged after succesfull execution of Job....when JOB ENTRY SYSTEM (JES2)....(agree) i have tested for JES2,whether it will be same for JES3.


Thanks

Prem...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Feb 15, 2010 11:23 am
Reply with quote

Hello,

Quote:
i have tested for JES2,whether it will be same for JES3.
As far as i know generation datasets work the same. I don't have a jes3 system to use to confirm.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Mon Feb 15, 2010 4:05 pm
Reply with quote

Hi Dick !

JES2:
Generation will be Cataloged after succesfull execution of Job

JES3:
Generation will be Cataloged after succesfull execution of Step
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Feb 15, 2010 5:54 pm
Reply with quote

There's no difference between JES2 and JES3 as to how relative generation references work. From the JCL User's Guide Appendix A:
Quote:
Relative Generation Numbers

When creating a generation data set, the relative generation number tells the system whether this is the first data set being added during the job, the second, the third, etc. When retrieving a generation data set, the relative generation number tells the system how many data sets have been added to the group since this data set was added.

The first time you use a relative generation number for a generation data group within a job, the system establishes the relationship between the relative generation number and the absolute generation number. The system maintains this relationship throughout the job.

For example, if you create a generation data set with a relative generation number of (+1), the system recognizes any subsequent reference to (+1) throughout the job as having the same absolute generation number.

Relative generation numbers are obtained from the catalog as it existed:

* For JES2, at the beginning of the first step that specifies the generation data set by relative generation number.

Note: In a shared DASD environment, if two or more jobs running on different systems simultaneously create new generations of the same data set, one of the jobs could fail with a JCL error.

* For JES3, when the job is set up, and again by the system at the beginning of the first step that specifies the generation data set by relative generation number. If the most recent data set is not the same at both times, the results are unpredictable.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Feb 16, 2010 3:44 am
Reply with quote

Hi,

I have to disagree with this
Code:
JES2:
Generation will be Cataloged after succesfull execution of Job


A generation is cataloged after a step completion depending on the DISP



Gerry
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 16, 2010 3:55 am
Reply with quote

Note that it does not matter when the generation is cataloged, the first reference to a relative generation number fixes the sequence for the entire job. The manual has an example where the (-1) generation is used in step 1 and that refers to absolute generation 7. Step 2 deletes all generations and step 3 allocates a (+1) entry. Since the relative numbers were fixed at the time of first reference, the absolute generation cataloged in step 3 is G0009V00, even though generations up through G0008V00 were deleted in step 2.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Feb 16, 2010 2:46 pm
Reply with quote

Morning Robert !

I only talked about the time when cataloging come true.
And sorry, when something changed within the last 20 years.

But in those days, that was the crucial difference in this surroundings.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 16, 2010 4:38 pm
Reply with quote

UmeySan, the manual is not clear about precisely when a generation is cataloged -- and it appears that SMS managed GDGs are handled differently from non-SMS GDGs -- but the handling of relative generations hasn't changed in a long time.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts DFHPI1008 JSON generation failed COBOL Programming 0
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
Search our Forums:

Back to Top