PowerWire.eu

Independent IBM i, AIX and Linux news and tech tips for Europe and beyond

  • Home
  • News
  • Technical Articles
    • IBM i
    • AIX
    • Linux
    • VIOS
  • Subscribe
  • About Us
  • Contact Us
  • Advertise with PowerWire.eu

RPG 2017 Updates

February 24, 2017 by Andy Youens

RPG 2017

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.  IBMs RFEs can be seen on the DeveloperWorks website, which can found here.

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.

AY Feb17 01

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

AY Feb17 02

 

New %Max and %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.

AY Feb17 03

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 we can help.

I’m looking forward to the next round of the i-UG user group meetings this year in the UK.  Hopefully we can meet up at the Rochdale and London events in March.  Full details can be found on the iUG site here.

Andy Youens is an IBM i consultant/instructor at Milton Keynes, UK-based FormaServe Systems.

Filed Under: IBM i, Technical Articles Tagged With: IBM i, IBM Power Systems, RPG, system management

Signup

News

Node.js v20 on IBM i

It is time to get back to Node.js on the IBM i.  Node.js v20 is the latest version of this great … [Read More...]

A screen a story – Pre-power down system exit point?

The Exit point functionality available within IBM i, is what I would call a hidden gem. If we just look at the … [Read More...]

Calling app owners and developers!

LANSA engineers are showcasing the LANSA repository in a series of 30-minute webinars. It may be the solution … [Read More...]

More articles from this section

Quick Links

  • Advertise
  • Subscribe

Follow Us…

  • Email
  • LinkedIn
  • Twitter

Search This Website

Copyright © 2023 · Cue Communications · All Rights Reserved

Log in