Multiple choice technology mainframe

When a RETURN clause is used in a subroutine, a value can be passed back to the calling EXEC. Which statements are correct?

  1. This value must be numeric.

  2. This value can be alphanumeric.

  3. This value is stored in the system variable RC.

  4. This value is stored in the system variable RCODE.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

When a RETURN clause is used in a subroutine, the value passed back can be alphanumeric (text or numeric). This value is returned to the calling EXEC but is not stored in RC or RCODE system variables as those are used for return codes from programs, not subroutine return values. The RETURN clause supports flexible data types.

AI explanation

In REXX, all variables (including return values) are fundamentally character strings — there's no strict numeric typing — so a RETURN clause can pass back an alphanumeric (string) value, not just a number. This makes 'This value must be numeric' false. When a REXX exec is invoked as a subroutine via a function call, the returned value is captured directly by the caller (not necessarily forced into RC), and RC is typically used when the exec is invoked as a host command, not the general-purpose return value holder implied here — and 'RCODE' is not a REXX system variable at all.