ANSI Rexx Vs Mainframe Rexx

by H. Fosdick   © 2024 RexxInfo.org


These charts enumerate the exact differences between ANSI-standard Rexx and mainframe Rexx. They may be helpful in language conversions, or if you know one of these two language variants and want to learn the other. Click here for a PDF version.


Profiles


 ANSI RexxMainframe Rexx
   
Usage * A superset of the original TRL-2 language definition defined in 1996
* Runs on all platforms from cell phones to supercomputers
* Several open source interpreters available
* Default scripting language for all IBM mainframe operating systems
* The only high-level language that interfaces to all mainframe environments and address spaces
Compiler AvailableNoYes
Open SourceYesNo
Programming ParadigmsScripting, Procedural, Functional
(not object-oriented)
Scripting, Procedural, Functional
(not object-oriented)
User GroupRexx Language Association Rexx Language Association
Quick Online LookupQuick Lookup Quick Lookup
Reference Card
(printable PDF)
ANSI Rexx Mainframe Rexx
ForumRexxLA forum RexxLA forum,
Mainframe Experts Forum (Rexx Thread)
Further informationRexxInfo.org RexxInfo.org


Language Comparison


 ANSI RexxMainframe Rexx
   
Requires "Rexx" in 1st line commentNoUsually
ANSI Symbols (aka character set)YesYes, a superset
ANSI standards for case-insensitivity, free formatting, etcYesYes
ANSI String Notations (character, hexadecimal, and binary)YesYes
ANSI Notations for statement separator, line continuation, comments, assignment, etcYesYes
ANSI Notation for Parentheses (following functions and for expression evaluation)YesYes
ANSI Notation for Operators (Arithmetic, Comparison, Logical/Boolean, and Concatenation)YesYes
ANSI Notation for Compound VariablesYesYes
Instructions Conform to ANSI-1996YesLargely, but there are many small differences from ANSI, listed below
Functions Conform to ANSI-1996YesLargely, but there are many small differences from ANSI, listed below
Includes Instructions beyond ANSINoUPPER
Includes Functions beyond ANSINoEXTERNALS, FIND, INDEX, JUSTIFY, LINESIZE, USERID
Stream I/OYes z/OS: yes, if Stream I/O Package is installed
z/VM: yes
EXECIONoYes
Array Read & WriteNoYes with EXECIO
DBCS SupportNoYes via 13 functions
TSO/E External FunctionsNoz/OS: yes, 19 External Functions
z/VM: covers many of these through similar VM commands
TSO/E Rexx CommandsNoz/OS: yes, 10 Rexx Commands
z/VM: covers many of these through similar VM commands
Explicit Terminal Buffer/Stack Manipulation CommandsNoYes
Run an Operating System CommandJust issue the command stringJust issue the command string


Mainframe Instructions that Differ from ANSI-1996


InstructionMainframe Rexx
  
ADDRESSz/OS and z/VM do not support two formats introduced by ANSI-1996:
ADDRESS [ environment ] [ command ] [ redirection ]
ADDRESS [ [ VALUE ] expression [ redirection ] ]
CALLz/OS does not support NOTREADY
PARSEz/OS and z/VM add two more template options: EXTERNAL and NUMERIC. z/OS only supports the LINEIN option if the Stream I/O package is installed, while VM supports this natively.
SIGNALz/OS supports the conditions ERROR, FAILURE, HALT, NOVALUE, and SYNTAX. z/VM supports ERROR, FAILURE, HALT, NOTREADY, NOVALUE, and SYNTAX. Neither support LOSTDIGITS.
TRACEz/OS and z/VM support the additional flags: ! and S. They also support this alternative format for the trace instruction:   TRACE [string]   |   [symbol]   |   [ [value] expression]
UPPERA mainframe-only instruction (not in ANSI)


Mainframe Functions that Differ from ANSI-1996


FunctionMainframe Rexx
  
ADDRESSz/OS and z/VM do not support this format: ADDRESS([option])
CHANGESTRUnsupported by z/OS and z/VM
CHARINSupported by z/OS if the Stream I/O Package is installed, while VM supports this natively.
CHAROUTSupported by z/OS if the Stream I/O Package is installed, while VM supports this natively.
CHARSSupported by z/OS if the Stream I/O Package is installed, while VM supports this natively. z/OS and z/VM only support the format of the CHARS function without the C or N option. Returns 1 if there is at least one character available in the stream and 0 otherwise.
COUNTSTRUnsupported by z/OS and z/VM
DATATYPEz/OS and z/VM add two more TYPES to the list:
C -- returns 1 if string is a mixed SBCS/DBCS string
D (Dbcs) -- returns 1 if string is a DBCS-only string enclosed by SO and SI bytes
DATEz/OS and z/VM add two more OPTION_OUT parameters:
C (Century) -- the number of days, including the current day, since and including January 1 of the last year that is a multiple of 100 in the form: ddddd (no leading zeros)
J (Julian) -- date in the format: yyddd
EXTERNALSA mainframe-only function (not in ANSI)
z/VM: returns the number of elements in the terminal input buffer (system external event queue)
z/OS: there is no equivalent buffer. Therefore, in the TSO/E implementation of REXX, the externals function always returns a 0
FINDA mainframe-only function (not in ANSI)
INDEXA mainframe-only function (not in ANSI)
JUSTIFYA mainframe-only function (not in ANSI)
LINEINSupported by z/OS if the Stream I/O Package is installed, while VM supports this natively.
LINEOUTSupported by z/OS if the Stream I/O Package is installed, while VM supports this natively.
LINESSupported by z/OS if the Stream I/O Package is installed, while VM supports this natively.
z/OS and z/VM only support this format: LINES([name])
z/VM: the function returns the number of completed lines remaining in the character input stream.
LINESIZEA mainframe-only function (not in ANSI).
z/VM: returns the current terminal line width. Returns 0 in any of these cases:
* Terminal line size cannot be determined.
* Virtual machine is disconnected.
* The command CP TERMINAL LINESIZE OFF is in effect.
z/OS: if the script runs in foreground, returns the current terminal line width minus 1 (the point at which the language processor breaks lines displayed by the say instruction). If the script runs in background, this function always returns 131. In non-TSO/E address spaces, this function returns the logical record length of the OUTDD file (default is SYSTSPRT).
QUALIFYUnsupported by z/OS and z/VM
STREAMSupported by z/OS if the Stream I/O Package is installed, while VM supports this natively. Options are implementation and platform dependent, refer to the manual for your interpreter.
TIMEz/OS and z/VM support solely this format: TIME(option_out)
TRACEz/OS and z/VM support two additional settings: ! and S
USERIDA mainframe-only function (not in ANSI)

Based on RexxInfo.org charts, TSO/E REXX Reference, and REXX VM Reference.


Back to RexxInfo.org    .     .