The command "command" returned number

Synopsis
The current environment (set with the ADDRESS instruction) is the operating system shell (ie, named "SYSTEM", "OS2ENVIRONMENT", or "ENVIRONMENT"), and command is the name of some non-REXX (ie, executable) program (and its args) to run. The program that the operating system ran triggered an ERROR or FAILURE condition after its completion. number is the error number returned by that program.

You can explicitly launch a program by sending the program's name, followed by any arguments passed to it, as a command to the "SYSTEM", "OS2ENVIRONMENT", or "ENVIRONMENT" environments. You do this with the ADDRESS instruction. But also anything that Reginald doesn't recognize as a REXX instruction, Reginald automatically sends to the current environment (set with the ADDRESS instruction) as command, and the current environment may be "SYSTEM", "OS2ENVIRONMENT", or "ENVIRONMENT" (in which case the operating system attempts to run that program).

Cause
You misspelled some REXX instruction or subroutine name, resulting in something that Reginald doesn't recognize as either an instruction or subroutine call. Anything that Reginald doesn't recognize as a REXX instruction or call, Reginald passes off to the current environment as the command to process.

Cure
Be sure that you use only legal REXX instructions, and reference only subroutines that exist in your program or as REXX scripts on disk somewhere.

Cause
You didn't want to do anything with the return value from a function, but you forget to use the CALL keyword. Therefore, Reginald piped the function's return data to the current environment as command.

Cure
If you wish to "throw away" the data return from a function, use the CALL keyword. Here, we throw away the return of my_func:

CALL my_func
Otherwise, Reginald would send whatever my_func() returned to the current environment as the command passed to it.

Alternately, you can use the instruction ADDRESS NULL (once, at the start of your script) to automatically toss away any returns that you don't use from functions, without needing to otherwise use CALL. Reginald's Administration Tool also allows setting this for all scripts you run. (But be sure that no scripts you run will assume their commands are automatically directed to the operating system shell, if you utilize the Administration Tool's setting).