With the advent of IBM i Technical Refresh 7 (TR7) earlier this month, IBM announced the first substantial changes to the IBM i’s RPG compiler in nearly 14 years. With TR7, ILE RPG acquired free-format for all specification types except I and O specs (which have all but been deprecated in ILE RPG anyway). The figure below shows a snippet of how a full free-format ILE RPG will look:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
ctl-op bnddir('ACCRV'); dcl-f custfile usage(*update); dcl-ds custDS likerec(custRec); dcl-f report printer; read custfile custDs; dow not %eof; if dueDate > %date(); sendOverdueNotice(); write reportFmt; exec sql insert: name, :duedate into mylib/myfile; endif; read custfile custDs; enddo; inlr = '1'; dcl-proc sendOverdueNotice; /copy invoices sendInvoice(custDS : IS_OVERDUE) end-proc; |
It’s great that RPG is finally getting this enhancement. In the mid 90s, I sat in a meeting in Toronto where a bunch of IBMers and a group of fixed-format aficionado’s hands-down ruled out a full free-format syntax for ILE RPG. They told a small group of coders arguing for free format ILE RPG that the effort would be a waste of time and that RPG programmers simply wouldn’t get it–that they would certainly reject such a feature. It’s gratifying to see, quite nearly 20 years later, that at least IBM is now willing to give RPG coders a) the benefit of a doubt and b) a choice.
IBM’s motivation for this enhancement seems a little slippery. IBM’s primary driver for RPG’s new free-format syntax is to make RPG easier for C+, C, Java (and other curly brace languages) to embrace. Facing a decline of available RPG programmers, IBM hopes this free-format move will make it easier for IBM i shops to bring programming talent into the IBM i fold. I’m skeptical. I strongly suspect that the curly brace language crowd’s RPG derision isn’t just aimed at its syntax, but its model in general. And beyond that, where do C++, C, and Java programmers go to learn all the nuances and idioms, not to mention the syntax of RPG? Just the opposite seems true to me: that using this new syntax will make learning curly brace languages easier for RPG programmers (if there are even any left without curly brace experience now).
There is an interesting, but ominous part of the announcement that has the potential to dramatically affect the adoption of Toronto’s free-format syntax: you have to pay for the tool to convert existing ILE RPG into the new syntax. The entry cost is $5000 US dollars for the first 1000 programs. Curiously, this makes it seem that shops with 1000 300-line programs will pay the same to convert those programs as shops with 1000 30,000-line programs. On top of that, after 1000 programs, you’ll pay another $5K! Does this mean that a shop with 998 programs pays $5K but shops with 1002 programs pay $10K? Oh, and one more thing: this conversion process doesn’t have a 100% conversion rate. Its conversion is quite high, 99.95% is claimed, but that does mean you’ll likely have some code remediation to do by hand. IBM’s impeccable marketing logic seems alive and well on this project!
In the end, I don’t really care what IBM’s motivations were, I’m just glad RPG is finally free! ASNA Mobile RPG empowers RPG coders to create great smartphone and tablet apps with RPG, and my column-oriented RPG programming skills are rusty to say the least. I am especially encouraged to see what I think is a vastly improved way to code RPG procedures with this new syntax.
For us at ASNA, we know RPG coders can learn, and quickly love, an expressive, modern RPG syntax. Our customers have been using a similar (but, if I may say, dramatically cleaner and simpler) syntax in ASNA Visual RPG since 1994! We think the rest of the world (except for the occasional grumpy RPG coder–you know who you are!) will join us in our praise of this improved RPG.