Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

abend a rexx in batch

Status
Not open for further replies.

mstone08

Programmer
Jun 10, 2002
3
US
I am running a rexx in batch through IKJEFT01. If the REXX meets certain criteria I want it to abend. I can force a return code and can then check the RC in my jcl, but I would rather get it to abend. I tried calling a standard utility that forces an ABEND, and it did abend, but the rexx still finished and subsequent steps in my JCL ran as if the IKJEFT01 step completed successfully.

It seems like this should be able to be done, but I couldn't find anything in any of the REXX manuals I've seen.

Thanks to any and all who can help.
 
I suspect that the problem is that when you run REXX in batch what is actually happening is that you are running a batch TSO session (IKJEFT01) and executing your REXX under it. What you are probably seeing is the return code from IKJEFT01. Whereas the batch execution will definately pass a REXX return code back to the caller as a condition code, I suspect that there is an ESTAE in IKJEFT01 that recovers any abend in the actual REXX code itself.

Of course I could be wrong.

 

Thanks for replying Kevin, I suspect you are right. I thought there might be a REXX command that will cause it to terminate abnormally so additional steps won't run. I could create a PROC that will run the IKJEFT01 and follow with a condition code check. It would do essentially the same thing. I just hate giving up on an issue that I spent time trying to solve.
 
Executing IKJEFT01 in a batch job always ends with return code 0. Use IKJEFT1B instead. This will use the numeric value on the EXIT clause in your REXX as the step return code.

Hope this helps, Roger Spencer
 
Thanks Roger. I am getting the return code to work, but when I call an abend step from the rexx, I get the dump, and even the abend, the step gives me a return code other than zero (what ever I specify on the exit command), but the step still completes successfully with that return code. The subsequent steps still run. I was hoping to be able to do it without having to check the return code of the rexx, but it does not appear that I can. Even with IKJEFT1B. No biggie, I'll do it the old fashioned way and add a step after the rexx to run/abend if cc>0.

Thanks everyone
 
Why not try IF logic in the JCL. Force your rexx step to return something other than a 0 return code.

// IF (ABEND | RC = 0 ) THEN
//SUPERC EXEC PGM=SUPERC,TIME=1
//SYSPRINT DD SYSOUT=*
//OLD DD DSN=dsn1,DISP=SHR
//NEW DD DSN=dsn2,DISP=SHR
// ELSE
// ENDIF


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top