Writing Your Program

You can create Rexx programs using any editor that can create simple ASCII files without hidden format controls. Windows Notepad or Linux gedit are a couple widely available editors.

Rexx is a free-format programming language. You can indent lines and insert blank lines for readability if you wish. But even free-format languages have some rules about how language elements are used. Rexx's rules center around its basic language element: the clause.

Usually, there is one clause on each line of the program, but you can put several and separate each clause with a semicolon (;):

say "Hello"; say "Goodbye"  /* Two clauses on one line */

To continue a clause on a second line, put a comma (,) or hypen (-) at the end of the line:

say,             /* Continuation */
"It isn't so"


say -            /* Continuation */
"It isn't so"

If you need to continue a literal string, do it like this:

say,             /* Continuation of literal strings */
"This is a long string that we want to continue",
"on another line."

Rexx automatically adds a blank after continue. If you need to split a string, but do not want to have a blank inserted when Rexx puts the string back together, use the Rexx concatenation operator (||):

say "I do not want Rexx to in"||,   /* Continuation with concatenation */
"sert a blank!"