Preventing Translation to Uppercase
As a rule, all alphabetic characters processed by the language processor are
translated to uppercase before they are processed. These alphabetic characters
can be from within an exec, such as words in a REXX instruction, or they can be
external to an exec and processed as input. You can prevent this translation to
uppercase in two ways depending on whether the characters are read as parts of
instructions from within an exec or are read as input to an exec.
From Within an Exec
To prevent translation of alphabetic characters to uppercase from within an exec,
simply enclose the characters in single or double quotation marks. Numbers and
special characters, whether or not in quotation marks, are not changed by the
language processor. For example, when you follow a SAY instruction with a phrase
containing a mixture of alphabetic characters, numbers, and special characters, only
the alphabetic characters are changed.
SAY The bill for lunch comes to $123.51!
results in:
THE BILL FOR LUNCH COMES TO $123.51!
Quotation marks ensure that information from within an exec is processed exactly
as typed. This is important in the following situations:
v
For output when it must be lowercase or a mixture of uppercase and lowercase.
v
To ensure that commands are processed correctly. For example, if a variable
name in an exec is the same as a command name, the exec ends in error when
the command is issued. It is good programming practice to avoid using variable
names that are the same as commands, but just to be safe, enclose all
commands in quotation marks.
As Input to an Exec
When reading input from a terminal or when passing input from another exec, the
language processor also changes alphabetic characters to uppercase before they
are processed. To prevent translation to uppercase, use the PARSE instruction.
For example, the following exec reads input from the terminal screen and
re-displays the input as output.
Example of Reading and Re-displaying Input
/************************** REXX ***********************************/
/* This is an interactive REXX exec that asks a user for the name */
/* of an animal and then re-displays the name.
*/
/*******************************************************************/
SAY "Please type in the name of an animal."
PULL animal
/* Get the animal name.*/
SAY animal
If you responded to the example with the word
tyrannosaurus
, you would see on
your screen:
Preventing Translation to Uppercase
20
z/OS V1R1.0 TSO/E REXX User’s Guide
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......