Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

REXX and batch return codes

555 views
Skip to first unread message

Schaeffer, Dave

unread,
May 6, 2002, 5:45:24 PM5/6/02
to
I'm hoping that someone can help me.

I have a REXX EXEC that is running in batch under IKJEFT01
and I would like to now get the REXX return code back.
I've tried running the REXX under both IKJEFT1A and IKJEFT1B
and I'm still getting back a 0 return code. I have added
a EXIT 16 to the begining of the EXEC to force it with
no luck. Any idea what what might be the problem?


Dave Schaeffer
IT Database Leader
Bendix Commercial Vehicle Systems LLC
E-Mail: Dave.Sc...@Bendix.com

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Jim Horne

unread,
May 6, 2002, 6:06:26 PM5/6/02
to
Dave,

This has been discussed before and it's pretty simple in concept
(implementing can be fun, which seems to be where you're having your
"opportunity").

An exec I coded a long time ago to force a return code is:

/*REXX*/
/* text EXEC to exit with any rc you want - default is 0 */
get_code = ''
Arg get_code .
If get_code = '' Then
get_code = 0
Exit get_code

This actually allows the user to tell the exec what code to end with and
then does it. I actually wrote this to help people do conditional JCL
checking so they could see the job flow without running programs. The key
thing here is the "EXIT get_code". It forces the return code from REXX to
be what I want it to be. IN earlier discussions here, some people have said
there are certain things you need to set up in order to make it happen.
I've never needed to but all the shops I've worked in are vanilla
environments as far as TSO goes. To help a little more, here's JCL I use to
execute my code:

//STEP0001 EXEC PGM=IKJEFT01,TIME=1000
//SYSEXEC DD DSN=TECJSH1.REXX.EXEC,DISP=SHR
//SYSPROC DD DSN=TECJSH1.REXX.EXEC,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
%EXITCODE 5
/*

Hope this helps,

Jim Horne
Lowe's Companies

Dave Schaffer wrote:
I have a REXX EXEC that is running in batch under IKJEFT01
and I would like to now get the REXX return code back.
I've tried running the REXX under both IKJEFT1A and IKJEFT1B and I'm still
getting back a 0 return code. I have added a EXIT 16 to the begining of the
EXEC to force it with no luck. Any idea what what might be the problem?

----------------------------------------------------------------------

Jeremy C B Nicoll

unread,
May 6, 2002, 6:24:45 PM5/6/02
to
In article
<A1F889499F5CD211A98A...@elyex115.ely.allied.com>,

"Schaeffer, Dave" <dave.sc...@BENDIX.COM> wrote:
> I'm hoping that someone can help me.

> I have a REXX EXEC that is running in batch under IKJEFT01
> and I would like to now get the REXX return code back.
> I've tried running the REXX under both IKJEFT1A and IKJEFT1B
> and I'm still getting back a 0 return code. I have added
> a EXIT 16 to the begining of the EXEC to force it with
> no luck. Any idea what what might be the problem?

Does your jcl just run this single exec, or run something else that in
turn runs that exec? There should be no problem at all with

//STEP13 EXEC PGM=IKJEFT01,PARM='%execname '

and probably none with:

//STEP13 EXEC PGM=IKJEFT01
..
//SYSTSIN DD *
%execname

But beware the latter if you are issuing several commands as you won't
necessarily see the rc you are hoping for.


Do you have ispf active? If so the ispf step needs to VPUT the required
rc [I think into ZISPFRC though I can't remember exactly] before
terminating otherwise the rc passed to IKJEFTxx is from the command that
starts ispf, not from the exec running under ispf.

--
Jeremy C B Nicoll - my opinions are my own.

Karlheinz Wittemann

unread,
May 6, 2002, 6:24:54 PM5/6/02
to
If you start your exec with ispf, you can set ZISPFRC and VPUT it:

//TSO EXEC PGM=IKJEFT01
//* some statements more for ISPF
//SYSTSIN DD *
ISPSTART CMD(rexxprog)

Heinz

TSO REXX Discussion List <TSO-...@VM.MARIST.EDU> schrieb am 06.05.02:


> I'm hoping that someone can help me.
>
> I have a REXX EXEC that is running in batch under IKJEFT01
> and I would like to now get the REXX return code back.
> I've tried running the REXX under both IKJEFT1A and IKJEFT1B
> and I'm still getting back a 0 return code. I have added
> a EXIT 16 to the begining of the EXEC to force it with
> no luck. Any idea what what might be the problem?
>
>

> Dave Schaeffer
> IT Database Leader
> Bendix Commercial Vehicle Systems LLC
> E-Mail: Dave.Sc...@Bendix.com
>

> ----------------------------------------------------------------------
> For TSO-REXX subscribe / signoff / archive access instructions,
> send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX


______________________________________________________________________________
Die schönsten Ski-Regionen der Alpen - jetzt bei Ferienklick.de
http://ferienklick.de/ski/?PP=2-5-100-105-38

0 new messages