Home
IBM
Computer Hardware
TSO/E REXX
IBM TSO/E REXX User Manual
4
of 1
of 1 rating
242 pages
Give review
Manual
Specs
To Next Page
To Next Page
To Previous Page
To Previous Page
Loading...
TSO)
is
available
to
the
exec
with
some
limitations.
For
more
information
about
the
TSO/E
environment
service,
limitations
on
the
environment
it
creates,
and
the
different
considerations
for
running
REXX
execs
within
the
environment,
see
z/OS
TSO/E
Programming
Services
.
96
z/OS
V1R1.0
TSO/E
REXX
User
’
s
Guide
113
115
Table of Contents
Table of Contents
5
Figures
11
Tables
13
About this Book
15
How this Book Is Organized
15
Terminology
15
Purpose of each Chapter
16
Examples
16
Exercises
16
Who Should Use this Book
15
Where to Find more Information
16
Accessing Licensed Books on the Web
16
Using Lookat to Look up Message Explanations
17
Part 1. Learning the REXX Language
19
Chapter 1. Introduction
21
Features of REXX
21
Ease of Use
21
Free Format
21
Convenient Built-In Functions
22
Debugging Capabilities
22
Interpreted Language
22
Extensive Parsing Capabilities
22
What Is REXX
21
Components of REXX
22
The SAA Solution
22
Benefits of Using a Compiler
23
Improved Performance
23
Reduced System Load
23
Protection for Source Code and Programs
24
Improved Productivity and Quality
24
Portability of Compiled Programs
24
SAA Compliance Checking
24
Chapter 2. Writing and Running a Rexx Exec
25
Before You Begin
25
What Is a REXX Exec
26
Syntax of REXX Instructions
27
The Character Type of REXX Instructions
27
Using Quotation Marks in an Instruction
27
The Format of REXX Instructions
28
Beginning an Instruction
28
Continuing an Instruction
28
Continuing a Literal String Without Adding a Space
29
Ending an Instruction
29
Types of REXX Instructions
30
Assignment
31
Keyword
31
Execs Using Double-Byte Character Set Names
32
Label
32
Command
32
Null
32
Running an Exec
34
Running an Exec Explicitly
34
Running an Exec Implicitly
35
Allocating a PDS to a System File
35
Exercises - Running the Example Execs
36
Interpreting Error Messages
37
Preventing Translation to Uppercase
38
From Within an Exec
38
As Input to an Exec
38
Passing Information to an Exec
39
Using Terminal Interaction
39
Exercises - Running and Modifying the Example Execs
39
Specifying Values When Invoking an Exec
40
Specifying too few Values
40
Specifying too Many Values
40
Preventing Translation of Input to Uppercase
41
Exercises - Using the ARG Instruction
41
Passing Arguments
42
Passing Arguments Using the CALL Instruction or REXX Function Call
42
Passing Arguments Using the EXEC Command
42
Chapter 3. Using Variables and Expressions
43
Using Variables
43
Variable Names
44
Variable Values
45
Exercises - Identifying Valid Variable Names
45
Using Expressions
46
Arithmetic Operators
46
Division
47
Order of Evaluation
47
Comparison Operators
48
Exercises - Calculating Arithmetic Expressions
48
Using Arithmetic Expressions
48
The Strictly Equal and Equal Operators
49
Using Comparison Expressions
49
Logical (Boolean) Operators
50
Exercises - Using Comparison Expressions
50
Using Logical Expressions
51
Concatenation Operators
52
Exercises - Using Logical Expressions
52
Using Concatenation Operators
52
Priority of Operators
53
Exercises - Priority of Operators
54
Tracing Expressions with the TRACE Instruction
55
Tracing Operations
55
Tracing Results
56
Exercises - Using the TRACE Instruction
56
Chapter 4. Controlling the Flow Within an Exec
59
Default Chapter
60
Using Conditional Instructions
60
IF/THEN/ELSE Instructions
60
Nested IF/THEN/ELSE Instructions
61
Exercise - Using the IF/THEN/ELSE Instruction
62
SELECT/WHEN/OTHERWISE/END Instruction
62
Exercises - Using the SELECT/WHEN/OTHERWISE/END Instruction
64
Using Looping Instructions
65
Repetitive Loops
65
Infinite Loops
66
DO FOREVER Loops
67
ITERATE Instruction
68
LEAVE Instruction
68
Exercises - Using Loops
69
Conditional Loops
70
DO WHILE Loops
70
DO until Loops
71
Exercise - Using a DO WHILE Loop
71
Exercise - Using a DO until Loop
72
Combining Types of Loops
73
Nested DO Loops
73
Using Interrupt Instructions
74
Exercises - Combining Loops
74
CALL/RETURN Instructions
75
EXIT Instruction
75
SIGNAL Instruction
76
Chapter 5. Using Functions
79
What Is a Function
79
Example of a Function
80
Built-In Functions
81
Arithmetic Functions
81
Comparison Functions
81
Conversion Functions
82
Formatting Functions
82
String Manipulating Functions
82
Miscellaneous Functions
83
Testing Input with Built-In Functions
84
Chapter 6. Writing Subroutines and Functions
87
What Are Subroutines and Functions
87
When to Write Subroutines Vs. Functions
88
Writing a Subroutine
88
Passing Information to a Subroutine
90
Passing Information by Using Variables
90
Passing Information by Using Arguments
92
Receiving Information from a Subroutine
93
Example - Writing an Internal and an External Subroutine
94
Writing a Function
95
Passing Information to a Function
97
Passing Information by Using Variables
97
Passing Information by Using Arguments
99
Receiving Information from a Function
101
Summary of Subroutines and Functions
101
Exercise - Writing a Function
101
Chapter 7. Manipulating Data
103
Using Compound Variables and Stems
103
What Is a Compound Variable
103
Using Stems
104
Parsing Data
105
Exercises - Using Compound Variables and Stems
105
Instructions that Parse
106
ARG Instruction
106
PULL Instruction
106
Ways of Parsing
107
Blank
107
Parse Value
107
PARSE VAR Instruction
107
Number
108
String
108
Variable
108
Parsing Multiple Strings as Arguments
110
Exercise - Practice with Parsing
110
Part 2. Using REXX
113
Chapter 8. Entering Commands from an Exec
115
Types of Commands
115
Issuing TSO/E Commands from an Exec
116
Using Quotations Marks in Commands
116
Passing Data Set Names as Arguments
116
Using Variables in Commands
117
Causing Interactive Commands to Prompt the User
118
Invoking Another Exec as a Command
118
Issuing Other Types of Commands from an Exec
119
What Is a Host Command Environment
119
Invoking Another Exec Implicitly
119
Invoking Another Exec with the EXEC Command
119
APPC/MVS Host Command Environments
122
Changing the Host Command Environment
124
Examples Using APPC/MVS Services
124
Checking if a Host Command Environment Is Available
125
Determining the Active Host Command Environment
125
Examples Using the ADDRESS Instruction
125
Chapter 9. Diagnosing Problems Within an Exec
129
Debugging Execs
129
Tracing Commands with the TRACE Instruction
129
Trace C
129
Using REXX Special Variables RC and SIGL
130
Trace E
130
Tracing with the Interactive Debug Facility
131
Sigl
131
Starting Interactive Tracing
132
Ending Interactive Trace
134
Options Within Interactive Trace
134
Chapter 10. Using Tso/E External Functions
137
TSO/E External Functions
137
Using the GETMSG Function
138
Using the LISTDSI Function
138
Using the MSG Function
140
Using the MVSVAR Function
141
Using the OUTTRAP Function
141
Using the PROMPT Function
142
Using the SETLANG Function
143
Using the STORAGE Function
144
Using the SYSCPUS Function
144
Using the SYSDSN Function
144
Using the SYSVAR Function
145
Exec Information
146
Language Information
146
System Information
146
Terminal Information
146
User Information
146
Console Session Information
147
Additional Examples
148
Function Packages
151
Search Order for Functions
152
Chapter 11. Storing Information in the Data Stack
153
What Is a Data Stack
153
Manipulating the Data Stack
154
Adding Elements to the Data Stack
154
Removing Elements from the Stack
155
Determining the Number of Elements on the Stack
155
Exercise - Using the Data Stack
156
Processing of the Data Stack
157
Using the Data Stack
158
Passing Information between a Routine and the Main Exec
158
Passing Information to Interactive Commands
160
Issuing Subcommands of TSO/E Commands
160
Creating a Buffer on the Data Stack
160
Creating a Buffer with the MAKEBUF Command
161
Removing Elements from a Stack with a Buffer
161
Dropping a Buffer with the DROPBUF Command
162
Finding the Number of Buffers with the QBUF Command
162
Finding the Number of Elements in a Buffer
163
Exercises - Creating a Buffer on the Data Stack
163
Protecting Elements in the Data Stack
165
Creating a New Data Stack with the NEWSTACK Command
166
Deleting a Private Stack with the DELSTACK Command
167
Finding the Number of Stacks
167
Additional Examples
168
Chapter 12. Processing Data and Input/Output Processing
171
Dynamic Modification of a Single REXX Expression
171
Using the INTERPRET Instruction
171
Types of Processing
171
Using EXECIO to Process Information to and from Data Sets
172
When to Use the EXECIO Command
172
Using the EXECIO Command
172
Reading Information from a Data Set
173
Writing Information to a Data Set
175
Return Codes from EXECIO
177
When to Use the EXECIO Command
177
Copying Information from One Data Set to Another
177
Copying Information to and from a List of Compound Variables
179
Updating Information in a Data Set
180
Additional Examples
181
EXECIO Example 1
182
EXECIO Example 2
182
EXECIO Example 3
183
EXECIO Example 4
183
EXECIO Example 5
185
EXECIO Example 5 (Continued)
185
EXECIO Example 6 (Continued)
187
EXECIO Example 6
188
EXECIO Example 6 (Continued)
188
Spaces
189
Chapter 13. Using REXX in TSO/E and Other MVS Address Spaces
189
Services Available to REXX Execs
189
Running Execs in a TSO/E Address Space
191
Running an Exec in the Foreground
191
Allocating to SYSEXEC
192
Allocating to SYSPROC
192
Things to Consider When Allocating to a System File (SYSPROC or SYSEXEC)
192
Running an Exec from a CLIST
193
Running an Exec in the Background
194
Running Execs in a Non-TSO/E Address Space
195
Using an Exec Processing Routine to Invoke an Exec from a Program
195
Using IRXJCL to Run an Exec in MVS Batch
196
Using the Data Stack in TSO/E Background and MVS Batch
198
Summary of TSO/E Background and MVS Batch
198
Capabilities
198
Requirements
199
Defining Language Processor Environments
199
What Is a Language Processor Environment
199
Customizing a Language Processor Environment
200
Part 3. Appendixes
201
Appendix A. Allocating Data Sets
203
What Is Allocation
203
Where to Begin
204
Preliminary Checklist
204
Checklist #1: Creating and Editing a Data Set Using ISPF/PDF
205
Checklist #2: Creating a Data Set with the ALLOCATE Command
208
Checklist #3: Writing an Exec that Sets up Allocation to SYSEXEC
209
Checklist #4: Writing an Exec that Sets up Allocation to SYSPROC
210
Appendix B. Specifying Alternate Libraries with the ALTLIB Command
213
Specifying Alternative Exec Libraries with the ALTLIB Command
213
Using the ALTLIB Command
213
Stacking ALTLIB Requests
214
Using ALTLIB with ISPF
214
Examples of the ALTLIB Command
214
Appendix C. Comparisons between CLIST and REXX
215
Accessing System Information
216
Controlling Program Flow
217
Debugging
218
Execution
218
Interactive Communication
219
Passing Information
219
Performing File I/O
220
Syntax
220
Using Functions
221
Using Variables
221
Appendix D. Notices
223
Programming Interface Information
225
Trademarks
225
Bibliography
227
TSO/E Publications
227
Related Publications
227
Index
229
4
Based on 1 rating
Ask a question
Give review
Questions and Answers:
Need help?
Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?
Ask a question
IBM TSO/E REXX Specifications
General
Brand
IBM
Model
TSO/E REXX
Category
Computer Hardware
Language
English
Related product manuals
IBM THINKCENTER 8128
290 pages
IBM Computer
58 pages
IBM S922
56 pages
IBM Power S1014
38 pages
IBM 29
46 pages
IBM System/360 2050
198 pages
IBM 5250
68 pages
IBM PowerPC 405GP
668 pages
IBM Power System S914
48 pages
IBM Power System S924
50 pages
IBM Power System S922 9009-22A
56 pages
IBM PowerPC 750GX
377 pages