Page 1 of 1

Delete the temproary dataset if the job abends abnormally

PostPosted: Fri Apr 16, 2010 4:18 am
by thirujmca
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

Re: Delete the temproary dataset if the job abends abnormally

PostPosted: Fri Apr 16, 2010 5:01 am
by Robert Sample
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.

Re: Delete the temproary dataset if the job abends abnormally

PostPosted: Fri Apr 16, 2010 5:41 am
by dick scherrer
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.

Re: Delete the temproary dataset if the job abends abnormally

PostPosted: Sun Apr 18, 2010 8:59 pm
by Anuj Dhawan
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. :)

Re: Delete the temproary dataset if the job abends abnormally

PostPosted: Mon Apr 19, 2010 4:51 am
by Robert Sample
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).

Re: Delete the temproary dataset if the job abends abnormally

PostPosted: Mon Jun 18, 2012 7:42 pm
by Anuj Dhawan
(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 :)

Re: Delete the temproary dataset if the job abends abnormall

PostPosted: Tue Jun 19, 2012 2:16 am
by Akatsukami
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

Re: Delete the temproary dataset if the job abends abnormall

PostPosted: Tue Jun 19, 2012 10:26 am
by Anuj Dhawan
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.