Informing the IBM Community

Can free-form RPG catch on?


Abstract technology background with hexagonal shapes

Ah, my first article for PowerWire! I hope that the editor chose me for my RPG knowledge, not my photo on LinkedIn (go on, take a look).

My experience of RPG goes back to RPG II on the System/36 in the early 1980s. I’m sure a fair portion of you can say you go back further than that. Today, however, I’m going to look at the likely uptake of RPG’s new features.

As you may know, IBM introduced a new free-form RPG twelve months ago on IBM i 7.1 (with TR7) and then IBM i 7.2 with the idea to attract young programmers. So now we can forget all about columns and code where we like.

Well, almost. A free-form statement is coded in columns 8-80. Columns 6 to 7 must be blank. New statements begin with an operation code such as CTL-OPT, DCL-F, DCL-DS, etc. You can also mix, if you want, the new free-form within traditional coding.

There are some caveats. For example, I’m not sure the new programmers will be able to cope with an Input Full procedural (IF) file without thinking it is an IF statement gone wrong!
AY Jan fig1

In addition, be aware that free-form coding cannot be used for programs that use the RPG cycle or traditional I or O specs.

Will RPG programmers embrace this new version? Here are some of the comments I hear when discussing all the variants of RPG:

•    For our many existing programs, having both free and traditional coding in one source is untidy and difficult to read and maintain.
•    Our source control system struggles with traditional coding as it has been customised heavily to suit our company. There is no way it will cope with mixing in the new type.
•    Our company procedures dictate we can only program in free for new developments. With all the cutbacks these days, development projects seem a long way off.
•    Our programs still use the RPG cycle with I and O specs so we cannot use the new features.
•    IBM has not provided any conversion tools to convert our existing code. It did for converting to RPG ILE from RPG/400. There is no budget available for third-party tools to manage this.
•    To distinguish between the traditional and latest version, IBM should have given the new format a new name: Report Program Generator it is definitely not.

There used to be some excellent database banter between younger DDL and older DDS individuals that can easily be related to the debate about using free-format versus traditional methods. It could go something like this:

Young Programmer (YP) – Free format is a lot more readable than fixed format.
Old Programmer (OP) – These eyes can read vertically as quickly as horizontally.
YP – The new format is easier to read and maintain.
OP – We didn’t have the internet to help us back in the good old days and we soon became experts in it. You will too.
YP – We can now use longer field names and procedure names.
OP – I have more chance of a typo with long names. Six characters were ample for a field. What is wrong with PSTDAT? I know it is a posting date field, which is all that matters!
YP – We can mix traditional with new features and enhancements.
OP – Mixing the coding looks a right mess. We older RPG programmers don’t do enhancements.
YP – Finally, RPG looks like other languages.
OP – Being unique, we can command better salaries.

IBM has delivered a cracking job getting this language bang up to date, just as it has done with development tools and Open Access. But, as with those tools, it will take time and many of the traditional programmers will take several years to adopt these new methods.

This enhancement has revitalised the language to bring it up to the hardware’s standard. It sets the system fair for the future and shows IBM’s commitment to it.

However, there are a couple of things that could still improve the experience such as renaming the language something like RPG6, or iRPG (on second thoughts, let’s stay away from anything containing a little i as I’m sure everyone is fed up with their word processors continually auto-correcting it).

Also, providing a conversion tool would go a long way to dragging reluctant users into the light.

Personally, I would love to go to my clients’ sites and see all their applications written in the new format and that they were using the latest development tools. But I won’t hold my breath. Knowing the amount of RPG II coding still in use out there, bringing everyone up to date will be a long and winding road. But take note, RPG programmers: don’t be the next dinosaurs facing extinction.

Andy Youens is an IBM i consultant/instructor at Milton Keynes, UK-based FormaServe Systems

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.