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

NEW,CATLG,DELETE run for the first time and then rerun


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

New User


Joined: 17 Mar 2010
Posts: 3
Location: Hyderabad

PostPosted: Thu Mar 18, 2010 4:22 pm
Reply with quote

What happens if the JCL that has a Disp parameter like this DISP = (NEW,CATLG,DELETE) is run for the first time and then is rerun?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 18, 2010 4:26 pm
Reply with quote

Hi,

instead of asking, it's should not be too difficult to test it.


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

New User


Joined: 17 Mar 2010
Posts: 3
Location: Hyderabad

PostPosted: Thu Mar 18, 2010 4:47 pm
Reply with quote

I would've if I could've. Will be grateful if you do that for me please. Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Mar 18, 2010 4:55 pm
Reply with quote

If the job abended the first run, the data set was deleted so the rerun will go without any issues.

If the job completed successfully the first run, then the data set was cataloged and when the rerun is submitted, since you cannot have duplicate names in the catalog ....
Back to top
View user's profile Send private message
jennybrahma

New User


Joined: 17 Mar 2010
Posts: 3
Location: Hyderabad

PostPosted: Thu Mar 18, 2010 5:02 pm
Reply with quote

In the first case what would be the abend? S0C1 or S0C4?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 18, 2010 5:05 pm
Reply with quote

Hi,

the answer will vary depending on whether the dataset is a GDG or not,

if it's a disk or tape dataset.


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

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Mar 18, 2010 5:17 pm
Reply with quote

jennybrahma wrote:
In the first case what would be the abend? S0C1 or S0C4?

You have have the concept completely backwards.

If the problem program abended with any non-zero completion code -- 1 to 4095 -- JES will delete the data set and its catalog entry.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Mar 18, 2010 5:25 pm
Reply with quote

Hi Akatsukami,

you have return codes and abends confused.

If the job abends it will not complete with a completion code of 1 to 4095,

it will be an abend code such as S*** or U***.

The DELETE in DISP=(NEW,CATLG,DELETE) will only delete the dataset if the step ABENDS and not if a 0 to 4095 completion code is returned.


Gerry
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Mar 18, 2010 7:43 pm
Reply with quote

jennybrahma - Please read through the DISP parameter in the manuals.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Mar 18, 2010 7:55 pm
Reply with quote

gcicchet wrote:
Hi Akatsukami,

you have return codes and abends confused.

If the job abends it will not complete with a completion code of 1 to 4095,

it will be an abend code such as S*** or U***.

I respectfully disagree.

If you look at z/OS V1R10.0 MVS System Codes you will see that IBM does indeed refer to abend codes as "system completion codes". There are other features (bits set in the TCB, I think) that distinguish between a non-abending return code, a user abend, and a system abend; the range of the code turned is not one of them (hex FFF = decimal 4095).
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: Thu Mar 18, 2010 11:36 pm
Reply with quote

Hello,

Quote:
I respectfully disagree.
Please reconsider. . .

"S" abends are covered by "system completion code", but "return- codes" are not. Neither are "U" abends.

It really doesn't matter that
Quote:
If the problem program abended with any non-zero completion code -- 1 to 4095 -- JES will delete the data set and its catalog entry
is technically correct. . . It does matter that this is not the commonly accepted way to mention such.

I suspect less that 1/2 of 1% of the people here ever called an s0c1 a 193 abend . . . Or an sb37 a 2871 abend. . .

@jennybrahma:
Quote:
In the first case what would be the abend? S0C1 or S0C4?
In the first case, it would be any Sxxx or Unnnn ABEND (not a return code). Either the SOC1 or SOC4 would cause the file to be deleted. So would an SB37 or S806 or etc. . .
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Mar 19, 2010 12:00 am
Reply with quote

dick scherrer wrote:
Hello,

Quote:
I respectfully disagree.
Please reconsider. . .

I respectfully decline icon_wink.gif

Quote:
"S" abends are covered by "system completion code", but "return- codes" are not.

I entirely agree, and I hope that I did not write so unclearly that anyone could come to think so, or that I think so.
Quote:
Neither are "U" abends.

I agree; IBM refers to them as "user completion codes". Really.
Quote:
I suspect less that 1/2 of 1% of the people here ever called an s0c1 a 193 abend . . . Or an sb37 a 2871 abend. . .

Probably not. To the left, I do know SAS messages report its user abends as hexadecimal numbers, rather than as decimal numbers as is usual for user abends. I doubt if any SAS programmer has been confused by so much as a microfortnight by this, but I feel that it is illustrative of the fact that every completion(=abend) and return code is a three-nybble binary number, and that other means than range or internal representation must be used to distinguish them.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Fri Mar 19, 2010 3:50 am
Reply with quote

Just a matter of symantics. Say... 000-FFF and we'll all be happy icon_smile.gif For what it is worth, the reason that hex is useful is that system abends XYY usually (well, at least often) mean that YY was an SVC number, eg 806 is a problem with SVC x'06' (LOAD, if I recall). Using decimal hides that fact so that is why no one does it. I suspect that the only time you'd ever see a system abend listed as decimal is when a programmer who traps it is too lazy to do the conversion in a message. User abends are often in decimal (like LE user abends) because, by definition, there are no established standards for the meanings of user abends.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Mar 22, 2010 9:25 pm
Reply with quote

Robert sample wrote:
Quote:
If the job completed successfully the first run, then the data set was cataloged and when the rerun is submitted, since you cannot have duplicate names in the catalog ....
If I'm not mistaken, just the step w/the (NEW,CATLG,DELETE) must complete successfully, after that the job can abend, JCL out, etc. and the DS will remain Cataloged, if not explicitly deleted or uncated.

Jenny,

If the NEW DS still exists when you attempt to run the job again, you'll get a JCL error.

The most popular way to aviod that is to put an IEFBR14 step before the NEW step to delete the NEW DSN if it exists. An example is below:
Code:
//STEPnnn EXEC PGM=IEFBR14
//DD1 DD DSN=XXX.XX.XXXXX,DISP=(MOD,DELETE)
if your site doesn't use SMS, include space and DCB info in the DD stmt.
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 Mar 22, 2010 10:10 pm
Reply with quote

Hello,

Quote:
If the NEW DS still exists when you attempt to run the job again, you'll get a JCL error.
Or the dataset may be allocated to a different volume and then there will be a "not catlgd 2" error.

If you use IEFBR14 to "housekeep", you can use:
Code:

//DD1      DD DSN=MY.DATASET.NAME,DISP=(MOD,DELETE),
//            UNIT=xxxxx,SPACE=(TRK,0) 
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 To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
Search our Forums:

Back to Top