Sort step return code not picked up
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: Sort step return code not picked up Author: mkarthik PostPosted: Sun Oct 16, 2005 5:03 pm
    —
I have a last step in my JCL which needs to be executed if prior steps return error code > 4 COND=(04,GE). This works for all conditions except one.
There is a prior sort step in the JCL. If I make its syntax incorrect, it will return a code of 16. But when I do this, the last step is not getting executed.
But if I give the stepname in the last step COND=(04,GE,SortStepName), then the last step gets executed.

I am not sure why, when I saw Sort step sysout, it shows an RC of 0, but in the JESMSGLG, it shows 16 for that step.

Can someone please explain?

#2:  Author: kolusuLocation: San Jose PostPosted: Sun Oct 16, 2005 6:09 pm
    —
Quote:

There is a prior sort step in the JCL. If I make its syntax incorrect, it will return a code of 16. But when I do this, the last step is not getting executed.
But if I give the stepname in the last step COND=(04,GE,SortStepName), then the last step gets executed.



Mkarthik,

Check this link for a detailed explanation of COND parameter.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B631/16.5.7?SHELF=&DT=20030423085347&CASE=

Quote:

There is a prior sort step in the JCL. If I make its syntax incorrect, it will return a code of 16.


You don't have to code incorrect syntax to set the return code. Sort products are capable of setting the return code.

If your intention is to execuete the last step if any of the above steps issues a return code greater than 4 , you can simply code and an IF statement

Check this link for examples of using IF statement

http://www.mvsforums.com/helpboards/viewtopic.php?t=5014

Also check this link which explains in detail about the IF/THEN/ELSE/ENDIF Statement Construct

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B631/17.0?DT=20030423085347

Hope this helps..

Cheers

Kolusu

#3:  Author: Bill DennisLocation: Iowa, USA PostPosted: Wed Oct 19, 2005 9:36 am
    —
Is the SORT invoked by a calling program? Perhaps the calling program gets control after the SORT CC=16 and sets the STEPCC as zero.

If the SORT step is simply a JCL invoked sort I don't know why the STEPCC would be zero if the SORT msgs show CC=16?



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group