MC Press Online

Friday, Jun 23rd

Last updateFri, 23 Jun 2017 1pm

You are here: Home ARTICLES Programming RPG Modern Tools for Today's RPG Programmer

Programming / RPG

Modern Tools for Today's RPG Programmer

Support MC Press - Visit Our Sponsors


Flexible Input, Dazzling Output with IBM i



Click for this Month's

Bookstore Special Deals

Are you aware of the free (and nearly free) tools that are available to enhance modern RPG application development?


Over the last few months, I have spoken at a number of conferences across North America and have just completed System i Developer's first European RPG and DB2 Summit event, which ran in partnership with COMMON Europe. One common thread that emerged from discussions with attendees at these events was a lack of awareness of many of the "modern" things that can be achieved by today's RPG applications. As a result, I decided that in this column I would briefly cover some of the tools, etc. that have piqued my interest in recent years. Since I don't want to turn this into some kind of glorified commercial, I have decided, for the most part, to stick with those options that are free of charge. As you might expect, the vast majority are Web-related, and even a cursory review will demonstrate to you the types of advanced applications that are being developed by the "i" community these days.


I've written many times over the years about IBM's CGIDEV2 library and how it can be used to easily create RPG-based Web applications. (If you are still unfamiliar with the tool, check out the Easy400 Web site for details, tutorials, demos, and more.) The only problem with CGIDEV2 is that IBM has largely ignored it since taking back responsibility for its development, and as a consequence, it hasn't seen many upgrades. It still provides a solid foundation and has the advantage of coming complete with source code so you can enhance it yourself if you wish, but there is little in the way of sessions support and nothing to directly support the development of Web 2 applications. In other words, it has none of the pieces that are essential to modern Web development. That's where Renaissance comes in.


Originally developed by the UK's CoralTree Systems for their own use, Renaissance was subsequently released as open source. It is a framework consisting of RPG subprocedures, JavaScript, and HTML that extends the CGIDEV2 tools to provide a complete AJAX-enabled rich Web environment, including full drag-and-drop support. The software is available free of charge under the open source Mozilla Public License (MPL), which means that even if you develop software for sale using these tools, there are no royalty or other fees to pay--just a requirement that you report any bugs that you fix. If you want to get a feel for the kinds of interfaces that can be built with Renaissance, check out the demo pages; there's a lot of stuff there, and many of the pages follow the lead set by Easy400 and allow you to view the actual RPG source behind the code that you are running.


It would have been nice if IBM had done this or even released CGIDEV2 to open source so that some of these facilities could have been built into the base code, but, hey, I guess there's still time for IBM to wake up and smell the roses. In the meantime, I suggest you take a look at this interesting project.


Since we've been talking about CGIDEV2 and open source, I would be remiss if I failed to point out that the creator of the Easy400 Web site (retired IBMer Giovanni Perotti) has been providing open source utilities for many years. They range from tools to assist in securing Web sites, to tools to allow RPG programs to send emails. You can find out all about Giovanni's tools by going to the Deliverables page of the Easy400 Web site referenced above.

Supplying and Consuming Web Services

One of the fastest-growing trends in "i" applications these days is the use of Web services. Let's start by looking at the consumption of Web services. These days, whether you want to track the status of a FedEx or UPS delivery, look up a postal code, get a current exchange rate, or simply check out the value of your stock portfolio, Web services are the answer. If you want to explore this area for your own applications, you would do well to start with the HTTP API, which you can find at Scott Klement's Web site. This powerful set of subprocedures allows an RPG program to easily access a Web service and (by virtue of Scott's port of the Expat XML parser) to parse out the data contained in the response packet, even on pre-V5R4 systems, where there is no direct support for XML processing. While there is no tutorial or formal documentation for the project, Scott has provided many sample applications in the package, and the support forum for the tool is a great source of information. Scott has a number of other projects on his Web site, including the FTP API, which allows for FTP file transfers under program control.


It is interesting to note that, like some of Scott's other work, this one has spawned some associated projects that build upon the capabilities of the original tool. In this case, Thomas Raddatz, via his Tools400 Web site, is making available his WSDL2RPG tool, which further simplifies the use of Scott's HTTP API by automatically generating the RPG code to build a Web service client module from the Web service's WSDL file. If it got much easier than this, the program would write itself!


Of course, supplying Web services has been possible for some time since they can be constructed using the standard Apache Web server and any CGI technology (for example CGIDEV2) that you care to use. However, it can be a daunting task. So I was delighted when IBM recently announced the Integrated Web Services Server for ILE, which purports to simplify the whole process for RPG and COBOL users. This technology is available both on V5R4 and V6R1 systems, and although I have not had a chance to work with it yet, judging from the IBM Web site, it should certainly simplify the process of deploying RPG and COBOL programs as Web services.


I wish I could say the same about the Web service client side of things...but I can't. Why? Because IBM has demonstrated once again how completely clueless they can be when it comes to their user base by providing all the examples in the Web Services Client for ILE manual in those most popular and widely used of the "i" languages, C and C++! Did nobody at IBM notice that Scott Klement's software has been used for this purpose for several years? And not only are his examples in RPG, but the tool itself is written in RPG! IBM had a wonderful opportunity here, and it seems to me that to date they have blown it. Why, oh why, do they continue to provide examples in languages that only tool builders use? People who by virtue of their backgrounds might reasonably be expected to be able to understand the technology without too much help anyway! At the COMMON Conference in Nashville, Dan Hiebert of IBM presented on this tooling and supplied examples in RPG, so why are they not in the book?



Email and More

Another site that supplies open-source utilities is Aaron Bartell's Aaron's current projects include RPHMailv2, which is a series of RPG wrappers for the JavaMail APIs from Sun; RPG to Desktop, which allows any PC application to be directly invoked from an RPG program; and RPG Chart Engine, which wrappers APIs from to allow an RPG program to generate pie charts, bar graphs, and more. There are other tools on the site, but these are the three that most appeal to me. Aaron's focus, like Scott's, is on taking tools available in the wider, open-source world and making them accessible to the RPG community.


The RPGMailv2 tools are probably the most useful to the majority of "i" shops and allow you to format and send emails, complete with attachments, to any number of recipients. Because of the way that JavaMail itself works, all of this can be done without the necessity to configure an SMTP mail server on the "i" itself, something that is often a stumbling block for "i" users who are overburdened with misinformed security restrictions.


Take a look at Aaron's offerings. I'm sure you'll find something to interest you.

Bridging the Gap

Since we are talking (mostly) about Web-oriented offerings, I must just mention one for-fee offering that has attracted my attention of late: Zend Bridge. The Bridge allows PHP applications to interact with a 5250 session and to reface or repurpose that application. For example, it could be used to allow a 5250 app to be treated as a Web service! Now that offers some interesting possibilities. It can also be used to blend--in a portal, conventional Web app, or mash-up context-- several 5250 sessions into a single user interface. Right now, the Bridge is really not much more than a set of APIs waiting for some good tools to help automate the transition process, but hopefully we will see those emerge over time.


The one problem I have with Bridge concerns Zend's deployment policy. I know they need to make money, but restricting Bridge to the chargeable Zend Platform, rather than allowing it (as they did with the beta version) to work on the Zend Core version that is available free to all "i" shops at V5R3 and later is, I believe, a serious mistake on Zend's part and one that may well keep the usage of Bridge from achieving critical mass. Hopefully, Zend's policy will change, and they will make Bridge available to Core users, if only for exploratory usage. Alternatively, making it available as a for-fee addition to the free Core offering would also be a good start.

So Many Tools, So Little Time


That's it for this all-too-brief review of some of the advanced tools available to today's RPG programmer. Perhaps in the future we can focus on some of these in more detail. In the meantime, if you know of any tools that I have missed or would like to share your experiences about those listed, either email me directly or post a note in the forums associated with this article.

Jon Paris

Jon Paris's IBM midrange career started when he fell in love with the System/38 while working as a consultant. This love affair ultimately led him to joining IBM.


In 1987, Jon was hired by the IBM Toronto Laboratory to work on the S/36 and S/38 COBOL compilers. Subsequently, Jon became involved with the AS/400 and in particular COBOL/400.


In early 1989, Jon was transferred to the Languages Architecture and Planning Group, with particular responsibility for the COBOL and RPG languages. There, he played a major role in the definition of the new RPG IV language and in promoting its use with IBM Business Partners and users. He was also heavily involved in producing educational and other support materials and services related to other AS/400 programming languages and development tools, such as CODE/400 and VisualAge for RPG.


Jon left IBM in 1998 to focus on developing and delivering education focused on enhancing AS/400 and iSeries application development skills.


Jon is a frequent speaker at user group meetings and conferences around the world, and he holds a number of speaker excellence awards from COMMON.