Delete the temproary dataset if the job abends abnormally



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Delete the temproary dataset if the job abends abnormally

Postby thirujmca » Fri Apr 16, 2010 4:18 am

Hi,

I have the JOB with 5 steps. In 3rd step i have created one temporary dataset which used in step 5.

But the problem is,

while run the JOB, the job gets abend in step 4. then i found the problem, suddenly i restarted the JOB from step 3.

But now i got the JCL ERROR in step 3. why ?

i thought, the problem could be while creating the temprorary dataset,since we have the DD statement DD DSN=&&TEMP1, DISP=(NEW,PASS). Because we already created the temprorary dataset. but again we are trying to create the temporary dataset while restarting from step 3.So JCL ERROR. Like that i thought.

If my thought is correct, then how can we solve the problem without ABEND the JOB.
or else can we delete the temprorary dataset in any other way while running the JOB?


Can any one clarify...

Regards,
Thiru
thirujmca
 
Posts: 2
Joined: Thu Jun 25, 2009 4:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Delete the temproary dataset if the job abends abnormally

Postby Robert Sample » Fri Apr 16, 2010 5:01 am

But now i got the JCL ERROR in step 3. why ?

i thought, the problem could be while creating the temprorary dataset,since we have the DD statement DD DSN=&&TEMP1, DISP=(NEW,PASS).
Your problem is you are thinking. The job output will tell you EXACTLY what the problem is -- not what you THINK it may be. And since temporary data sets are deleted at the end of the job (see chapter 12.19.11 of the JCL Language Reference manual which explicitly states that a temporary data set is deleted at the end of the job), what you are thinking cannot happen -- the temporary data set is not interfering with your restarted job. When the job runs again, the system-generated name for the temporary data set will, again, be completely unique so there is no way there can be a problem.

Go back and look at the output of the job to find the real cause of the error (probably in the JES output messages) and fix it rather than thinking about the impossible.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Delete the temproary dataset if the job abends abnormally

Postby dick scherrer » Fri Apr 16, 2010 5:41 am

Hello and welcome to the forum,

For people here to help, you must post the diagnostic info generated by the system that describes the error.

I suspect that when step 3 ran correctly, it deleted something that was no longer needed. When the job was restarted in step 3 this caused a "data set not found" jcl error.

On today's mainframe systems, there is no reason to guess at the cause of a problem - it is reported by the system.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Delete the temproary dataset if the job abends abnormally

Postby Anuj Dhawan » Sun Apr 18, 2010 8:59 pm

thirujmca wrote:But now i got the JCL ERROR in step 3. why ?
What JCL error did you get?

Your problem is you are thinking
LOL, you give me a good laugh. :)
Anuj
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: Delete the temproary dataset if the job abends abnormally

Postby Robert Sample » Mon Apr 19, 2010 4:51 am

Anuj -- glad you got a laugh! But it is a legitimate concern -- people don't tend to pay attention to what the computer is telling them, rather thinking they know what the problem is. And most of the time, programmers who think they know what the problem is without looking at the computer output are completely wrong. I had one programmer try for 3 months to convince me that CICS was losing COMMAREA -- because he thought that was the problem. I finally had a two-hour session with level 2 support in which we traced through a dump and found out that -- lo and behold -- the programmer was stepping on storage (it eventually turned out a copy book had not been updated with the new length when he changed it in another program). The programmer was not even right as to which statement the program was failing on -- he tried at first to tell me that the code was failing a couple of hundred lines over, until I proved exactly how it had gotten to the failure point.

Programmers should think when coding. When debugging, they should stop thinking, believe what the computer tells them, and use the error message(s) to fix the problem(s).
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Delete the temproary dataset if the job abends abnormally

Postby Anuj Dhawan » Mon Jun 18, 2012 7:42 pm

(Not very sure what should I say - fortunately or unfortunately BUT) I've to agree with you, on this.

Will you believe once my manager asked me how much time will you take to solve an Abend? (mind you, this was the only statement!) - and I was like **** you! I can solve it before even looking at it!

Your programmers are lucky, they have you around :)
Anuj
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: Delete the temproary dataset if the job abends abnormall

Postby Akatsukami » Tue Jun 19, 2012 2:16 am

Anuj Dhawan wrote:Will you believe once my manager asked me how much time will you take to solve an Abend?

My reply would have been "How long is a piece of string?" :P
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Delete the temproary dataset if the job abends abnormall

Postby Anuj Dhawan » Tue Jun 19, 2012 10:26 am

When a manager comes from a non-programming background, it becomes tough to convince them on these factors. For them an abend is just an abend irrespective of what might have caused it. And that's where the point from Robert becomes vital - stop thinking and look at what caused it.
Anuj
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post