[USflag] The American Programmer [USflag]


Home
Books on Mainframe Programming
Mainframe Manuals and Tutorials
System Abend codes, Sqlcodes, VSAM/QSAM codes
Everything about the IBM AS/400 Midrange Computer - iSeries
Everything about CICS
Everything about COBOL
Everything about DB2 and SQL
Everything about IMS
Everything about Java and JavaScript
Everything about JCL and JES
Everything about REXX
  Sorting in REXX: The Bubble Sort
  REXX Password Generator
  Using REXX to capture displayed output of TSO command
  Count records in REXX
  REXX program to calculate present value of money
  REXX function to format a number in currency format
  REXX function to produce a fixed-length number
  REXX program to produce lottery numbers
  REXX: what does your phone number spell?
  REXX Practice Problems.
  Just Enough REXX Tutorial
  Setting up to Execute REXX Programs on TSO/ISPF
  How to execute a REXX program
  REXX Boolean operators
  Comparison of CLIST language and REXX
  REXX Comparison operators
  REXX Debugging: the TRACE verb
  Using REXX OUTTRAP
  Reserved REXX Variables
  Executing REXX through JCL.
  Writing ISPF Edit Macros in REXX
  REXX program to unload a PDS
  REXX book: The REXX Language on TSO
  REXX Functions Book
  QMF Procedures Written in REXX
  Using REXX Subroutines with the QMF Calc panel
  REXX error codes (RC)
  REXX programming language manuals
  Books on REXX programming
  The REXX Files
Everything about zOS, VSAM, Tivoli, Assembler
Everything about TSO, ISPF, Spufi
Site Map and Site Search

           Home   > REXX   > Reserved REXX Variables

Reserved REXX Variables

What REXX variables are already defined? Which variables should you not use for any other purpose?
 Reserved REXX Variables

REXX has three variables with a predefined meaning. 
Using these for anything but their original purpose will cause 10% of your brain cells to deteriorate...
RC
 is the numeric return code of any operating system or environment command.
	"LISTCAT"
	SAY RC
A zero means that there were no problems. A positive number indicates some problem. 
A negative number tells of a serious problem. 
REXX does not understand these codes. 
The operating system command manual will explain them.

SIGL is the line number of the source program that sent control 
to a subroutine, internal function, or condition trap.
	ERROR:
	Say "Line #" SIGL "sent control to this subroutine"

RESULT is the character string or number returned by a function (built-in or user-written) 
when it is invoked with a CALL.
User-written functions must set this by placing a character string or number on their RETURN statement. 
Built-in functions do it automatically. 
	/* in the main part of your program*/
	CALL Length "ABCDEF"

	Say RESULT


	/* or*/
	CALL My_function
		/*reminder - RESULT is set only after a CALL*/
	Say RESULT

	EXIT

	My_function:
	/* does some processing */
	RETURN /*character string or number goes here*/


REXX Programming Book for TSO (published 2012)

[Books Computer]

Home Books for Computer Professionals Privacy Terms |
Site Map and Site Search Programming Manuals and Tutorials The REXX Files Top of Page |