|
The American Programmer | |
| Home | Programming | Books for Computer Professionals | Privacy | Terms |
| Home > Programming > REXX Language on TSO |
| Home > Programming > REXX Files > REXX Language on TSO |
|
Revised |
The REXX Language on TSO By Gabriel F. Gargiulo
Learn how to write programs in the REXX language for TSO, MVS, OS/390, Z/os.
My first book on the REXX programming language, is out of print. This is my second book on REXX for TSO.
It improves on REXX in the TSO Environment in every way: it clarifies important points, it is better organized, and gives better examples.
There are very few other books in print about REXX in the TSO Environment.
This book quickly gets you started writing programs in REXX for MVS, OS/390, Z/OS. It covers all REXX language elements, all TSO built-in functions, and the more important built-in functions.172 pages, 8.5 x 11 inches. Revised. Mailed USPS priority next business day.
No longer available
Pay for books by check instead
You can check our selling reputation at Amazon.com and Ebay. We are Webmaster1652.
Gabe Gargiulo is the author of several mainframe books:
REXX Quick Reference
REXX in the TSO Environment (Available new and used)
The REXX Language on TSO MVS JCL (Out of Print)
Mastering OS2/REXX (Available new and used)
ISPF Services: Using the Dialogue Manager, with REXX
MVS/TSO (Available new and used)![]()
Top of Page
Table of Contents REXX for TSO Book
Introduction
Chapter 1: Overview of REXX
REXX features
Example of a REXX Program, with explanations
2: Setting Up to Execute REXX in TSO/ISPF.
1. Create a library
2. Specify details for allocating library
3. Create a member
4. Create the SETUP member in edit
5. Execute the Setup Program
6. Try it
3: The Basic Features
The initial REXX comment
SAY - display on the terminal
Variables
The Literal
The Label
PULL - accept input from the terminal
DO for looping
Concatenating Data Strings
EXIT to end your program
Passing commands to TSO
Short Description of all of REXX's Verbs or Keywords
4: IF
The simplest form of the IF:
A few things to think about:
Comparison operators
The DO END sequence
Boolean operators
5: Looping
The simplest form
The simple DO...END sequence.
The DO number ... END sequence
The DO variable ... END sequence
The DO that increments a variable
The DO WHILE
The DO UNTIL
The DO FOREVER
LEAVE
ITERATE: Skipping back to the top of the loop
6: SELECT: REXX's CASE Structure
Example
Points of syntax
Several instructions: example
7: PARSE
The basic form of PARSE
Origins
The Action of PARSE
Short forms of PARSE
Uses of PARSE: ARG
The ARG in a main program.
The ARG in a user-written function or subroutine.
Uses of PARSE: PULL
Uses of PARSE: EXTERNAL
Uses of PARSE: VAR
Uses of PARSE: VALUE
Uses of PARSE: SOURCE
8: Debugging
Interactive Debug
What you can do during interactive debug
Turning on Interactive Debug
Codes displayed during interactive debug
Tracing: the Smaller Guns
Combinations of the TRACE verb
9: Trapping Unexpected Conditions
Situations you might want to trap
Trapping Unexpected Conditions: General
The trap that terminates
The trap that continues
Changing the name of the trap
Trapping Unexpected Conditions: Syntax
Trapping Unexpected Conditions: Error
Trapping Unexpected Conditions: Failure
Trapping Unexpected Conditions: Novalue
Trapping Unexpected Conditions: Halt
Trapping Unexpected Conditions: Contents of the Trap
10: SIGNAL: the Extinct "GO TO"
Signal: go there (but don't come back)
11: Math
When does REXX do math?
Math: Arithmetic Operators
Math: Precision
12: Passing Commands to Command Processors
Passing commands to the environment
How Do You Get REXX to Pass a Command to a Command
Processor?
What Do the Return Codes (RC) mean?
What Command Processors Are Out There?
How do You Send Commands to a Command Processor?
Sending commands to TSO
Sending commands to ISPF
Sending commands to the ISPF Editor
How Does Your Program Know if the Command Processor is There?
13: Built-in Functions
Some examples
Basics of functions
CALLing a function
Some of the more important functions. [the more important REXX functions are covered]
Built-in Functions: TSO Functions
14: Writing Your Own Functions
Example of Internal Function
Internal, user-written functions
What makes a function a function?
Protecting Variables
Example of External Function
External, user-written functions
Search Order for Functions and Subroutines
15: Writing Your Own Subroutines
Example
Writing internal subroutines
16: The Internal Data Queue, or Stack
What is it?
How do you put things into the data queue?
Data Queue or terminal dialogue?
Functions used with the data queue
Leftovers
17: Compound Variables
Traditional subscripted variables vs REXX compound variables
Understanding compound variables
Examples:
18: Reading and Writing Files: EXECIO
The Basics.
The ALLOCATE command for reading.
Reading with EXECIO
Reading whole file with EXECIO into the Data Queue - example
Reading one record at a time into the Data Queue - example:
Reading whole file with EXECIO into an array - example
Additional options for Reading
The ALLOCATE command for writing.
Writing with EXECIO
Writing whole file from the Data Queue - Example:
Writing whole file with EXECIO from an array - example
19: The INTERPRET Instruction
Why INTERPRET?
20: Running REXX in Batch, with JCL
Example
Sample Pages (formatting not same as in the book)
(This is a part of the chapter) 11: Math
Math: Precision
If Einstein had had REXX he would have been twice the genius he was. (Or would he have been creating video games...). REXX does math to whatever precision you desire, limited only by the amount of computer memory you have available. REXX does everything in decimal numbers so you won't see approximate results.
Changing the precision.
The default precision is 9 digits. If a calculation generates more significant digits than that, REXX will round the answer and stop at 9 digits. You can change the precision to 100 or 1000 or 10000! On some systems you can go much higher than that. Useful for figuring your income tax.....
To change the precision to 100 digits:
NUMERIC DIGITS 100
The following example will show you what that means.
SAY 2 / 3
/*displays .666666667 (9 digits) */
NUMERIC DIGITS 100
SAY 2 / 3
/*displays
.6666666666666666666666666666666666666666
6666666666666666666666666666666666666666
66666666666666666667 */
Do Practice Problems 35 - 38.
15: Writing Your Own Subroutines
Example
/* REXX */
/* instructions */
CALL MYSUB
/* instructions */
/* instructions */
EXIT
MYSUB:
ANSWER = NUM1 + NUM2
SAY ANSWER
RETURN
Writing internal subroutines
An internal subroutine is used to simplify coding - to avoid long cumbersome logic structures. I strongly encourage their use.
A subroutine looks like a function, but it's not a function.
Here are the characteristics of a subroutine:
- invoked by: CALL subroutine-name
- Example: CALL ADDEM
- ARG is optional
- RETURN is required but you don't have to pass information back on it
- variables are generally shared with the main part of the program
- there are no external subroutines in REXX.
Do Practice Problems 48 - 52.
Top of PagePractice problems and suggested answers that go with the book. View as web page
You can obtain them here. (Ask for REXX, then rexx2.prob.txt) Get code
Writing ISPF Editor Macros in REXX
More information on setting up to use REXX on TSO
REXX Error Codes
2 Expression > 64000 characters (OS/2 only)
3 Program is unreadable
4 Program interrupted
5 Machine storage exhausted
6 Unmatched /* or quote
7 WHEN or OTHERWISE expected
8 Unexpected THEN or ELSE
9 Unexpected WHEN or OTHERWISE
10 Unexpected or unmatched END
11 Control stack full
12 Clause > 500 characters
13 Invalid character in data
14 Incomplete DO/SELECT/IF
15 Invalid hex constant
16 Label not found
17 Unexpected PROCEDURE
18 THEN expected
19 String or symbol expected
20 Symbol expected
21 Invalid data on end of clause
22 Invalid character string
23 Invalid SBCS/DBCS mixed string
24 Invalid trace request
25 Invalid subkeyword found
26 Invalid whole number
27 Invalid do syntax
28 Invalid LEAVE or ITERATE
29 Environment name too long
30 Name or string > 250 characters
31 Name starts with numeric or "."
32 Invalid use of stem
33 Invalid expression result
34 Logical value not 0 or 1
35 Invalid expression
36 Unmatched "(" in expression
37 Unexpected "," or ")"
38 Invalid template or pattern
39 Evaluation stack overflow
40 Incorrect call to routine
41 Bad arithmetic conversion
42 Arithmetic overflow/underflow
43 Routine not found
44 Function did not return data
45 No data specified on function return
46 Invalid variable reference
47 Unassigned
48 Failure in system service
49 Interpreter failureThis book will get you into programming with Classic REXX (Restructured eXtended eXecutor language) on IBM's mainframe running MVS, OS390 or Zos TSO/ISPF. You can run REXX online during a TSO session, or in a batch program with JCL.
REXX is a user-friendly interpreted scripting language developed by Michael Cowlishaw. It uses clear English-language verbs and parameters.
REXX is used for application prototyping and one-time jobs. REXX is generally interpreted and so there is a performance penalty.
REXX is used as the driver script for developing and running ISPF applications.
Your email and other personal information will not be given to anyone and will be used only to communicate with you about your order. | Home | Programming | Books for Computer Professionals | Privacy | Terms | Contact |
| Site Map and Site Search | Programming Manuals and Tutorials | The REXX Files | Top of Page |[an error occurred while processing this directive]