the REXX Files- by Paul Monaghan

This is the hardest part of any column: day 1. This is where I have to explain what I am going to be writing about and what you can expect to see here--and sell you on it so you keep coming back. So I figure I should just jump in with both feet and tell you straight out. REXX! What I hope to do is let you follow me on my trek to learn REXX. Even though this column is intended for the beginning REXX programmer, I'm hoping that experienced REXX programmers will be interested too. First I believe I need some introducing, and then we'll dive right in.

I've been using OS/2 since version 2.1 and haven't looked back since, I'm a member of Team OS/2, I have always wanted to teach myself REXX, and now I'm doing it. I have limited programming experience, most of it on my Dad's old Commodore 64 when I was back in high school (ahh, BASIC, now that's a language!). I also believe that any operating system that doesn't have a command line is a waste of time; I must have my C:\ prompt.

I have several reasons for wanting to learn REXX. Primarily, I run a BBS, and knowing REXX would really help. The second reason is associated with the first; I want to make a 'one-liners' program for the BBS that will output an ANSI file and can be run every night as an event. I'm hoping to make it "Why OS/2 is better than Windows" one-liners, as there are several files like this flying through the 'net every day so the database for the program wouldn't be too hard to find. The third reason is my curiosity; to me learning anything like this is a blast!

For those of you who are using WARP, there is nothing that has to be done to install REXX support, it's installed automatically (unless you specifically choose not to). As for you 2.1 and 2.11 users, aside from the obvious question of why you haven't upgraded to WARP yet, it's an option during the installation, so make sure that it's installed!

In my REXX adventure, I first decided to consult the OS/2 WARP on-line help to see if there was enough info there to teach me anything, and quickly found out there wasn't. So off to the book store I went on a Saturday morning dragging my girlfriend behind me. First it was off to Coles, they have computer books on just about everything--everything except REXX. Sure, they have OS/2 manuals, but the REXX info in them is very limited and I needed a REAL tutorial. Next stop, Crazy Irving's Computer Store, another place with books galore. After searching the store for about 15 minutes, I decided to ask a sales clerk if they had a REXX book in stock, and to my dismay I was told, "Well, we used to have one, but we're sold out and we're not going to be restocking." Hmm, this little venture to get a simple book, was getting harder and harder. So I went to the last store on my list, Camelot. This is THE computer book store in my area; they were guaranteed to have something. I was right, they had something--one old book that was more a history of REXX than a tutorial, and seemed to have been written about 10 years ago. So much for getting a REXX book in the local book stores.

After returning home I decided to search the WWW to see if I could find anything. I found two books, one titled The REXX Cookbook by Merrill Callaway, and the other by Sams publishing called Teach Yourself REXX in 21 days . My searching on the 'net wasn't as fast as I'm making it sound; there are several WWW REXX pages, and it took a little surfing to find one that even mentioned a book. I finally got my hands on The REXX Cookbook and settled down to learning.

One of the first things that I learned was what REXX is. REXX stands for REstructured eXtened eXecutor, and it is an interpreted language as opposed to a compiled language like C, or Pascal. An interpreted language is one that relies on an external DLL or program for its functioning. A REXX program is never *compiled* to an .EXE, or .COM file, its extension is always .CMD. REXX is like Perl in some respects, and has a cult following in much the same way. It was developed by Michael F. Cowlishaw at the IBM UK Labs in 1979, and was used on mostly mainframes and workstations to help perform repetitive tasks. For OS/2, there are two different flavors of REXX, one being the standard text based one, and the other being visual. Visual REXX is much like Visual Basic, in that it's compiled, and requires the use of a DLL to function, so I'm going to leave it to a much later column.

One thing that surprised me, was that REXX isn't just for OS/2; there are versions for DOS, UNIX, and even the Amiga. In fact Amiga REXX, in some respects, has more of a following than OS/2 REXX. A program done in REXX on OS/2 may be run on a UNIX system without many changes. If you don't use operating system specific calls, or extensions, the program need not change at all.

So far I'm on chapter 3 of The REXX Cookbook and it doesn't seem too bad. I must admit that I'm getting a little lost, as the book, even though it claims not to, seems as if it's written for someone who already knows other languages. Callaway, at one point, is explaining arrays (we'll discuss those later too) without telling the layperson what an array is. I also find that the chapters have to be read two or three times before they are fully understood. The book does have some great examples, though, and even comes with an optional diskette containing all the programs used in its chapters. I'll tell you more on what I think of the 'Cookbook' as this column progresses. As for the OS/2 on-line docs, well, they're great as a reference to REXX functions, and have a few examples, but you wouldn't want to use them to learn REXX. Using both the 'Cookbook' and the on-line reference is perhaps the best way to go.

Okay, now that you know who I am and where I hope to be taking this I hope you'll stick around. Any and all comments are welcome, so you experienced REXX coders send in your tips, tricks and suggestions. As for what to expect in upcoming columns, it all depends on what I've learned that month. Keep this in mind though, REXX is somewhat easier to learn than other languages like C, so for the next column I may just have that "one-liners" program done. Don't fret though, I have lots of other ideas.


The REXX Cookbook
Publisher: Whitestone (505) 268-0678
Author: Merrill Callaway
SRP: US$ 27.95 (book and disk US$ 42.90)
ISBN: 0-9632773-4-0
Paul Monaghan is a system operator for ULIX specializing in OS/2. He also maintains a web page on How to make a BBS Telnetable and runs a BBS called Freedom of Speech.

Send a letter to the editor.


Contents | Previous Article | Next Article


This page is maintained by Falcon Networking. We welcome your suggestions.

Copyright © 1995 - 1996 - Falcon Networking