IBM SC34-5764-01 Server User Manual


 
Chapter 8. Using Commands from a program
This chapter describes how to use commands in a REXX program.
Types of Commands
A REXX program can issue several types of commands. The main categories of commands are:
REXX/CICS commands
These commands provide access to miscellaneous REXX/CICS facilities. See Chapter 25,
“REXX/CICS Commands,” on page 319.
CICS commands
These commands implement the EXEC CICS commands that application programs use to access
CICS services. These commands are documented in the CICS Transaction Server for VSE/ESA
Application Programming Reference.
SQL statements
These statements are prepared and executed dynamically. See Chapter 22, “REXX/CICS DB2
Interface,” on page 285
EDIT commands
These commands invoke the editor facilities from the REXX/CICS macros. See Chapter 18,
“REXX/CICS Text Editor,” on page 231.
RFS commands
These commands are for the REXX File System (RFS). See Chapter 19, “REXX/CICS File
System,” on page 257.
RLS commands
These commands are for the REXX List System (RLS). See Chapter 20, “REXX/CICS List
System,” on page 273.
When a program issues a command, the REXX special variable RC is set to the return code. A program
can use the return code to determine a course of action within the program. Every time a command is
issued, RC is set. Therefore, RC contains the return code from the most recently issued command.
Using Quotations Marks in Commands
Generally, to differentiate commands from other types of instructions, you enclose the command within
single or double quotation marks. If the command is not enclosed within quotation marks, it is processed
as an expression and might end in error. For example, the language processor treats an asterisk (*)asa
multiplication operator.
Many CICS commands use single quotation marks within the command. For this reason, it is
recommended that, as a matter of course, you enclose CICS commands within double quotation marks.
The following example places the word test in the temporary storage queue ABC.
"CICS WRITEQ TS QUEUE('ABC') FROM('test')"
Using Variables in Commands
When a command contains a variable, the value of the variable is not substituted if the variable is within
quotation marks. The language processor uses the value of a variable only for variables outside quotation
marks.
© Copyright IBM Corp. 1992, 2009 81