Chapter 2. Writing And Running A Rexx Exec; Before You Begin - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

Chapter 2. Writing and Running a REXX Exec

Before You Begin . . . . . . . . . . . . . . . . . . . . . . . . 7
What is a REXX Exec? . . . . . . . . . . . . . . . . . . . . . . 8
Syntax of REXX Instructions . . . . . . . . . . . . . . . . . . . . 9
Running an Exec . . . . . . . . . . . . . . . . . . . . . . . . 16
Interpreting Error Messages . . . . . . . . . . . . . . . . . . . . 19
Preventing Translation to Uppercase . . . . . . . . . . . . . . . . . 20
Passing Information to an Exec . . . . . . . . . . . . . . . . . . . 21
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
The Character Type of REXX Instructions . . . . . . . . . . . . . . 9
Using Quotation Marks in an Instruction . . . . . . . . . . . . . . 9
The Format of REXX Instructions . . . . . . . . . . . . . . . . . 10
Continuing an instruction . . . . . . . . . . . . . . . . . . . 10
Ending an instruction. . . . . . . . . . . . . . . . . . . . . 11
Types of REXX Instructions . . . . . . . . . . . . . . . . . . . 12
Keyword . . . . . . . . . . . . . . . . . . . . . . . . . 13
Assignment . . . . . . . . . . . . . . . . . . . . . . . . 13
Label . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Null . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Command. . . . . . . . . . . . . . . . . . . . . . . . . 14
Allocating a PDS to a System File . . . . . . . . . . . . . . . . 17
Exercises - Running the Example Execs . . . . . . . . . . . . . 18
From Within an Exec. . . . . . . . . . . . . . . . . . . . . . 20
As Input to an Exec . . . . . . . . . . . . . . . . . . . . . . 20
Using Terminal Interaction . . . . . . . . . . . . . . . . . . . . 21
Specifying Values when Invoking an Exec . . . . . . . . . . . . . . 22
Specifying Too Few Values . . . . . . . . . . . . . . . . . . 22
Specifying Too Many Values . . . . . . . . . . . . . . . . . . 22
Exercises - Using the ARG Instruction . . . . . . . . . . . . . . 23
Passing Arguments . . . . . . . . . . . . . . . . . . . . . . 24
. . . . . . . . . . . . . . . . . . . 10
. . . . . . . . . . . . 14
. . . . . . . . . . . . . . . . . . . 16
. . . . . . . . . . . . . . . . . . . 17
24
7

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents