Hlib
Hlib

Reputation: 3064

IBM Z/os Rexx script returns 255 exit code

I have simple Rexx script hello_world.rexx:

/* rexx */

SAY 'Hello World'

EXIT

Then I run it:

>./hello_world.rexx
Hello World

It executes well, but somehow I always get 255 exit code.

>echo $?
255

Does somebody know how to fix script to get 0 as exit code?

Upvotes: 0

Views: 563

Answers (3)

NicC
NicC

Reputation: 293

Or you can use the RETURN keyword with a code:

RETURN 0

Upvotes: 0

Dave
Dave

Reputation: 5191

According to the documentation an return code of 255 indicates that the program was terminated. Use exit 0 if you want a zero returned.

Upvotes: 3

Greg
Greg

Reputation: 131

I assume you are running the REXX code from USS.

See here => https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxb600/bpx1rx32.htm

You can explicitly set return code 0 by using EXIT 0, for example:

/* rexx */

SAY 'Hello World'

EXIT 0

Upvotes: 6

Related Questions