Developing REXX applications
This chapter introduces programs and their syntax, describes the steps involved in writing and running programs, and explains concepts you need to understand to avoid common problems.
What is a REXX program?
A REXX program consists of REXX language instructions that the REXX interpreter interprets directly. A program can also contain commands that the host environment executes, such as CICS commands (see Types of commands).
/* Sample REXX Program */
SAY 'Hello world!'
This program starts with a comment line to identify it as a REXX program. A comment begins with /* and ends with */ . More about comments and why you might need a REXX program identifier appears later in Types of REXX clauses.
Hello world!
REXX addtwo
For
this example, the first number you will enter is 42, and the second
number is 21. Here is the ADDTWO program:
/**************************** REXX
*********************************/
/* This program adds two numbers and produces their sum. */
/*******************************************************************/
say 'Enter first number.'
PULL number1 /* Assigns: number1=42 */
say 'Enter second number.'
PULL number2 /* Assigns: number2=21 */
sum = number1 + number2
SAY 'The sum of the two numbers is' sum'.'
The sum of the two numbers is 63.
Before you try any examples, please read the next two sections, Syntax of REXX instructions and Typing in a program.