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

Delete and Create a dataset


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

New User


Joined: 01 Dec 2006
Posts: 29
Location: S.A

PostPosted: Fri Jan 16, 2009 6:44 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jan 16, 2009 7:00 pm
Reply with quote

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
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Fri Jan 16, 2009 8:11 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jan 16, 2009 8:25 pm
Reply with quote

Mukesh Pandey wrote:
interview question.....


And, what was your reponse? What results have you seen by testing this yourself?
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Fri Jan 16, 2009 8:34 pm
Reply with quote

my response was it would be (1) ........
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Fri Jan 16, 2009 8:34 pm
Reply with quote

sorry.. my response was it would be (0) ....
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jan 16, 2009 8:38 pm
Reply with quote

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. icon_confused.gif
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Fri Jan 16, 2009 8:40 pm
Reply with quote

yes it is a gdg generation...
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jan 16, 2009 9:33 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Jan 16, 2009 9:48 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Jan 17, 2009 2:43 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Sat Jan 17, 2009 5:35 am
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Sat Jan 17, 2009 6:48 am
Reply with quote

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
View user's profile Send private message
vab987

New User


Joined: 01 Dec 2006
Posts: 29
Location: S.A

PostPosted: Sat Jan 17, 2009 10:28 pm
Reply with quote

Thanks for all those replied.

Regards,
Vaibhav
Back to top
View user's profile Send private message
Mukesh Pandey

Active User


Joined: 11 Nov 2008
Posts: 143
Location: India

PostPosted: Mon Jan 19, 2009 10:03 am
Reply with quote

Superk and Douglas.. thanks for the response.. it is clear now.....
Back to top
View user's profile Send private message
abhishek dadhichi

New User


Joined: 19 Apr 2007
Posts: 37
Location: Bangalore

PostPosted: Mon Jan 19, 2009 10:52 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jan 19, 2009 11:07 am
Reply with quote

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
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 DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to create a list of SAR jobs with... CA Products 3
Search our Forums:

Back to Top