Feedback Search Top Backward Forward

The Codesmith's Library

Application Development Using OS/2 REXX

Written by Carsten Whimster



In The Codesmith's Library, I focus on development books and materials. I write this column from the point of view of an intermediate programmer. Pick up whichever book strikes your fancy, and join the growing group of people following our programming columns.

Please send me your comments and thoughts so that I can make this column what you want it to be. I read and respond to all mail.


Well, my WWW homepage is up and running again. Hopefully I'll catch up with my work at school soon, so that I can start expanding it, complete the index and so on. I still have to get it installed onto our school's system, so it is not accesible yet.

I tried to get in touch with Charles Petzold regarding his new book OS/2 Presentation Manager Programming, but he never responded, so maybe I have the wrong address. In any case, I went out and bought the book. Look for the review next month.

With the imminent release of OS/2 Warp 3.0, I have decided to delay the purchase of OS/2 Unleashed, until the new version is released. I picked up a list of all the new books planned specifically for Warp, and I was quite surprised. This list looks larger than the complete list of books for OS/2 2.0 (well, maybe not quite)! There are some really decent books on it too, among others a new (and much needed) version of OS/2 Presentation Manager GPI, Winn. I reviewed the old version recently, and basically thought it was a decent book badly in need of updating (it was written for OS/2 1.3!); it should be popular too, judging from the number of people who have requested a good GPI book over the last few months.

Application Development Using OS/2

Application Development Using OS/2 REXX starts out on a funny note...let me explain. The following is an excerpt from the introduction:

The title of this book Mastering OS/2 REXX:  The Practical Usage
of OS/2 REXX reveals the purpose I had in writing it:  a
concise, but complete, source of information necessary to master the REXX
language for applications in the OS/2 environment.
I spent a few moments verifying that I was indeed reading Application Development Using OS/2 REXX, and then I wondered about this error. I suppose that since Mastering OS/2 REXX (Gargiulo) was released by the same publisher, the editors probably suggested the name change, but one would think that they would have looked through the book and fixed the relevant parts? That doesn't inspire confidence, that's for sure. In any case, I read on, and what Rudd said is not just idle talk. Here are the chapter headings:
  1. Introduction
  2. REXX Concepts
  3. REXX Program Elements
  4. Parsing
  5. Arithmetic
  6. Input/Output
  7. Debugging
  8. Programming Practices
  9. REXX Instructions
  10. REXX Built-In Functions (SAA)
  11. REXX Built-In Functions (Non-SAA)
  12. Utility Routines
  13. Worked Example
  14. REXXUTIL Utility Functions
  15. Host Commands
  16. Application Programming Interface
  17. Service Routines
  18. Worked Example (Programmed Implementation)
  19. Database Manager Interface
  20. Personal REXX
  21. Other Products
    Appendix A: REXX Instruction Syntax
    Appendix B: Syntax Notation
    Appendix C: Bibliography
    Appendix D: Glossary
    Appendix E: Compatibility (Various Implementations)
    Appendix F: REXX Data Types
    Appendix G: Useful Control Program Services
    Appendix H: RXSTRING Processing Routines
    Appendix I: Function Migration
    Appendix J: Program Preparation
The first few chapters form the obligatory REXX introduction, and since I have done a few of those recently, I'll skip over it lightly. Basically, you learn the answer to the following questions:
  • What is REXX?
  • Where did REXX come from?
  • What does REXX do?
  • Where can I use REXX?
  • What is in the future for REXX?
  • What is the OS/2 version of REXX like?
  • What does a REXX program look like?
  • What do REXX statements look like?
  • How do I write REXX statements?
  • What are REXX variables like?
  • How does REXX interpret statements?
  • How do I run a REXX program?
  • What flow control constructs does REXX have?
  • What are REXX queues?
Parsing is explained next, and although the chapter is not long, it is quite good. Arithmetic follows, and REXX's arbitrary precision is demonstrated along with numeric formats and sequence of operators. Input/output streams are explained, with sections on buffering, files, terminals, characters, and various other topics following. A chapter is devoted to debugging, but since this is not a topic which is frequently found in this type of book, I would have liked to see a more thorough treatment. Nevertheless, there are no glaring omissions, just a few vague points.

Chapter 8 is a rare piece on programming practices. I would love to see more information like this in programming books, but it is unfortunately frequently skipped over. This chapter helps the novice/intermediate programmer to learn about good programming habits, and maintenance/performance issues. The chapter is good, but a bit short.

Chapters 9 to 12 combine to make an oddly placed, but well-written reference section. The syntax and parameters of REXX instructions, built-in functions (SAA), built-in functions (non-SAA), and utility functions are all presented rigorously.

Chapter 13 confirms the unusual direction this book has been given, which we had a glimpse of in chapter 8. The chapter consists of a 49 line program which implements the DISKW operation of the EXECIO command found in MVS and VM/CMS environments. The syntax is presented, followed by the program, and finally a line-by-line explanation of the program. This type of real-world program can teach REXX far more effectively than a million small programs can. The reader gets a chance to see how a REXX programmer solves a real problem. The chapter is short, but other writers should take notice. This is a great idea. Of course, this program is probably too complicated for a novice, but it is refreshing to see a program which actually does something useful, rather than the "Hello World" variety (which does have its place, however).

After the sample program, the book launches into an "advanced" section. This section consists of discussions of such topics as REXXUTIL (REXXUTIL is a DLL with OS/2 specific commands) with an example of how to do full-screen input/output, and host commands (starting DOS and OS/2 sessions and so on).

Chapter 16 introduces the topic of interfacing with other programming languages and programs. Specifically, it shows how to include REXX functions or programs from C code, and gives some decent examples of how to do this. It even gives a brief example of how to call REXX from PL/I. The inclusion of this chapter, which is one of the longer ones in the book, goes a long way towards demonstrating the intent of this book. It may sound like a REXX how-to book for beginning and intermediate REXX programmers, but when you look a little closer, there is some serious information here for the advanced programmer who already knows REXX, and needs a book which covers the unusual, and acts like a reference manual as well. Chapter 17 then adds to this by explaining how to register external functions for use within REXX.

Chapter 18 is another "worked example"; this time it expands on the example in chapter 13, and the result is FEXECIO, a routine which can process a whole file in one call. The surprise is that it is written in C, and calls REXX routines to do the dirty work.

The third part of the book is about "applications". The emphasis here is on how to use REXX for real-world productivity solutions, such as interfacing with DB2/2. As in previous examples, some real SQL calls are demonstrated, and decent code snippets are given. Personal REXX from Quercus Systems, and some other REXX products are given a brief treatment, among which is VX-REXX. The appendices are all very brief and their titles pretty well explain what they are all about, so I'll skip them here.


Application Development Using OS/2 REXX is a fairly fast-paced REXX book. It covers some unusual and rare material in some depth. Application Development Using OS/2 REXX is a unique kind of book. It has enough reference material in it to serve as a decent reference manual, but it also has good sections on programming and debugging techniques, and interfacing with C and DB2/2. It covers far more than a book this size has a right to, but sacrifices a little depth in places. As a consequence, beginners should probably stay away from this book until they are reasonably fluent with REXX. If your needs are unusual, however, and all you need is a pointer in the right direction, then this book is for you.

I give it an A-.

Application Development Using OS/2 REXX, Rudd

  • Wiley-QED. ISBN 0-471-60691-X, $US420, CAN$50.
  • Intended audience: Intermediate to Advanced Rexx Programmers
  • Mark: A-

Reviewed Books

Our Bookstore has reviews and links to Amazon for all books we have reviewed in the past, as well as several books waiting to be reviewed, and others which we recommend.