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.
August 1, 2018 Jon Paris
Author’s Note: The original version of this article was written in the V6 timeframe and included references to V5R4. References to the V5R4 limitations have been removed from this updated version. I have also updated the data definitions to take into account RPG’s ability for the direct coding of nested data structures rather than having to use LikeDS as before.
RPG IV’s built-in XML support has been available for some time now, having been originally introduced with V5R4 back in 2006. However, it wasn’t until the advent of V6 with its removal of many of RPG’s size limits that it …Read more
June 18, 2018 Jon Paris
In this tip I’m going to give a brief introduction to the latest addition to the RPG language. The new DATA-INTO op-code. DATA-INTO is IBM’s response to the oft-asked question: “When is IBM going to introduce JSON-INTO so we can process JSON as easily as XML?”
DATA-INTO provides this capability, but IBM has very cleverly given it functionality that goes way beyond what a simple JSON-INTO op-code could ever have done. DATA-INTO is effectively a cross between XML-INTO and Open Access. Like XML-INTO it uses the names of items and their hierarchy to unpack the document into RPG variables. Like …Read more
April 9, 2018 Jon Paris
From time to time, many of us have to find solutions for handling our old non-normalized tables in an efficient manner. It would be nice to have the luxury of redesigning and normalizing these databases, but real life is not like that. This is particularly true when the tables in question are part of an application package where you have no control over the file layout.
I should point out that by “efficient” in this context I don’t necessarily mean processing speed, but rather in terms of the number of lines of code needed to perform the necessary manipulations and/or …Read more
March 5, 2018 Jon Paris
In my previous tip, , I looked at how the qsort API can be used to sequence data in ways that SortA can’t begin to approach. Now that the data is sorted, one of the things I may want to do with it is to search it. In this tip I will look at how that can be achieved using the bsearch API. The approach I will be discussing allows for partial key searches and handling the fact that such a search may result in multiple hits.
As you will see when we work through the code, …Read more
January 29, 2018 Jon Paris
In an earlier tip, Teraspace To The Rescue, I discussed how to use teraspace in RPG to permit the storage and manipulation of data that requires more storage than RPG’s 16MB limit. In this tip I am going to discuss how such data can be sorted. Hint: SORTA won’t work!
Before I get to that though, there is one thing I should mention. In that original tip I said: “For reasons I have never understood, DEALLOC will not null your pointer. So it is a good idea to do it yourself. . . .” IBM’s Barbara Morris pointed out, …Read more
August 14, 2017 Jon Paris
My team has been trying to resolve a problem for the last few weeks and they are running into several obstacles. The main one has to do with RPG restrictions for data structure length.
We use a third-party program to process transactions. In the latest version, the vendor has increased the length of the fields in the data structure that we have to pass them. After our programs were changed to accommodate this increase, the RPG program would not compile because the DS exceeds 16,733,104 bytes. The vendor has told us to use teraspace but by itself that …Read more
July 24, 2017 Jon Paris
In my series on parameter passing fundamentals, I mentioned the importance of using prototypes to help ensure consistency of parameter definitions; i.e., to help ensure that the parameter passed to the called routine matches what is expected. After that article was published, it came to my attention that many of my readers were unaware of some of the additional capabilities of prototypes, in particular that prototypes can not only identity errors in parameter usage, but that in some cases they can actually fix them for you!
Before we can begin, though, it would be a good idea to ensure that …Read more
March 13, 2017 Jon Paris
From time to time somebody will recommend an application to me and it sounds really useful – until I discover that it is Windows Only. Whenever that happens I usually go to one of the Alternative To websites, such as AlternativeTo.net, to see what I can find.
Recently I was asked if there were any alternatives to SEU by a programmer who wanted to use fully free RPG and was tired of the green screen blobs all over his code. (See the example below if you don’t know what I mean by this.) This was a topic that …Read more
February 20, 2017 Jon Paris
In my earlier tip, Fundamentals: Parameter Passing, I discussed the basics of parameter passing and the importance of ensuring that parameter lengths and data types match those expected by the called routine. In this tip I want to go one step further and discuss differences between passing parameters to programs and to procedures.
Let’s start with passing parameters between programs. In particular, I will focus on the impact of passing fewer parameters than the called program is expecting because this is one area in which programs and procedures differ, and a failure to understand that can lead to some …Read more