A popular development guru, Jon is an IBM Champion and a frequent author, forum contributor, and speaker at User Group meetings and technical conferences around the world, holding a number of speaker excellence awards from COMMON. He is a partner at Partner400 and System i Developer, the organizers of the RPG & DB2 Summit conference. Paris cut his teeth on the System/38 way back when, and in 1987 he joined IBM's Toronto software lab to work on the COBOL compilers for the System/38 and System/36. He also worked on the creation of the COBOL/400 compilers for the original AS/400s back in 1988 and was one of the key developers behind RPG IV and the CODE/400 development tool. In 1998, he left IBM to develop and deliver education focused on enhancing IBM i application development skills with wife Susan Gantner, also an expert in IBM i programming.
January 8, 2020 Jon Paris
This gem of a BIF was introduced with the V7.1 release and so was not available some five years ago when I wrote my original Bevy series of tips. Now that most active development shops are running V7.1 and later it seems a good candidate for a “Classic” to remind readers of its capabilities. The intervening years have not dimmed its utility and it remains one of my all-time favorite BIFs.
Simply put, %ScanRpl will search a target string for a given character sequence and replace it with another. Not only that but it will then continue to search through …Read more
August 14, 2019 Jon Paris
Remember the bad old days when dinosaurs still roamed the earth and the only way to build strings in RPG involved playing silly games with arrays? Or worse still, obscure combinations of MOVE operations? Thankfully those days are far behind us — although sadly there are still a few RPG/400 dinosaurs coding away!
RPG IV introduced many powerful new string handling options, such as the %TRIMx family of BIFs, but even now there are capabilities in the language that few programmers fully exploit. One of my favorites is variable length fields. This lack of familiarity made this tip an obvious …Read more
July 17, 2019 Jon Paris
The history of indicators pre-dates even the earliest versions of RPG and takes us all the way back to the old tabulating machines, perhaps even earlier depending on how broad a definition one uses. What is without doubt, though, is that indicators in the sense of *INnn and *INLR were added to the RPG language as a vehicle for translating those old tabulator board programs.
RPG has grown a lot since those early days, and yet many people still write code using the old-style numbered indicators. LR? Well, we’re kind of stuck with that, but there hasn’t been a need …Read more
June 19, 2019 Jon Paris
Every time I teach some of the more recent additions to RPG, such as XML parsing or Open Access, I find that I need to include some “remedial” education on some of the data definition enhancements that have been made to the language over recent releases.
Most of these enhancements came into the language many years ago back in the days when D-specs were de rigueur, but if you had no immediate need for them, they may have passed you by. After all, even the most avid reader of this newsletter has probably forgotten most of what they read here …Read more
June 3, 2019 Jon Paris
As I’m sure you know by now, IBM recently announced version 7.4 of IBM i. Along with major enhancements such as Db2 Mirror, we also got a number of new RPG features. In this tip I’ll cover those that are already available in 7.3 via PTF. The 7.4-only enhancements will be covered in a subsequent tip.
Before we get into the details of the 7.3 features, just a hint of what is to come . . . 7.4 brings the long-awaited arrival of dynamic arrays known to IBM as varying dimension arrays. No more do you have to compromise between …Read more
May 6, 2019 Jon Paris
I recently wrote a tip on using an Open Access handler to enable the creation of flat files in the IFS. In that version of the handler I generated a generic file name and used hard-coded record delimiters and code page settings. I mentioned at the time that I would normally supply these values at run time. In this follow-on tip I describe how the handler can be modified to use the Open Access User Parameter to facilitate this.
The User Parameter is simply specified as a second parameter to the HANDLER keyword. It can be a simple variable or, …Read more
March 6, 2019 Jon Paris
Author’s Note: I’m revisiting this classic tip since the original was written back in 2009, long before the introduction of free-form data declarations. In addition, I’ve updated this tip to point to the new %SCANRPL BIF, which impacts this scenario. And, of course, I still regularly encounter RPGers who are confused by the differences between the %XLATE and %REPLACE built-in functions (BIFs). Part of that confusion of course is the result of wishful thinking on the part of those frustrated by the limitations of %XLATE!
The first thing to remember when deciding which function to use is that %XLATE operates …Read more
February 13, 2019 Jon Paris
Author’s Note: The reason I chose this particular tip to revisit was that a similar question came up on one of the RPG web forums the other day. The questioner was looking for an easy way to edit a numeric field to include the use of colons as separators. Because the answer involves the use of %EditW I have added a simple example of its use at the end of this tip.
“I need to convert a numeric value into a character string. How do I . . . ?” This question is often asked by RPGers as they face …Read more
February 11, 2019 Jon Paris
Recently I came upon a couple of questions on internet lists asking for an easy method to create flat files in the IFS. Not CSV files, but rather simple text files where individual data items are in fixed character positions. Various somewhat convoluted solutions were offered to the requestors, but to me this problem shouted “Open Access!”
So, I set about quickly building an Open Access (OA) handler to perform the task. I find OA really useful for this kind of job because, once the handler is written, creating these kinds of files in the future become a trivial task, …Read more
January 16, 2019 Jon Paris
Many RPG programmers seem to get confused about the usage and operation of a number of built-in functions (BIFs). In particular the BIFs %XLATE, %REPLACE, %SCAN, and %CHECK seem to cause a lot of confusion. In this tip, I focus on %CHECK and %SCAN. I decided to re-visit this particular tip because of the recent introduction of %SCAN’s companion BIF %SCANR and a related enhancement to %SCAN itself. More on this later.
The %SCAN BIF has been with us since V3R7, when it was introduced along with %EDITC and %EDITW, to improve string handling. %CHECK, on the other hand, is …Read more