The Future of RPG
The programming workhorse still pulls its weight in the AS/400development environment
by Jim Utsler


IN BRIEF:  As the foundation upon which most AS/400 applicationsare built, and as a potential complement to Java, RPG is here for the long haul.

April'sSexy technologies always make the news. TakeJava*, for example. For the past few years, it has graced the front cover of practicallyevery major technology publication. Innumerable articles have extolled its virtues, andclaimed it can solve almost any programming problem.

And as Microsoft* and Sun* Microsystems clashed regarding Java standardization, evenmainstream newspapers picked up on the battle, casting Bill Gates as the devil in disguiseand Sun CEO Scott McNealy as the favored son.

However, for all the hype devoted to Java, RPG clearly remains the primary programminglanguage for developers writing to the AS/400. RPG isn't sexy and it doesn't get nearly asmuch press coverage as Java does, but it's the rock-solid workhorse on which many in-houseand commercial AS/400 application developers alike depend.

Now in its fourth iteration, RPG echoes the oft-cited strengths of the AS/400 itself:reliability, scalability, and stability--and just about any other "-ability"imaginable.

So when some pundits refer to Java as a potential RPG killer, it leaves lots ofhardcore RPG enthusiasts scratching their heads. According to them (people outside therealm of the media) RPG is as strong a programming language as it has ever been. In fact,it may be stronger than ever, given the growing popularity of RPG IV, which is akin insome ways to Java.

MAKING APPLICATIONS
Sure, Java makes the news, but RPG makes applications. In fact, according to a surveyrecently conducted by MIDRANGE dot COM (www.midrange.com),RPG development is remaining constant even as Java development increases.

Of the 86 individuals who took part in the survey, 37.7 percent indicate they'recurrently developing in RPG IV, and another 26.4 percent in RPG III. Only 5.9 percent saythey're using Java.

And as far as future development goes, while the survey projects a dropoff in the useof RPG III, 15.6 percent say they'll continue to develop applications using it; RPG IV useremains steady (38.7 percent). The number of people who say they'll develop in Java jumpsto 21.2 percent.

Though not strictly scientific, the MIDRANGE dot com survey does make a case that RPGwill remain a primary application development tool well into this new century. And manyprogrammers in the industry who are well acquainted with both RPG and Java support thisstatement.

So what does the future hold for RPG?

THE EXECUTIONER'S AX
Jon Paris, senior consultant with Hal North America, a tools and education group locatedin Toronto, Ontario, Canada, describes Java as a "silver bullet with a point onit." Noting that "it comes a little closer to the mark than any of the otherprevious contenders," Paris makes the point that Java has a chance to eventuallyusurp RPG's position as the primary AS/400 development language.

IBM is squarely in the Java corner, beefing up each release of OS/400* with more Javafunctionality. And, after a slower start than many had expected, Java is beingincreasingly used for the development of enterprise-scale applications. (See the article,"Java's Gift to ERP," in AS/400 Magazine's November 1999 issue.)

With its reliability, scalability, andstability, RPG makes
the perfect back-end application development tool.
and on the front end, or client side, there's Java.

"It won't be forever that people will buy an AS/400 because they learned to writeRPG in school," says Phil Coulthard, AS/400 application development architect withIBM's Toronto development lab. "I think if we are to continue to be successful inattracting new business to the AS/400, I would hope a lot would be due to the Javaapplications and Java programmers we attract to it."

But it's important to note that RPG's death knell has been rung more than once, withfourth-generation languages (4GLs), CASE tools, C, SmallTalk and C++ all, at one time oranother, pegged as RPG's executioner. Yet RPG still thrives.

According to the MIDRANGE dot COM survey, only 11.2 percent of respondents arecurrently working with C and CASE tools, and future development drops off from there, to9.9 percent. But so far, RPG has successfully stayed the executioner's ax.

To its credit, IBM is quick to point out that it's supporting both RPG IV and Java.This dual-language philosophy is to the company's benefit, as it works to maintain itscurrent customer base while bolstering the AS/400's future appeal, as Coulthard indicates.This is being accomplished in part by both incidental and intentional enhancements to RPGIV, which is still a work in progress.

Many of these enhancements, including new op codes, to some degree mimic Javaprogramming functionality. ("RPG IV is closer to Java than RPG III is by a longshot," notes Coulthard.) This will help RPG-trained programmers more easily make thetransition from RPG IV to Java.

"They can learn modern language capabilities such as free format expressions andprocedures, knowing those skills are transferable," explains Coulthard.

Eventually, IBM wants to create an environment in which both RPG and Java can be usedin the same applications, exploiting the inherent benefits of each.

"I think for many RPG shops, this will settle down to RPG being used as the nativedatabase access logic and Java being used as the glue to the client," notesCoulthard, who co-authored the book, "Java for RPG Programmers" with GeorgeFarr, RPG development manager at IBM. "The client would actually be Java server pagesthat would talk to RPG through some code written in Java, called a Java servlet. The newshops and the large shops will turn to Enterprise JavaBeans* for their business logic, buteven these might still use Java for report writing."

HAULING THE COAL
With IBM's support for RPG stated, and because there are so many RPG applications runningon the hundreds of thousands of AS/400s across the globe, it's unlikely that RPG willdisappear anytime soon. As Y2K proved, changing or rewriting billions of lines of code isno small task.

"Look how much went into Y2K date changes," says Eric Figura, BusinessComputer Design (BCD) sales manager. "Look how much cost and effort went into that.It was expensive. Imagine if you had to rewrite everything in Java. It's not realistic.You can't just wish away billions of lines of code."

And, as the saying goes, "If it ain't broke, don't fix it."  Figuracites a recent case in which a customer told him that very thing. "He said thatunless his company is going to make more money changing technologies, there's no goodreason for him to do it. Change simply for the sake of change isn't always needed."

Considered a workhorse of a language, RPG powers more than a few mission-criticalapplications, and with very low overhead. RPG programmers, while in short supply, areavailable to do the work. And because RPG is such a mature and venerable language, there'sa large body of knowledge surrounding it.

Until the current crop of college students graduates, complete with diplomas in handand classroom Java experience under their belts, commence programming in the real world,the AS/400 scales are tipped firmly in favor of RPG. And even after these graduates hitthe job market, programmers with comprehensive RPG skills will still be needed to not onlymaintain current RPG-based applications, but also to develop new ones.

This is in large part due to the possible confluence of RPG and Java, which many see aseventually working in tandem--RPG for one part of the application and Java another, as IBMenvisions.

"RPG is the Mack truck of the programming world," says Paris, co-author ofthe recently released Redbook, Who Knew You Could Do That with RPG IV? A Sorcerer's Guideto System Access and More. "If you want to take it out for a spin on the Le Manscircuit, then it's probably not appropriate. But if you want it to deliver coal from 5,000miles away, it's perfect."

David Gibbs, a senior software engineer with Mortice Kern Systems (MKS), a provider ofAS/400-based change management solutions, agrees. He adds: "When it comes to chewingon the data and writing the reports, I don't think you can find a better language thanRPG."

That's not to say, however, that RPG's not doing some pretty sprightly things. RPG IVis already being used by some developers as a Web programming language, a concept thatmight have been laughable five years ago.

"I know of several large AS/400 Web sites that are powered by RPG IV," saysParis. "There are also several sites where you can get advice on how to webulate yourAS/400 applications."

Out of little more than curiosity, Gibbs, who also runs MIDRANGE dot COM in his sparetime, took it upon himself to develop a prototype Web application with RPG IV. Although itwasn't used for any practical purpose ("In fact," he admits, "I think Ilost the code.") he proved to himself that it was possible to use RPG for thispurpose.

"It took a different mindset," he explains, "because Web apps arestateless. Once I got the hang of it, it wasn't bad."

Until recently, Gibbs, who has roughly 10 years' AS/400-programming experience, hadprogrammed exclusively in RPG. Because of his company's interest in developing Java-basedapplications, however, he's now adding that to his repertoire. And he's seen thedifferences.

"It's like comparing apples and oranges," he says. "Yes, they're bothfruits, but they're different fruits. You can certainly do a lot more with objectorientation with RPG IV, but it doesn't force you to be object-oriented. You can stillwrite purely procedural code in RPG without a problem. With Java, it's very difficult towrite procedural code. It can be done, but the nature of the language kind of forces youinto a more object-oriented perspective."

Coulthard advises users to choose the best tool for the job. For Web site development,that's Java, he says. For batch programs and existing RPG skills, that remains RPG.

THE WORLD EXTENDED
The future of the two languages may be inextricably linked, with RPG doing the grunt workand Java applying a pretty face. RPG may not be used to create full-blown green-screenapplications as in the past, but there will still be a place for it on the AS/400. Withits reliability, scalability, and stability, RPG makes the perfect back-end applicationdevelopment language. And on the front end, or client side, there's Java.

"We see Java's strength being on the client side for delivering better front endsthan the traditional green-screen front end," says Duncan Kenzie, lead softwaredeveloper for BCD. "But on the server side, it's much easier to code in RPG. Codingin Java is much more cumbersome, and access to the database is through a couple layers ofmiddleware, such as Java database connectivity (JDBC)."

Figura sees the future of RPG from the perspective of extensions, meaning extending theuse of RPG applications with, say, Java. With ever-increasing numbers of companies doingbusiness via the Web, it only makes sense to expand the usefulness of RPG applications towork with this new medium.

"How many businesses have Web sites?"  Figura asks rhetorically."It's not a new trend. It's become part of your business. So Java is coming more andmore into play, and what is it being used for? To tap into your system, and what is yoursystem? It's RPG. It's the core of your system."

This trend--combined RPG/Java usage--is likely to continue as increasing numbers ofcompanies venture onto the Internet and dally with intranets and extranets.

IBM supports the notion, indicating that a confluence of RPG and Java will make for astrong development and computing environment. "I don't ever expect RPG to disappearor for the existing customers to go away. Some of them will switch to Java. Some won't.More likely, a lot will use both: RPG where it makes sense and Java where it makes sense.That's really what we're focusing on," explains Coulthard.

Part of this focus includes existing RPG IV function (thread safety) and future support(op codes to call Java from RPG).

A STRONGER FOUNDATION
RPG programmers concerned about losing their jobs and becoming hamburger flippers need notworry. As IBM's Coulthard asserts, "RPG IV is a strategic AS/400 language. It willcontinue to be enhanced to meet customer requirements, and participate in emergingtechnologies." IBM is also enhancing the RPG IV toolset, CODE/400, and VisualAge forRPG.

Learning new skillsets, made easier by the continuing enhancements to RPG IV, maybecome necessary as Java plays an increasingly important role in the computingenvironment, but RPG, as the foundation on which most AS/400 applications are built, ishere for the long haul.

Supporting this notion, Figura says, "Java will simply strengthen the foundation,not create a new one."

Web RPG References:

www.easy400.ibm.it

 www.ignite400.org

  www.bvstools.com

   www.rpgiv.com

--JIM UTSLER  is the associate editor of AS/400 Magazine. He has writtentechnology-related articles for a variety of publications, including Business Week andByte.  He can be reached at jjustsler@aol.com.