Return code of step in JOB



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

Return code of step in JOB

Postby Chaitnya » Wed Mar 26, 2008 1:08 pm

Hi,

Can any one tell me how to store the return code of particular job step into a PS file :!:

Thanks
Chaitnya
 
Posts: 18
Joined: Wed Mar 26, 2008 1:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Return code of step in JOB

Postby MrSpock » Wed Mar 26, 2008 4:26 pm

From within the job while it is still running?

You have to retrieve that from the job's JSCB (Job Step Control Block) in the MVS Common Data Area.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Return code of step in JOB

Postby dick scherrer » Wed Mar 26, 2008 8:25 pm

Hello Chaitnya and welcome to the forums,

Can any one tell me how to store the return code of particular job step into a PS file
As a beginner, you will probably not be able to do this. There is no "standard" jcl that will capture some previous return code and store it in a file.

As was mentioned, you would need to use the system control info and this is typically not something a beginner would do.

Why do you want the rc in a file? If we understand your requirement, we may be able to offer suggestions.
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: Return code of step in JOB

Postby Chaitnya » Sat Apr 19, 2008 12:25 pm

Hi dick,

I have to check the Return code of previous JOB and then have to decide the next job need to execute or not.

So I am thinking to note down the return code of the JOB in PS file after it's execution. and in next job by reading return code from PS file deciding to run it or not.
Chaitnya
 
Posts: 18
Joined: Wed Mar 26, 2008 1:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Return code of step in JOB

Postby dick scherrer » Sat Apr 19, 2008 12:51 pm

Hi Chaitnya,

There is no single "return code" for a job. Each step generates a return code (most are zero, but they are still created as each step ends).

Your requirement is usually handled by the scheduling software. The "second" job is defined such that it will automatically run on the successful completion of the "first" job. If you talk with the people responsible for system scheduling, they can help you properly define your jobs and their successor/predecessor jobs.
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: Return code of step in JOB

Postby arunprasad.k » Sat Apr 19, 2008 2:41 pm

Yes as Dick clearly said, scheduler is the best way and possibly the simplest and safest way to track the jobs.

But if you are want this for some testing (no not for production env), you can use INTRDR and submit the job.

Suppose job B should run only if job A's STEP03's RC is 5, then in the last step of job A have a INTRDR statement with condition parameters.

But I would strongly recommend you not to do this for production jobs.

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post