View previous topic :: View next topic
|
Author |
Message |
vab987
New User
Joined: 01 Dec 2006 Posts: 29 Location: S.A
|
|
|
|
Hi,
Can someone please help me in understanding why the following JCL gives error whereas the second is perfect.
I'm deleting and then creating the same Dataset in these two jobs.
1)
Code: |
//DEL01#11 EXEC PGM=IEFBR14
//ERRFILE DD DSN=CMRA.ERRFILE.CASBI521,
// DISP=(MOD,DELETE,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(0))
//ERRFILE DD DSN=CMRA.ERRFILE.CASBI521,DISP=(,CATLG),
RECFM=FB,LRECL=82,
UNIT=SYSDA,SPACE=(CYL,(1,1))
|
2)
Code: |
//DEL01#11 EXEC PGM=IEFBR14
//ERRFILE DD DSN=CMRA.ERRFILE.CASBI521,
DISP=(MOD,DELETE,DELETE),
UNIT=SYSDA,SPACE=(TRK,(0))
//DEL01#12 EXEC PGM=IEFBR14
//ERRFILE DD DSN=CMRA.ERRFILE.CASBI521,DISP=(,CATLG),
RECFM=FB,LRECL=82,
UNIT=SYSDA,SPACE=(CYL,(1,1))
|
Regards,
Vab |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Because the dataset is allocated via the JCL until end of step, and the disposition of (MOD,DELETE,DELETE) will not be realised until end of step.
Therefor the dataset exists in that step, so you get JCL error for duplicate dataset |
|
Back to top |
|
|
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
STEP1
FILE1 DD DSN=x.y.z(1),
-----
-----
step4
FILE2 DD DSN=x.y.z(0), i.e(we are refereing the file created in step1..
if an abend occurs in step4 and need to restart the job from step4 then which version do we need to refer in step4 ?
interview question..... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Mukesh Pandey wrote: |
interview question..... |
And, what was your reponse? What results have you seen by testing this yourself? |
|
Back to top |
|
|
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
my response was it would be (1) ........ |
|
Back to top |
|
|
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
sorry.. my response was it would be (0) .... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Is x.y.z supposed to represent a Generation Data Group (i.e. a GDG)? If so, then the (1) and (0) should represent relative generations, not versions. Your topic is confusing. |
|
Back to top |
|
|
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
yes it is a gdg generation... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Mukesh, the scenario that I think you've described sounds rather odd to me, but here's my take:
In STEP1 of a job, you will create a new generation of a GDG dataset by specifying a relative generation number of +1 and by specifying (NEW,CATLG) for the disposition.
Let's say that before your job executes that are already 10 generations cataloged to the base. The most current generation (the '0' generation) at this moment is X.Y.Z.G0010V00.
Before the job starts to execute, JES will resolve any of the relative generation references to their actual real value. Let's say that in STEP1, your relative generation of +1 is now resolved to be X.Y.Z.G0011V00. That means that, in the same job, if in STEP4 you want to use the same generation dataset that you referred to in STEP1, then you must also refer to it using the +1 relative generation.
Now, if STEP1 executes correctly and catalogs the new generation G0011V00, but then the job abends, then G0011V00 will now be the current generation (generation '0'), and if you wish to restart the job at STEP4, then the relative generation will have to be changed from +1 to 0. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
1) What does this have to do with the original question from vab987?
2) x.y.z(0) in step4 would not refer to the generation created in step1 of the same job! It would refer to the latest generation before the job started. To refer to that same generation when restarting the job in step4 after step1 has cataloged a new generation you would need to change the generation in step4 to (-1). |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Mukesh Pandey wrote: |
my response was it would be (1) ........ |
Would that be +1 or -1 ?
Please read my PM very very carefully !!!!!!!!!!!!!!!!! |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
this thread is getting confusing, there seems to be 2 unrelated questions by different people.
I believe Expat answered the first question.
Regarding the second question, I'm with Kevin, if a GDG is created correctly in STEP1 with a (+1) and STEP4 of the same job needs to reference it, it also needs to use (+1).
If STEP4 needs to be restarted because of some abend, the JCL will need the (+1) to be changed to 0 or +0.
This is making assumptions that no other steps between STEP1 and STEP4 created +2 and +3 etc GDGs.
Gerry |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1248 Location: Richfield, MN, USA
|
|
|
|
Confusing to say the least.
Mukesh,
Please start a new thread for a different question.
Vab,
DDNAMEs should be unique for a job step. See JCL manual. |
|
Back to top |
|
|
vab987
New User
Joined: 01 Dec 2006 Posts: 29 Location: S.A
|
|
|
|
Thanks for all those replied.
Regards,
Vaibhav |
|
Back to top |
|
|
Mukesh Pandey
Active User
Joined: 11 Nov 2008 Posts: 143 Location: India
|
|
|
|
Superk and Douglas.. thanks for the response.. it is clear now..... |
|
Back to top |
|
|
abhishek dadhichi
New User
Joined: 19 Apr 2007 Posts: 37 Location: Bangalore
|
|
|
|
Hi Douglas,
I just thought of this...Suppose if the the generation which is created in the Step01 is the only generation for that GDG base i.e it is the latest one
,then I think we need to mention (+0) in Step04 after it is restarted as that is the latest and the only one..
Plz correct me if I am wrong!!
Thanks,
Abhishek |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I think you should read all of the replies, maybe I didn't make it clear but that's exactly what Kevin and I mentioned.
If you restart STEP04, you need +0 to refernce the dataset created in STEP01.
Gerry |
|
Back to top |
|
|
|