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
 

 

Create a new GDG generation in step 1 of my jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Create a new GDG generation in step 1 of my jcl
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

Site Director


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

PostPosted: Sun Feb 14, 2010 11:33 am    Post subject:
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: 31

PostPosted: Mon Feb 15, 2010 6:15 am    Post subject: Reply to: Creating GDG
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

Site Director


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

PostPosted: Mon Feb 15, 2010 6:45 am    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Mon Feb 15, 2010 7:57 am    Post subject:
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    Post subject: Reply to: Creating GDG
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

Site Director


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

PostPosted: Mon Feb 15, 2010 11:23 am    Post subject:
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: 743
Location: Germany

PostPosted: Mon Feb 15, 2010 4:05 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Mon Feb 15, 2010 5:54 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Feb 16, 2010 3:44 am    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Feb 16, 2010 3:55 am    Post subject:
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: 743
Location: Germany

PostPosted: Tue Feb 16, 2010 2:46 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Tue Feb 16, 2010 4:38 pm    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm


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