Previous Topic: ADDRESS Environment for CA ViewNext Topic: Program Stacks


Extended Return Codes

Unlike standard REXX, IMOD extended functions return a numeric return code in the REXX RC special variable. When programming in REXX, check the RC special variable for proper completion. For example, the SAM(GET …) function can return the value ARG 1 MISSING OR INVALID. If the value of the RC special variable is 0, no error occurred (the result was read from a disk file and is a valid record).

Note: IMODs called as external subroutines can set the RC special variable by issuing the SETRC() function. You can trap errors from extended functions by using these instructions:

If the return code is

Then the function or subroutine has

0

Completed successfully

Greater than 0

Not completed successfully (SIGNAL ON ERROR)

Less than 0

Not completed successfully because of a serious failure (SIGNAL ON FAILURE)

Error return codes in the range ‑100 through 120 are explained in the following table. All other error return codes are function‑dependent.

A return code of

Indicates

‑100

An unexpected abend (for example, 0C4 from the WTO() function).

‑99 through 99

Systems applications architecture (SAA) REXX return codes. Text for these error codes can be obtained from the ERRORTEXT() REXX built‑in function.

Note: For a list of the SAA error codes and their descriptions, see IBM's REXX documentation.

100

An expected abend (for example, 0C4 from the MEMORY() function).

101 through 120

A missing or invalid argument specification corresponding to arguments 1 through 20 respectively.