MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sort step return code not picked up

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mkarthik
Beginner


Joined: 16 Oct 2005
Posts: 1
Topics: 1

PostPosted: Sun Oct 16, 2005 5:03 pm    Post subject: Sort step return code not picked up Reply with quote

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?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Sun Oct 16, 2005 6:09 pm    Post subject: Reply with quote

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
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Oct 19, 2005 9:36 am    Post subject: Reply with quote

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?
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group