POWER > Business Strategy > Modernization

DATA-INTO and Upward Compatibility Contribute to RPG’s Longevity

DATA-INTO and Upward Compatibility


IBM workhorse RPG turns 60 next year. And while many languages have come and gone over the decades, RPG shows no signs of fading out, being as relevant today as it was when it was introduced with the IBM 1401 in 1959.

Highly Relevant and Hugely Successful

It’s natural to seek to quantify the success of RPG by number of clients and lines of code. According to Jon Paris, an RPG expert and cofounder of the RPG & DB2* Summit, there’s no hard data on how much RPG code is “out there.” But he did say this: “There are millions and millions of lines of code. RPG has been around a long time and has evolved over the years. It has been used on mainframes, midrange, micro and PC systems from many manufacturers. Just like COBOL (for example), programs are still running today that can trace their ancestry back 40-plus years.”

RPG’s reach spans numerous industries and major corporations—including extensive use in banking, distribution, healthcare systems, transportation and hospitality, according to Paris. He cites that many casinos (particularly in Las Vegas) use RPG-based code for their registration and front-of-house systems.

Interested to learn how IBM has kept RPG relevant and how it plans to keep the language relevant moving forward, IBM Systems Magazine, Power Systems edition interviewed RPG compiler team leader Barbara Morris.

Morris began her career as a professional musician, teaching and playing the cello. Like many musicians, Morris discovered she had a mathematical bent and began pursuing a second degree in physics. A FORTRAN course changed her mind about physics and Morris found herself majoring in computer science. Coursework toward her degree led her to IBM in 1989, Morris explains. “During my comp sci degree, I took a couple of courses in compiler construction and when IBM offered me a job working with the RPG compiler, I jumped at it even though I couldn’t even spell ‘RPG.’ ”

Nearly three decades later, Morris continues her work in the RPG compiler department. Her responsibilities have increased from “doing little enhancements” like adding ENDIF and ENDDO to the RPG compiler to gradually being involved in some way in every enhancement—either in designing, coding or testing—to her current role as the team leader for the RPG compiler team.

Reaching New Heights of Data Integration

IBM recently introduced DATA-INTO, a new RPG feature. The feature is a good example of keeping the language relevant. While RPG has its roots in its initials, Report Program Generator, today, RPG is a modern business language with a much broader scope than just report writing. In our increasingly data-driven world, modern languages must be able to ingest data encoded in different formats.

For some time, RPG has supported the reading of XML files through its XML-INTO opcode. As new document standards were introduced, the RPG development team found itself fielding requests to develop opcodes like CSV-INTO and JSON-INTO. The team quickly realized it would be a never-ending task to support all current and future document formats.

The answer: to provide a general framework for current and future developers to parse documents with arbitrary formats. That led to the general opcode DATA-INTO.

“Changes to RPG don’t require RPG programmers to make changes to their existing programs. Upward compatibility is fundamental so that we never make it required for customers to either change their existing source or even recompile their programs.”
—Barbara Morris, RPG compiler team leader

DATA-INTO reads a file of a given format and inserts the contents into a data structure that can be processed by the RPG program. But unlike XML-INTO, which comes with its own parser to read XML files, DATA-INTO leaves the parser development to the programmer.

This may seem like a huge burden but the RPG community has stepped in to lighten the load; community members have already introduced JSON and CSV parsers. Prominent RPG community member Scott Klement has written YAJLINTO (bit.ly/2tNvTRo ), a DATA-INTO parser for JSON, and Paris has written a CSV parser provided for DATA-INTO (bit.ly/2IAHWa0 ).

More Ingredients of RPG’s Success

DATA-INTO is the most recent example of keeping RPG relevant, but it’s not the only one. Steeped in the DNA of the IBM i OS since its early days is a core feature: upward compatibility. “Changes to RPG don’t require RPG programmers to make changes to their existing programs. Upward compatibility is fundamental so that we never make it required for customers to either change their existing source or even recompile their programs. Everything just continues to run forever as it is,” Morris explains.

As evidence to that fact, she cites how a client can take a program that was compiled for the System/38 in 1979 and restore it on a current IBM i system. Upward compatibility keeps legacy code relevant, and very few languages can make the claim that code written in an old release will still run today.

Morris delights in sharing about RPG’s roots as a business language. “Programmers find it very easy to do I/O either using the record level access or using the wonderful integration we have with SQL for database files,” she says, citing the ease of data calculations and support for working with dates, times and timestamps.

“Support for working with strings has also matured, Morris adds. “You once had to write quite icky code, but over the years, a lot of new functions have been added that at this point, it’s very easy to do most string processing.”

Moving beyond its roots in punch card programming, RPG has evolved to allow free form code that isn’t confined to the original rigid column-restricted formatting. Further modernization came when RPG introduced prototypes, which provide access to the C runtime libraries, effectively making most of the C language and its functions available to programmers. Qualified data structures, which allow two fields to share the same name because each field is qualified to its parent data structure, was another step forward for the language. And, to extend RPG’s reach to web services, printers, smartphones and other devices, IBM added an Open-Access feature to the language.

Toward a Bright Future

Looking to the future, the RPG team is working hard to meet user requests. For example, programmers have requested polymorphism, a feature that allows two procedures to have the same name but different parameters. That request comes from programmers who would like to see RPG be more object-oriented. Deeper integration with SQL, particularly around handling null-capable fields, is another feature of interest. And, while string handling is very solid now, IBM is fielding requests to extend its capabilities.

As of July 2018, nearly 100 RPG requests for enhancement were listed at ibm.biz/rpg_rfe. The developerWorks community is encouraged to vote for their favorites and members can follow the requests and votes. Morris is also very active on the IBM community site, lending a hand to new and not-so-new community members who need a little help with RPG’s existing features (ibm.co/2tUk7Vw).

RPG has stood the test of time. Upward compatibility has been a tremendous factor in keeping the language relevant and helping the language withstand the test of time. Unlike many other languages, RPG programmers don’t need to worry that the next update or release will back them into a corner and force them to rewrite code.

Integration with C via prototypes was another strategic win for RPG. And access to devices and web services via Open Access was yet another win. Today, RPG maintains its firm foundation as a solid business programming language while simultaneously being flexible enough to integrate with external devices and services—and that’s no small feat.

Sol Lederman is a freelance technology writer based in Santa Fe, New Mexico.


comments powered by Disqus

Advertisement

Advertisement

2018 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.

POWER > BUSINESS STRATEGY > MODERNIZATION

5 Lessons from 25 Years on IBM i

POWER > BUSINESS STRATEGY > MODERNIZATION

7 Keys to Future-Proofing Your RPG Applications

POWER > BUSINESS STRATEGY > MODERNIZATION

Administration Modernization Promotes Productivity

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store