0

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?

Hlib
  • 2,944
  • 6
  • 29
  • 33

3 Answers3

6

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

Greg
  • 76
  • 1
3

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

Dave
  • 5,108
  • 16
  • 30
  • 40
0

Or you can use the RETURN keyword with a code:

RETURN 0
NicC
  • 293
  • 1
  • 6