Contents

Preface
What this book is about
Who this book is for
What you need to know to understand this book
Prerequisites
User's Guide
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
Writing and Running a REXX Program
What you need to run a REXX Program?
What is a REXX Program?
Syntax of REXX Instructions
The Format of REXX Instructions
The Letter Case of REXX Instructions
Types of REXX Clauses
Programs Using Double-Byte Character Set Names
Typing in a Program
Running a Program
Interpreting Error Messages
How to Prevent Translation to Uppercase
Characters within a program
Characters Input to a program
Exercises - Running and Modifying the Example Programs
Passing Information to a program
Getting Information from the Program Stack or Terminal Input Device
Specifying Values When Calling a program
Preventing Translation of Input to Uppercase
Passing Arguments
Using Variables and Expressions
Program Variables
Using Variables
Variable Names
Variable Values
Using Expressions
Arithmetic Operators
Comparison Operators
Logical (Boolean) Operators
Concatenation Operators
Priority of Operators
Tracing Expressions with the TRACE Instruction
Tracing Operations
Tracing Results
Exercises - Using the TRACE Instruction
Controlling the Flow within a program
Conditional, Looping, and Interrupt Instructions
Using Conditional Instructions
IF...THEN...ELSE Instructions
Nested IF...THEN...ELSE Instructions
SELECT WHEN...OTHERWISE...END Instruction
Using Looping Instructions
Repetitive Loops
Conditional Loops
Combining Types of Loops
Nested DO Loops
Using Interrupt Instructions
EXIT Instruction
CALL and 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
Writing Subroutines and Functions
What are Subroutines and Functions?
When to Write Subroutines Rather Than Functions
Writing Subroutines and Functions
When to Use Internal Versus External Subroutines or Functions
Passing Information
Receiving Information from a Subroutine or Function
Subroutines and Functions--Similarities and Differences
Manipulating Data
Using Compound Variables and Stems
What Is a Compound Variable?
Using Stems
Parsing Data
Parsing Instructions
More about Parsing into Words
Parsing with Patterns
Parsing Multiple Strings as Arguments
Using Commands from a program
Types of Commands
Using Quotations Marks in Commands
Using Variables in Commands
Calling Another REXX Program as a Command
Issuing Commands from a program
What is a Host Command Environment?
How Is a Command Passed to the Host Environment?
Changing the Host Command Environment
Diagnosing Problems within a program
Debugging Programs
Tracing Commands with the TRACE Instruction
Using REXX Special Variables RC and SIGL
Tracing with the Interactive Debug Facility
Saving Interactive TRACE Output
Programming Style and Techniques
Consider the Data
Test Yourself...
Happy Hour
Designing a Program
Methods for Designing Loops
The Conclusion
What Do We Have So Far?
Stepwise Refinement: An Example
Reconsider the Data
Correcting Your Program
Modifying Your Program
Tracing Your Program
Coding Style
Reference
Introduction
Who Should Read This Reference
How to Use This Reference
Overview of Product Features
SAA Level 2 REXX Language Support Under REXX/CICS
Support for the Interpretive Execution of REXX Execs
CICS-Based Text Editor for REXX Execs and Data
VSAM-Based File System for REXX Execs and Data
VSE Librarian Sublibraries
Dynamic Support for EXEC CICS Commands
REXX Interface to CEDA and CEMT Transaction Programs
High-level Client/Server Support
Support for Commands Written in REXX
Command Definition of REXX Commands
Support for System and User Profile Execs
Shared Execs in Virtual Storage
SQL Interface
How to Read the Syntax Diagrams
REXX General Concepts
Structure and General Syntax
Characters
Comments
Tokens
Implied Semicolons
Continuations
Expressions and Operators
Expressions
Operators
Parentheses and Operator Precedence
Clauses and Instructions
Null Clauses
Labels
Instructions
Assignments
Keyword Instructions
Commands
Assignments and Symbols
Constant Symbols
Simple Symbols
Compound Symbols
Stems
Commands to External Environments
Environment
Commands
Basic Structure of REXX Running Under CICS
REXX Exec Invocation
Where Execs Execute
Locating and Loading Execs
Editing Execs
REXX File System
Control of Exec Execution Search Order
Adding User Written Commands
Support of Standard REXX Features
SAY and TRACE Statements
PULL and PARSE EXTERNAL Statements
REXX Stack Support
REXX Function Support
REXX Command Environment Support
Adding REXX Host Command Environments
Support of Standard CICS Features/Facilities
CICS Mapped I/O Support
Dataset I/O Services
Interfaces to CICS Facilities and Services
Issuing User Applications From Execs
REXX Interfaces to CICS Storage Queues
Pseudo-conversational Transaction Support
Interfaces to Other Programming Languages
DBCS Support
Miscellaneous Features
Keyword Instructions
ADDRESS
ARG
CALL
DO
Simple DO Group
Repetitive DO Loops
Conditional Phrases (WHILE and UNTIL)
DROP
EXIT
IF
INTERPRET
ITERATE
LEAVE
NOP
NUMERIC
OPTIONS
PARSE
PROCEDURE
PULL
PUSH
QUEUE
RETURN
SAY
SELECT
SIGNAL
TRACE
Alphabetic Character (Word) Options
Prefix Options
Numeric Options
A Typical Example
Format of TRACE Output
UPPER
Functions
Syntax
Functions and Subroutines
Search Order
Errors During Execution
Built-in Functions
ABBREV (Abbreviation)
ABS (Absolute Value)
ADDRESS
ARG (Argument)
BITAND (Bit by Bit AND)
BITOR (Bit by Bit OR)
BITXOR (Bit by Bit Exclusive OR)
B2X (Binary to Hexadecimal)
CENTER/CENTRE
COMPARE
CONDITION
COPIES
C2D (Character to Decimal)
C2X (Character to Hexadecimal)
DATATYPE
DATE
DBCS (Double-Byte Character Set Functions)
DELSTR (Delete String)
DELWORD (Delete Word)
DIGITS
D2C (Decimal to Character)
D2X (Decimal to Hexadecimal)
ERRORTEXT
EXTERNALS
FIND
FORM
FORMAT
FUZZ
INDEX
INSERT
JUSTIFY
LASTPOS (Last Position)
LEFT
LENGTH
LINESIZE
MAX (Maximum)
MIN (Minimum)
OVERLAY
POS (Position)
QUEUED
RANDOM
REVERSE
RIGHT
SIGN
SOURCELINE
SPACE
STORAGE
STRIP
SUBSTR (Substring)
SUBWORD
SYMBOL
TIME
TRACE
TRANSLATE
TRUNC (Truncate)
USERID
VALUE
VERIFY
WORD
WORDINDEX
WORDLENGTH
WORDPOS (Word Position)
WORDS
XRANGE (Hexadecimal Range)
X2B (Hexadecimal to Binary)
X2C (Hexadecimal to Character)
X2D (Hexadecimal to Decimal)
External Functions Provided in REXX/CICS
STORAGE
SYSSBA
Parsing
General Description
Simple Templates for Parsing into Words
Templates Containing String Patterns
Templates Containing Positional (Numeric) Patterns
Parsing with Variable Patterns
Using UPPER
Parsing Instructions Summary
Parsing Instructions Examples
Advanced Topics in Parsing
Parsing Multiple Strings
Combining String and Positional Patterns: A Special Case
Parsing with DBCS Characters
Details of Steps in Parsing
Numbers and Arithmetic
Introduction
Definition
Numbers
Precision
Arithmetic Operators
Arithmetic Operation Rules--Basic Operators
Arithmetic Operation Rules--Additional Operators
Numeric Comparisons
Exponential Notation
Numeric Information
Whole Numbers
Numbers Used Directly by REXX
Errors
Conditions and Condition Traps
Action Taken When a Condition Is Not Trapped
Action Taken When a Condition Is Trapped
Condition Information
Descriptive Strings
Special Variables
The Special Variable RC
The Special Variable SIGL
REXX/CICS Text Editor
Invocation
Screen Format
Prefix Commands
Individual Line Commands
Consecutive Block Commands
Destination Commands
Macros Under the REXX/CICS Editor
Command Line Commands
ARBCHAR
ARGS
BACKWARD
BOTTOM
CANCEL
CASE
CHANGE
CMDLINE
CTLCHAR
CURLINE
DISPLAY
DOWN
EDIT
EXEC
FILE
FIND
FORWARD
GET
GETLIB
INPUT
JOIN
LEFT
LINEADD
LPREFIX
MACRO
MSGLINE
NULLS
NUMBERS
PFKEY
PFKLINE
QQUIT
QUERY
QUIT
RESERVED
RESET
RIGHT
SAVE
SORT
SPLIT
STRIP
SYNONYM
TOP
TRUNC
UP
REXX/CICS File System
File Pools, Directories, and Files
Current Directory and Path
Security
RFS commands
AUTH
CKDIR
CKFILE
COPY
DELETE
DISKR
DISKW
GETDIR
MKDIR
RDIR
RENAME
File List Utility
Invocation
Macros under the REXX/CICS File List Utility
FLST Commands
CANCEL
CD
COPY
DELETE
DOWN
END
EXEC
FLST
MACRO
PFKEY
REFRESH
RENAME
SORT
SYNONYM
UP
FLST Return Codes
Running Execs and Transactions from FLST
REXX/CICS List System
Directories and Lists
Current Directory and Path
Security
RLS commands
CKDIR
DELETE
LPULL
LPUSH
LQUEUE
MKDIR
READ
VARDROP
VARGET
VARPUT
WRITE
REXX/CICS Command Definition
Background
Highlights
Accomplishing Command Definition
Command Arguments Passed to REXX Programs
Command Arguments Passed to Assembler Programs
CICPARMS Control Block
Non-REXX Language Interfaces
CICGETV - Call to Get, Set, or Drop a REXX Variable
Operands
Notes
REXX/CICS DB2 Interface
Programming Considerations
Embedding SQL Statements
Receiving the Results
Using the SQL Communications Area
Example Using SQL Statements
REXX/CICS High-level Client/Server Support
Overview
High-level, Natural, Transparent REXX Client Interface
Support for REXX-based Application Clients and Servers
Value of REXX in Client/Server Computing
REXX/CICS Client Exec Example
REXX/CICS Server Exec Example
REXX/CICS Panel Facility
Facility
Example of Panel Definition
Defining Panels
Defining the Field Control Characters with the '.DEFINE' Verb
.DEFINE
Default field control characters
Operands
Options
Defining the Actual PANEL Layout with the '.PANEL' Verb
.PANEL
Operands
Panel Generation and Panel Input/Output
PANEL RUNTIME
Operands
Options
PANEL Variables
Panel Facility Return Code Information
Return Codes
System Error Reason Codes
Programmer Introduced Warning/Error Reason Codes
State Codes and Input Codes
Location Codes
Examples of Sample Panels
Example 1
Example 2
Example 3
Example 4
Example 5
Example of a REXX Panel Program
REXX/CICS Commands
AUTHUSER
Operands
Return Codes
Example
Notes
CD
Operands
Return Codes
Examples
Note
CEDA
Operands
Return Codes
Example
CEMT
Operands
Return Codes
Example
CLD
Operands
Return Codes
Examples
Notes
CONVTMAP
Operands
Return Codes
Example
COPYR2S
Operands
Return Codes
Examples
COPYS2R
Operands
Return Codes
Example
Notes
C2S
Operands
Return Codes
Example
Notes
DEFCMD
Operands
Return Codes
Example
Notes
DEFSCMD
Operands
Return Codes
Example
Notes
DEFTRNID
Operands
Return Codes
Example
Notes
DIR
Operands
Return Codes
Examples
Note
EDIT
Operands
Return Codes
Example
Note
EXEC
Operands
Return Codes
Example
EXECDROP
Operands
Return Codes
Example
Note
EXECIO
Operands
Return Codes
Examples
Notes
EXECLOAD
Operands
Return Codes
Example
Notes
EXECMAP
Return Codes
Example
EXPORT
Operands
Return Codes
Example
Notes
FILEPOOL
Operands
Return Codes
Example
Note
FLST
Operands
Return Codes
Example
Notes
GETVERS
Return Codes
Example
HELP
Operands
Return Codes
IMPORT
Operands
Return Codes
Example
LISTCMD
Operands
Return Codes
Example
LISTCLIB
Operands
Return Codes
Example
LISTELIB
Operands
Return Codes
Example
LISTPOOL
Operands
Return Codes
Example
Note
LISTTRNID
Return Codes
Example
PATH
Operands
Return Codes
Examples
Notes
PSEUDO
Operands
Return Codes
Example
Note
RFS
Operands
Return Codes
Note
RLS
Operands
Return Codes
SCRNINFO
Return Codes
Example
Notes
SET
Operands
Return Codes
Example
Notes
SETSYS
Operands
Return Codes
Example
S2C
Operands
Return Codes
Example
Notes
TERMID
Return Codes
Example
WAITREAD
Return Codes
Example
Note
WAITREQ
Return Codes
Example
Appendixes
Appendix A. Error Numbers and Messages
Appendix B. Return Codes
Panel Facility
SQL
RFS and FLST
EDITOR and EDIT
DIR
SET
CD
PATH
RLS
LISTCMD
CLD
DEFCMD
DEFSCMD
DEFTRNID
EXECDROP
EXECLOAD
EXECMAP
EXPORT and IMPORT
FILEPOOL
LISTCLIB and LISTELIB
GETVERS
COPYR2S
COPYS2R
LISTPOOL
LISTTRNID
C2S
PSEUDO
AUTHUSER
SETSYS
S2C
TERMID
WAITREAD
WAITREQ
EXEC
CEDA and CEMT
EXECIO
CONVTMAP
SCRNINFO
CICS
Appendix C. Double-Byte Character Set (DBCS) Support
General Description
Enabling DBCS Data Operations and Symbol Use
Symbols and Strings
Validation
Instruction Examples
DBCS Function Handling
Built-in Function Examples
DBCS Processing Functions
Counting Option
Function Descriptions
DBADJUST
DBBRACKET
DBCENTER
DBCJUSTIFY
DBLEFT
DBRIGHT
DBRLEFT
DBRRIGHT
DBTODBCS
DBTOSBCS
DBUNBRACKET
DBVALIDATE
DBWIDTH
Appendix D. Reserved Keywords and Special Variables
Reserved Keywords
Special Variables
Appendix E. Debug Aids
Interactive Debugging of Programs
Interrupting Execution and Controlling Tracing
Appendix F. REXX/CICS Business Value Discussion
Business Solutions
Product Positioning
Appendix G. System Definition/Customization/Administration
Authorized REXX/CICS Commands/Authorized Command Options
System Profile Exec
Authorized REXX/CICS VSE Librarian sublibraries
Defining Authorized Users
Setting System Options
Defining and Initializing a REXX File System (RFS) File Pool
Adding Files to a REXX File System (RFS) File Pool
RFS File Sharing Authorization
Creating a PLT Entry for CICSTART
Security exits
CICSEXC1
CICSECX2
Appendix H. Security
REXX/CICS Supports Multiple Transaction Identifiers
REXX/CICS File Security
ESA/VSE Command Level Security
REXX/CICS Authorized Command Support
Security Definitions
REXX/CICS General Users
REXX/CICS Authorized Users
REXX/CICS Authorized Commands
REXX/CICS Authorized Execs
REXX/CICS System Sublibraries
Appendix I. Performance Considerations
Appendix J. Basic Mapping Support Example
Appendix K. Post-Installation Configuration
Create the RFS Filepools
Install Resource Definitions
Update LSRPOOL Definitions
Rename supplied Procedures
Update CICSTART.PROC
Update CICS Initialization JCL
Format the RFS Filepools
Create the Help Files
Verify the Installation
Configure the REXX DB2 Interface
Bibliography
CICS Transaction Server for VSE/ESA Release 1 library
Where to Find More Information
Books from VSE/ESA 2.5 base program libraries
VSE/ESA Version 2 Release 5
High-Level Assembler Language (HLASM)
Language Environment for VSE/ESA (LE/VSE)
VSE/ICCF
VSE/POWER
VSE/VSAM
VTAM for VSE/ESA
Books from VSE/ESA 2.5 optional program libraries
C for VSE/ESA (C/VSE)
COBOL for VSE/ESA (COBOL/VSE)
DB2 Server for VSE
DL/I VSE
PL/I for VSE/ESA (PL/I VSE)
Screen Definition Facility II (SDF II)
Notices
Trademarks
Index