RPG 2017 Updates
Introduction
During the latest round of IBM i Technology Refreshes, TR2 for version 7.3 and TR6 for version 7.2 enhancement, IBM also introduced three enrichments for RPG.
These changes will be released as individual PTFs, around the April 2017 timespan, as with the Technology Refreshes.
Let us take a look at these.
These are:
- Nested data-structures
- New %Max and %Min built in features
- Align(*Full) Keyword
Each of these new features came through the RFE (Request for Enhancement) route, which shows how worthwhile this process is.
Let me go through each of these new changes.
Nested data-structures
The first one on the list, the nested data-structures is a very useful feature that allows many data-structures to be encompassed within another data-structure.
In the figure below, we can see that we can now hold customer details for both the billing and the shipping addresses all incorporated within the main customer data-structure.

We can see in the figure below how we populate these embedded fields.

New %Max & %Min built in features (BIFs)
These two new built in functions will return a value from a set of arguments.
The %Max function will return the maximum value from a set.
And to follow on, %Min will return the minimum value out of a set.
There is no maximum number of arguments it will test, but obviously there must be at least two.
How many of us have been coding this functionality in a subroutine, you are not alone, a useful addition IBM.
We can see both these built-in functions in use below to determine the oldest and youngest dates.

Align(*Full) Keyword
The new keyword option Align(*Full) for data-structures, is a requirement when calling certain C functions from within RPG.
Without this new keyword, RPG data-structures are smaller than the C structures, which can cause memory issues.
Conclusion
With all the euphoria about Open Source on our favourite server, its great to see IBM still looking to enhance their main programming language.
Thanks to Barbara Morris at IBM for the heads-up on these enhancements.
If you have any questions concerning RPG, please get in touch, I'm sure PowerWire can help.