Chapter 2. Writing and Running a REXX Exec
. . . . . . . . . . . . . . . . . . . . . . . . 7
What is a REXX Exec? . . . . . . . . . . . . . . . . . . . . . . 8
Syntax of REXX Instructions . . . . . . . . . . . . . . . . . . . . 9
The Character Type of REXX Instructions
Using Quotation Marks in an Instruction . . . . . . . . . . . . . . 9
The Format of REXX Instructions . . . . . . . . . . . . . . . . . 10
. . . . . . . . . . . . . . . . . . . 10
Continuing an instruction . . . . . . . . . . . . . . . . . . . 10
Continuing a literal string without adding a space . . . . . . . . . . 11
Ending an instruction. . . . . . . . . . . . . . . . . . . . . 11
Types of REXX Instructions . . . . . . . . . . . . . . . . . . . 12
Keyword . . . . . . . . . . . . . . . . . . . . . . . . . 13
Assignment . . . . . . . . . . . . . . . . . . . . . . . . 13
Label
. . . . . . . . . . . . . . . . . . . . . . . . . . 14
Execs Using Double-Byte Character Set Names
Running an Exec . . . . . . . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . 17
Allocating a PDS to a System File . . . . . . . . . . . . . . . . 17
Exercises - Running the Example Execs
Interpreting Error Messages . . . . . . . . . . . . . . . . . . . . 19
Preventing Translation to Uppercase . . . . . . . . . . . . . . . . . 20
Exercises - Running and Modifying the Example Execs . . . . . . . . 21
Passing Information to an Exec . . . . . . . . . . . . . . . . . . . 21
Using Terminal Interaction . . . . . . . . . . . . . . . . . . . . 21
Specifying Values when Invoking an Exec . . . . . . . . . . . . . . 22
. . . . . . . . . . . . . . . . . . 22
Specifying Too Many Values . . . . . . . . . . . . . . . . . . 22
Preventing Translation of Input to Uppercase . . . . . . . . . . . . . 23
Exercises - Using the ARG Instruction . . . . . . . . . . . . . . 23
Passing Arguments . . . . . . . . . . . . . . . . . . . . . . 24
Passing Arguments Using the CALL Instruction or REXX Function Call
Passing Arguments Using the EXEC Command . . . . . . . . . . . 24
This chapter introduces execs and their syntax, describes the steps involved in
writing and running an exec, and explains concepts you need to understand to
avoid common problems.
Before You Begin
Before you can write a REXX program, called an exec, you need to create a data
set to contain the exec. The data set can be either sequential or partitioned, but if
you plan to create more than one exec, it is easier to create a REXX library as a
partitioned data set (PDS) with execs as members.
To create a PDS, allocate a data set with your prefix (usually your user ID) as the
first qualifier, any name as the second qualifier, and preferably "exec" as the third
qualifier. You can allocate the PDS with the Utilities option in ISPF/PDF or with the
© Copyright IBM Corp. 1988, 2001
7
Summary of Contents for TSO/E REXX
Page 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 2: ......
Page 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Page 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Page 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Page 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Page 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Page 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Page 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Page 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Page 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Page 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Page 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Page 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Page 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Page 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Page 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Page 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Page 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Page 241: ......