Table of Contents (exploded view)
Abstract for TSO/E REXX User's Guide
z/OS Version 2 Release 1 summary of changes
Learning the REXX Language
Introduction
What is REXX?
Features of REXX
Ease of use
Free format
Convenient built-in functions
Debugging capabilities
Interpreted language
Extensive parsing capabilities
Components of REXX
The SAA Solution
Benefits of Using a Compiler
Improved Performance
Reduced System Load
Protection for Source Code and Programs
Improved Productivity and Quality
Portability of Compiled Programs
SAA Compliance Checking
Writing and Running a REXX Exec
Before You Begin
What is a REXX Exec?
Syntax of REXX Instructions
The Character Type of REXX Instructions
Using Quotation Marks in an Instruction
The Format of REXX Instructions
Beginning an instruction
Continuing an instruction
Continuing a literal string without adding a space
Ending an instruction
Types of REXX Instructions
Keyword
Assignment
Label
Null
Command
Execs Using Double-Byte Character Set Names
Running an Exec
Running an Exec Explicitly
Running an Exec Implicitly
Allocating a PDS to a System File
Exercises - Running the Example Execs
Interpreting Error Messages
Preventing Translation to Uppercase
From Within an Exec
As Input to an Exec
Exercises - Running and Modifying the Example Execs
Passing Information to an Exec
Using Terminal Interaction
Specifying Values when Invoking an Exec
Specifying Too Few Values
Specifying Too Many Values
Preventing Translation of Input to Uppercase
Exercises - Using the ARG Instruction
Passing Arguments
Passing Arguments Using the CALL Instruction or REXX Function Call
Passing Arguments Using the EXEC Command
Using Variables and Expressions
Using Variables
Variable Names
Variable Values
Exercises - Identifying Valid Variable Names
Using Expressions
Arithmetic Operators
Division
Order of Evaluation
Using Arithmetic Expressions
Exercises - Calculating Arithmetic Expressions
Comparison Operators
The Strictly Equal and Equal Operators
Using Comparison Expressions
Exercises - Using Comparison Expressions
Logical (Boolean) Operators
Using Logical Expressions
Exercises - Using Logical Expressions
Concatenation Operators
Using Concatenation Operators
Priority of Operators
Exercises - Priority of Operators
Tracing Expressions with the TRACE Instruction
Tracing Operations
Tracing Results
Exercises - Using the TRACE Instruction
Controlling the Flow Within an Exec
Using Conditional Instructions
IF/THEN/ELSE Instructions
Nested IF/THEN/ELSE Instructions
Exercise - Using the IF/THEN/ELSE Instruction
SELECT/WHEN/OTHERWISE/END Instruction
Exercises - Using the SELECT/WHEN/OTHERWISE/END Instruction
Using Looping Instructions
Repetitive Loops
Infinite Loops
DO FOREVER Loops
LEAVE Instruction
ITERATE Instruction
Exercises - Using Loops
Conditional Loops
DO WHILE Loops
Exercise - Using a DO WHILE Loop
DO UNTIL Loops
Exercise - Using a DO UNTIL Loop
Combining Types of Loops
Nested DO Loops
Exercises - Combining Loops
Using Interrupt Instructions
EXIT Instruction
CALL/RETURN Instructions
SIGNAL Instruction
Using Functions
What is a Function?
Example of a Function
Built-In Functions
Arithmetic Functions
Comparison Functions
Conversion Functions
Formatting Functions
String Manipulating Functions
Miscellaneous Functions
Testing Input with Built-In Functions
Exercise - Writing an Exec with Built-In Functions
Writing Subroutines and Functions
What are Subroutines and Functions?
When to Write Subroutines vs Functions
Writing a Subroutine
Passing Information to a Subroutine
Passing Information by Using Variables
Protecting Variables with the PROCEDURE Instruction
Exposing Variables with PROCEDURE EXPOSE
Passing Information by Using Arguments
Using the ARG Instruction
Using the ARG Built-in Function
Receiving Information from a Subroutine
Example - Writing an Internal and an External Subroutine
Writing a Function
Passing Information to a Function
Passing Information by Using Variables
Protecting Variables with the PROCEDURE Instruction
Exposing Variables with PROCEDURE EXPOSE
Passing Information by Using Arguments
Using the ARG Instruction
Using the ARG Built-in Function
Receiving Information from a Function
Exercise - Writing a Function
Summary of Subroutines and Functions
Manipulating Data
Using Compound Variables and Stems
What is a Compound Variable?
Using Stems
Exercises - Using Compound Variables and Stems
Parsing Data
Instructions that Parse
PULL Instruction
ARG Instruction
PARSE VAR Instruction
PARSE VALUE … WITH Instruction
Ways of Parsing
Blank
String
Variable
Number
Parsing Multiple Strings as Arguments
Exercise - Practice with Parsing
Using REXX
Entering Commands from an Exec
Types of Commands
Issuing TSO/E Commands from an Exec
Using Quotations Marks in Commands
Passing Data Set Names as Arguments
Using Variables in Commands
Causing Interactive Commands to Prompt the User
Invoking Another Exec as a Command
Invoking Another Exec with the EXEC Command
Invoking Another Exec Implicitly
Issuing Other Types of Commands from an Exec
What is a Host Command Environment?
APPC/MVS Host Command Environments
Examples Using APPC/MVS Services
Changing the Host Command Environment
Determining the Active Host Command Environment
Checking if a Host Command Environment is Available
Examples Using the ADDRESS Instruction
Diagnosing Problems Within an Exec
Debugging Execs
Tracing Commands with the TRACE Instruction
TRACE C
TRACE E
Using REXX Special Variables RC and SIGL
RC
SIGL
Tracing with the Interactive Debug Facility
Starting Interactive Tracing
? Option of the TRACE Instruction
EXECUTIL TS Command
Options Within Interactive Trace
Continuing Interactive Tracing
Typing Additional Instructions to be Processed
Re-executing the Last Instruction Traced
Ending Interactive Trace
TRACE OFF
End the Exec
TRACE ?
EXECUTIL TE
Using TSO/E External Functions
TSO/E External Functions
Using the GETMSG Function
Using the LISTDSI Function
Using the MSG Function
Using the MVSVAR Function
Using the OUTTRAP Function
Using the PROMPT Function
Using the SETLANG Function
Using the STORAGE Function
Using the SYSCPUS Function
Using the SYSDSN Function
Using the SYSVAR Function
User Information
Terminal Information
Language Information
Exec Information
System Information
Console Session Information
Additional Examples
Function Packages
Search Order for Functions
Storing Information in the Data Stack
What is a Data Stack?
Manipulating the Data Stack
Adding Elements to the Data Stack
Removing Elements from the Stack
Determining the Number of Elements on the Stack
Exercise - Using the Data Stack
Processing of the Data Stack
Using the Data Stack
Passing Information Between a Routine and the Main Exec
Passing Information to Interactive Commands
Issuing Subcommands of TSO/E Commands
Creating a Buffer on the Data Stack
Creating a Buffer with the MAKEBUF Command
Removing Elements from a Stack with a Buffer
Dropping a Buffer with the DROPBUF Command
Finding the Number of Buffers with the QBUF Command
Finding the Number of Elements In a Buffer
Exercises - Creating a Buffer on the Data Stack
Protecting elements in the data stack
Creating a New Data Stack with the NEWSTACK Command
Deleting a Private Stack with the DELSTACK Command
Finding the Number of Stacks
Additional Examples
Processing Data and Input/Output Processing
Types of Processing
Dynamic Modification of a Single REXX Expression
Using the INTERPRET Instruction
Using EXECIO to Process Information to and from Data Sets
When to Use the EXECIO Command
Using the EXECIO Command
Reading Information from a Data Set
How to specify the number of lines to read
How to read the data set
How to access the data set
Option of specifying a starting line number
Options for DISKR and DISKRU
Writing Information to a Data Set
How to specify the number of lines to write
How to access the data set
Options for DISKW
Return Codes from EXECIO
When to Use the EXECIO Command
Copying Information From One Data Set to Another
Copying an entire data set
Copying a specified number of lines to a new data set
Adding 5 lines to the end of an existing sequential data set
Copying Information to and from a List of Compound Variables
Copying Information from a Data Set to a List of Compound Variables
Copying Information from Compound Variables to a Data Set
Updating Information in a Data Set
Updating a single line
Updating multiple lines
Additional Examples
Using REXX in TSO/E and Other MVS Address Spaces
Services Available to REXX Execs
Running Execs in a TSO/E Address Space
Running an Exec in the Foreground
Things to Consider When Allocating to a System File (SYSPROC or SYSEXEC)
Allocating to SYSEXEC
Allocating to SYSPROC
Running an Exec from a CLIST
Sending a Return Code Back to the Calling CLIST
Running an Exec in the Background
Running Execs in a Non-TSO/E Address Space
Using an Exec Processing Routine to Invoke an Exec from a Program
Using IRXJCL to Run an Exec in MVS Batch
Using the Data Stack in TSO/E Background and MVS Batch
Summary of TSO/E Background and MVS Batch
CAPABILITIES
REQUIREMENTS
Defining Language Processor Environments
What is a Language Processor Environment?
Customizing a language processor environment
Allocating Data Sets
What is Allocation?
Where to Begin
Preliminary Checklist
Checklist #1: Creating and Editing a Data Set Using ISPF/PDF
Checklist #2: Creating a Data Set with the ALLOCATE Command
Checklist #3: Writing an Exec that Sets up Allocation to SYSEXEC
Checklist #4: Writing an Exec that Sets up Allocation to SYSPROC
Specifying Alternate Libraries with the ALTLIB Command
Specifying Alternative Exec Libraries with the ALTLIB Command
Using the ALTLIB Command
Stacking ALTLIB Requests
Using ALTLIB with ISPF
Examples of the ALTLIB Command
Comparisons Between CLIST and REXX
Accessing System Information
Controlling Program Flow
Debugging
Execution
Interactive Communication
Passing Information
Performing File I/O
Syntax
Using Functions
Using Variables