I am no doubt joining in on the conversation regarding using the
Condition Code as a return value from a called function/sub-routine,
as well as the conversation regarding the LEAVE construct in Rexx.

I am certainly not a fan of using the Condition Code as a return
value from a called function.  It is rather limited (only a two bit
integer) and does not work for functions invoked by other
programming languages (for example, "C").

The SPM (Set Program Mask) instruction has been around since the
introduction of the S/360 (announced in 1964, 56 years ago).  The
S/370 was announced in 1970 (50 years ago).  MVS/XA was announced
in 1983 (37 years ago) and that's when the IPM (Insert Program Mask)
instruction appeared.

Unfortunately, IBM Rexx for z/OS is way behind the times. ooRexx has
supported the "Label" keyword on the "Do" instruction (and several
other instructions, for example, "Select") for quite some time (the
support was present in Version 4.0 in August 2009).

The syntax is roughly this, where optional components are shown
within braces:

DO {LABEL name} {repetitor} {conditional} ...

Here is an excerpt from the documentation of the "Do" instruction
regarding the "LABEL" component/phrase:

"The LABEL phrase, if used, must precede any repetitor or
conditional."

Here is an excerpt from the documentation of the "Leave" instruction
which describes how the "Label" on a "Do" is used:

"The name is a symbol, taken as a constant.  If name is not
specified, LEAVE ends the innermost active repetitive loop.  If name
is specified, it must be the name of the control variable or LABEL
name of a currently active LOOP, DO, or SELECT, which can be the
innermost, and that block, and any active block inside it, are then
ended.  Control then passes to the clause following the END that
matches the instruction of the selected block."

The ANSI Standard for Rexx (X3J18) has not been updated since
1998 and consequently does not reflect the notion of the "Label"
keyword on "Do", etc.

Bob Raicer

Reply via email to