Three REXX Books Reviewed

By Jonathan Story

''This article was first printed in the Jan '93 newsletter for the Vancouver PC Users Society. It has an OS/2 bias.''

Introduction
REXX has been around for more than a decade. At first it was used only on mainframes, but more recently has become available for personal computers as well. Two great strengths which have helped this propagation are that it embraces the operating environment on which it runs, and that it is easy to use. Any place where REXX is supported means yet another macro or batch language that the computer user doesn't need to learn.

Three books about REXX have recently been published as part of McGraw-Hill's J. Ranade Series, and are the subject of this review: New York: McGraw-Hill, 299 pages, 1992. $44.95 New York: McGraw-Hill, 239 pages, 1993. $39.95 New York: McGraw-Hill, 646 pages, 1992. $49.95
 * Programming in REXX, by Charles Daney
 * REXX: Advanced Techniques for Programmers, by Peter C. Kiesel
 * The REXX Handbook, edited by Gabriel Goldberg and Philip H. Smith III

Programming in REXX
REXX is easy enough to use that many people, and most programmers, can get by with only a cursory look at existing REXX programs, some online help, and trial and error. To use REXX well, however, demands a better understanding of the language. Programming in REXX can give it.

The author, Charles Daney, is well-qualified to write such a book. He brings with him the technical depth that comes with implementing DOS and OS/2 versions of REXX for his company, Quercus Systems. Perhaps just as important, he also uses REXX, and draws on this experience to look at issues that are important to programmers.

Programming in REXX is not suitable as an introductory programming text. Daney assumes that the reader has at least some knowledge of programming (if none of REXX). This is not because the book is filled with arcane references, but rather to avoid having to explain such basic concepts as variables, statements, and functions.

Mike Cowlishaw, the inventor of REXX, defined the language in his book, The REXX Language. Daney praises the work for being so readable for a language definition, but attempts in his own book to expand and clarify. As an example, the possibly confusing terms "instruction" and "keyword instruction" that Cowlishaw uses are replaced by "statement" and "instruction", respectively - more familiar to many programmers.

Programming in REXX contains fourteen chapters, plus appendixes that list the REXX instructions and built-in functions. Each chapter, after the Introduction and Language Overview, examines some aspect of the language: Program Structure and Syntax, Control Structures, Subroutines and Functions, Commands to External Environments, Character String Handling, The PARSE Instruction, Input and Output, The External Data Queue, Exception Handling, The INTERPRET Instruction, REXX Arithmetic, and finally, Tracing and Debugging. It is not absolutely necessary to read the chapters in order, but for the first reading this is a good idea.

The hardest slogging, unfortunately, comes near the beginning with the Language Overview. Like a French Immersion class, it shows you enough to get started, but this comes at the cost of getting too much too soon. Fear not. The rest of the book is more like dim sum, presenting information in small, tasty, and quite digestible portions.

Throughout, Daney keeps an eye out for programmers' previous experiences, remarking on similarities and pitfalls. One that could cause problems for those who use C is that REXX does NOT do logical short circuiting. In other words, in the expression A & B, B will always be evaluated. He does, however, in one place make the minor error of misidentifying "%" as the "integer division" operator in C.

The book contains numerous examples to illustrate how REXX commands and functions work. This ranges from a multi-page "Eliza" program to a one-line gem showing how TRANSLATE can also re-arrange a string. The effect of this is to make using REXX as easy as we always knew it was. One area not covered, for the most part, is how REXX works under specific operating environments. For a book such as this, the lack is actually a plus, since it is relevant for any REXX programmer on any system. This does mean, however, that while this could be the first REXX book you'll read, it will not be the last.

I have some quibbles with the book, but these are few. The appendixes are not easy to search quickly; the entries should be formatted better and fewer entries should have to span a page (this is distracting). Also, the book is hard cover. In my experience, while hard cover books are more durable, soft covers can get thumbed through faster - but this may be just a matter of personal preference.

To conclude, Programming in REXX gives excellent value for a programmer new to REXX. It answers the most pressing questions without burdening the reader with excessive detail, and deserves a place in a REXX programmer's library.

Advanced Techniques
REXX: Advanced Techniques for Programmers is of much more limited appeal than Programming in REXX. Most obvious is that the book is written for someone in a mainframe environment; if you don't know what VM, CMS or TSO is, then you might want to look elsewhere. The alternative is to get used to reading only half the book.

Advanced Techniques groups twenty-one chapters into four major sections: Coding Techniques; How to Debug Your Program; Editor Macros; and User-to-Program Interface Issues. The chapters deal with such diverse topics as: Overall Format of Your Program; How to Get Pretty Output; Performance in VM; Sample XEDIT Macros; Reading/Writing Files; Using Select in Place of IF; and Can I Make a REXX "Include" File? If this partial listing appears to lack organization, this is only a mirror of the book itself. The author, Peter Kiesel, has for eight years taught REXX to IBM employees and customers. While reading his book, one can imagine that he put into a box all the Post-It notes he wrote during the course of his teaching and handed it to a publisher. This is not to say that the result is uniformly bad, but uneven, with no coherent theme, and a hodge-podge of advice.

There are good parts, which with more development could have been even better. One is the chapter on "Commonly Found Errors (For Each Instruction)." For a programmer, if there is anything more satisfying than fixing an elusive bug, it is not to have made the bug in the first place. Here Kiesel at least partially succeeds. He does weaken its relevance, however, by the VM-centric bias that is the reader's constant companion throughout the book. (The few sops he throws to OS/2 do little to redress the balance.)

There is an unfortunate flaw that was not under the control of the author. In my copy, at least, the print quality is uneven. Sporadically, some characters appear not fully formed. The result, although legible, is distracting. If you can, examine your copy before purchase.

I cannot recommend Advanced Techniques for a first REXX book, especially for non-VM users. Moreover, even those in the VM world might be well-advised to consider looking first to something like Programming in REXX for a grounding in the basics. As a supplementary text, Advanced Techniques has somewhat greater value, but, again, largely for IBM mainframe environments.

REXX Handbook
Let's get one thing clear at the start: you don't need The REXX Handbook. The more important question is: is it something you might want? The answer is very possibly yes.

Forty-five articles by three dozen writers cover enough different areas that, if you like REXX, chances are you'll find something here to like as well. A sampling of article titles include: "REXX Origins", "The REXX I/O Model", "Debugging", "Object-Oriented REXX", "Application Macros", "REXX Compiler for CMS", "Amiga REXX", "REXX for PC-DOS and MS-DOS", "REXX and DB/REXX", "SAA Portability", "The IBM OS/2 and OS/400 REXX Interpreter", "REXX Education", and more.

To put it another way, for the price of dinner and a movie, you can hold a REXX convention in your hands.