Mainframe Path Start learning free
BeginnerError and abend codesIRX0016I / IRX0040I / IRX0043I

REXX errors 16, 40 and 43 — label not found, incorrect call, routine not found

TSO/E REXX reports run-time errors as IRX00nnI, where nn is the REXX error number. The message names the exec and line; the traceback shows the failing clause.

What happened

A REXX exec stopped part way through. TSO/E printed a message starting IRX00nnI Error running followed by the exec name, the line number and a short text. With tracing on, a line marked +++ shows the clause that failed.

Terminal output from three failing execs (illustrative)Illustrative example
     52 +++ signal check_totls
IRX0016I Error running MPRPT01, line 52: Label not found
     61 +++ part = substr(line, 1, pos('=', line) - 1)
IRX0040I Error running MPPARSE, line 61: Incorrect call to routine
     18 +++ call mpfmtdt today
IRX0043I Error running MPDAILY, line 18: Routine not found

What it means

TSO/E REXX error numbers run from 1 to 99 and map directly to message numbers: error 16 is IRX0016I, error 40 is IRX0040I, and so on. The message is in the TSO/E Messages manual under that ID.

For a call, TSO/E REXX searches internal labels first, then built-in functions, then external routines: function packages, then load libraries and execs. Execs are searched in the library the caller came from, then any ALTLIB libraries, then SYSEXEC and SYSPROC (by default). A quoted name skips the internal labels.

Typical causes

Symptoms

Where to look

How to diagnose

  1. Go to the line number in the source and read the clause.
  2. For 16, search the exec for the label name exactly as written, followed by a colon.
  3. For 40, add trace i (or trace r) before the failing line to see the intermediate values passed to the function.
  4. For 43, check spelling, then check that the library holding the routine is in the search order for this environment.

How to fix

Correct the label or routine name, add the missing label, or guard the function call so bad input is caught first (for example, test that POS found the character before using its result). For 43, allocate the right library to SYSEXEC or SYSPROC, or use ALTLIB, in every environment where the exec runs — including batch.

How to prevent

Production considerations

Interview question

How would you make a REXX exec report syntax errors in a useful way?

Stuck on something else?
Ask the community or search the full course.

Ask a question