Friday, November 03, 2006

RPG on the AS/400 - do you /FREE?

Programming on the AS/400? Still using RPG III? Or even RPG II? Good grief, it's time to step up to the 90s already.

RPG IV has been available now for over a decade yet I'm still running into folks that not only won't touch RPG /FREE but not even RPG IV. What's not clear is what's scaring them off.

Finding myself in the fun position of having to right programs from scratch, I've been able to dive right into /FREE on them.

Let's see...
fileKy PLIST
PARM Group
PARM Branch

fileKy CHAIN myFile 97
.... ...

Chain (Item: Group: Branch) myFile;
If %found;
.... ...

You tell me which is easier.

One of the other benefits is procedures. Procedures allow for the use of internal subprocedures and external modules. This allows the use of data and functions to be encapsulated and reused/shared.

For example, if you frequently have lookups against an item file, you can package that bit of code into a procedure and make it accessible to any program that needs it.

In the latest iteration of /FREE, you can even make use of a variable number of parameters, including *NULL value parameters. This will allow for even more abstraction in procedure use.

Well, I'm not going to point any fingers, but you know who you are. Get out there and code some /FREE. And don't let yourself off the hook with the old excuse of not having time. Heck, just dig in next time you have to write a program from scratch on the AS/400.

Oh yeah, another bonus is the interoperability with the other ILE languages, including shared module use.

A practicing coder,

No comments: