Advanced REXX Telecourse

by Guy De Ceulaer and Kris Buelens.

© International Business Machines Corporation 2000. 2007  All rights reserved.  No part of this publication may be reproduced in any form of by any means without permission in writing from the publisher.

For optimal view, stretch your browser window as wide and high as possible.  Then, select the frame with this text and use View/Increase Font or View/Decrease Font until you find the text comfortable.  More info on this at the bottom of this document.

What is this ?

This site presents an advanced course on REXX, focused mainly on VM/ESA, but some characteristics of REXX on OS/2 are covered too.

Originally, this course was presented on paper.  It was run as a kind of correspondence course, whereby we mailed a lesson text and a set of exercises to the students.  The students had then to assimilate the material and to send back the results of their work.  The results were reviewed by us, commented in another paper and sent back to the students bundled with the next lesson text.

Now, with an extensive amount of work, it is transformed to HTML so that it can be taken via a web browser. 

It is supposed that you already have some experience with REXX.  If that is not the case, we suggest that you first read the REXX User's Guide

This course builds on the basic REXX skills, and this material adds the experience of your instructors (together, more than 40 years VM and REXX experience).  Not only experience on REXX, but also experience in teaching, as we were instructors for many years at the IBM Education Center in Belgium.

The text therefore contains:

Furthermore, the concept of self-study lets you learn at your own pace, when you have the time, and without traveling problems.  The discipline to take the most out of this course is now totally yours, as there is no longer a two-way dialog where we can correct and comment on the students' work.  The possibilities offered by the browsers are also exploited, augmenting the conviviality of an otherwise boring book.

It may be a hard job to take the whole course in one shot.  Count at least an average of 2 hours per chapter for reading, and slightly more for the exercises and the review of the commented solutions.  The printout of the whole course could result in as much as 300 pages !


Several samples, tools or pieces of code presented in the text are indicated by the character © and are available for download here.

You need to have the VMARC MODULE on your system.  If you don't, you can get it from The VM Download Site, where the use of VMARC is also explained.

When you have downloaded the Toolkit, then upload it to your VM system as follows:

    SEND d:\download\toolkit.vmarc a:toolkit vmarc a (lrecl 80 recfm f

and unpack the files on VM to a minidisk or directory:


NLS Characters.

Some special characters used by the REXX language & CMS Pipelines, have a different representation depending upon the national language or character codepage used in the countries.  This table summarizes the main differences:

Character used for US Codepage 037 International
Codepage 500
Codepage 850
REXX Logical OR,
Pipeline Stage Separator
| ('4F'x) ! ('4F'x) | (ASCII 124)
REXX Concatenation || !! || (ASCII 124)
REXX Logical NOT ¬ ('5F'x)
or \ ('E0'x)
^ ('5F'x)
or \ ('E0'x)
¬(ASCII 170)
or \(ASCII 92)

On your real VM terminal, you will of course have to use the correct character that corresponds to the US codepage (|, ¬ and \).  Therefore, where the International Codepage 500 is used, you have to use (! and ^).  This text may however use both | and ! to the same purpose.

Note: The | may display as a split-vertical-bar (¦) on some Personal Computer terminals or 3270-emulators.

Conventions in the text.

We try to be consistent in the text and highlight commands, statements and parameters in another font or color.

You may also have heard about our VM goodies - a collection of VM tools written by your instructors.  Whenever appropriate, we will promote a few of our goodies.  Quite a lot can be considered productivity tools when programming REXX procedures.  The goodies can also be downloaded from this site.

Important text will be displayed using a bold font, but in many cases, we will highlight parts of the text with icon-boxes.  For example :


This box serves to draw your attention on a particularity.


This icon introduces a programming tip or a hint to improve the use of CMS Pipelines.


This box gives more details about the 'internals' of VM or CMS.  It explains how things work and are designed.  It can also explain more advanced techniques.


This icon will indicate that you can encounter serious problems if you don't pay attention to the rules, or that this is an important and more difficult concept we want to explain.


Here we give hints an tips to improve the performance of your procedures.


This icon suggests to switch your memory recorder on in order to never forget it anymore...

The text also contains questions that you should try to answer.  These are indicated as follows:

Question nn

This is the text for question "nn"

If you click on the icon, you will see the answer to the question.  From there, use the backward navigation button to return to the text.

About the exercises.

After each lesson, which can be composed of several chapters, we propose some exercise assignments to put your learning into practice.  It's clear that this is by far the best way to learn most of the subject.  We therefore urge you to take the time to solve the exercises, as well as the questions scattered throughout the text.

For most exercises we present a solution in separate document.  Please, don't be tempted to look at the solutions too quickly.  On the other hand, the solutions really complement the lesson text, so that you will gain a lot in reviewing them.

Our solutions may take one of the most characteristic results given by a former students.  From there on, we build up a well designed solution and comment on why we are doing so.  Of course, there is not always a unique correct solution, and yours may be fine as well.

In our discussions, we frequently put emphasis on performance aspects. Some may have the impression that we exaggerate.  We don't think so.  Our main objective is to learn you the correct techniques right from the beginning, so that it becomes natural later in your day-to-day work.  It's clear that when you write a procedure to be used just once, the performance aspect is not so important.  But if for such 'single-use' procedures, you use techniques that are bad for performance, it's probable that you'll do also for your other procedures that may be executed several hundreds or thousands of times a day...

How to take the course.

The text was composed for display with the Mozilla browser.  Other browsers work as well, but may sometimes present a slightly different layout.  Especially browsers older then NETSCAPE 4.6 that don't support styles will use the fonts that you have defined as your preferences.  For this text, we suggest you choose a not too small font both for the proportional as for the non-proportional text.  Personally we prefer a sans-serif font, but that is a matter of taste.

Browsers that support the styles will use the fonts that we define in the style, so that the text is presented in hopefully the best manner.  But you can still increase or decrease the font size using options of the browser (e.g. the View menu of Netscape).

Most browsers support frames, so we used that technique here.

On the left pane, you find references to the different chapters of the course.  Select the one you want to read, and it will be presented in the right pane. 

The titles in the different chapters are hyperlinks to the table of contents.  The question icon is a hyperlink to its answer.  When instructed so, use the backward navigation button of your browser to return to the previous document.

If you have a low-resolution display, you may also choose to open a new browser window (right-click on the hyperlink).  Backward navigation is however disabled when using this technique.

You can also print the text and read it at a quiet and relax place, but then you loose the browser possibilities, such as colors and hyperlinks.


One last thing before you start the study.  You can take this course for free although we have put several months of work in it. 

The least you could do when you have taken (part of) this course is to send us a little e-mail with your praise, critics, remarks, spotted errors in the text, suggestions...  This is the fuel that keeps us working.

You can e-mail at one of following addresses:

We thank you for your feedback.