Syntax Of Rexx Instructions; The Character Type Of Rexx Instructions; Using Quotation Marks In An Instruction - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

When you type a number, for example 42, and press the Enter key, the variable
number1 is assigned the value 42. You then see another sentence on the screen.
When you enter another number, for example 21, the variable number2 is assigned
the value 21. Then the values in number1 and number2 are added and the total is
assigned to sum. You see a final sentence on the screen displaying the sum.
Before you actually try these examples, please read the next two sections:
v "Syntax of REXX Instructions"
v "Running an Exec" on page 16

Syntax of REXX Instructions

Some programming languages have rigid rules about how and where characters
are entered on each line. For example, CLIST statements must be entered in
uppercase, and assembler statements must begin in a particular column. REXX, on
the other hand, has simple syntax rules. There is no restriction on how characters
are entered and generally one line is an instruction regardless of where it begins or
where it ends.

The Character Type of REXX Instructions

You can enter a REXX instruction in lowercase, uppercase, or mixed case.
However, alphabetic characters are changed to uppercase, unless you enclose
them in single or double quotation marks.

Using Quotation Marks in an Instruction

A series of characters enclosed in matching quotation marks is called a literal string.
The following examples both contain literal strings.
SAY 'This is a REXX literal string.'
SAY "This is a REXX literal string."
You cannot enclose a literal string with one each of the two types of quotation
marks. The following is not a correct example of an enclosed literal string.
SAY 'This is a REXX literal string."
When you omit the quotation marks from a SAY instruction as follows:
SAY This is a REXX string.
you see the statement in uppercase on your screen.
Note: If any word in the statement is the name of a variable that has already been
Now enter a number to add to the first number.
The sum of the two numbers is 63.
THIS IS A REXX STRING.
assigned a value, REXX substitutes the value. For information about
variables, see "Using Variables" on page 25.
What is a REXX Exec?
/* Using single quotes */
/* Using double quotes */
/* Using mismatched quotes */
Chapter 2. Writing and Running a REXX Exec
9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents