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
 

 

Delete and Create a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Delete and Create a dataset
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jan 16, 2009 7:00 pm    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Jan 16, 2009 8:25 pm    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

Moderator Team Head


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

PostPosted: Fri Jan 16, 2009 8:38 pm    Post subject: Reply to: Delete and Create a dataset
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    Post subject:
Reply with quote

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

Moderator Team Head


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

PostPosted: Fri Jan 16, 2009 9:33 pm    Post subject: Reply to: Delete and Create a dataset
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Sat Jan 17, 2009 2:43 am    Post subject:
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: 1703
Location: Australia

PostPosted: Sat Jan 17, 2009 5:35 am    Post subject:
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: 1238
Location: Richfield, MN, USA

PostPosted: Sat Jan 17, 2009 6:48 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Mon Jan 19, 2009 11:07 am    Post subject:
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    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
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
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 to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


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