• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru Classic: A Bevy of BIFs, %XLATE and %REPLACE

    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
  • Guru Classic: Triggers – Allow Repeated Change

    February 13, 2019 Paul Tuohy

    Author’s Note: This article was originally published in November 2013. This has always been one of my favorite techniques for data modernization. I only wish I had thought of it back in the days of Y2K! The content of the article has been updated for free form RPG and some of the coding enhancements that have been introduced into RPG since 2013. 

    Recently, during a modernization project, I have been making use of the Allow Repeated Change (ALWREPCHG) option with before triggers. ALWREPCHG allows a before trigger to make changes to the record being inserted or updated, and that lets …

    Read more
  • Guru Classic: Who Needs Custom Perspectives In RDi?

    February 13, 2019 Susan Gantner

    I often talk to people who are confused about RDi perspectives, so I thought this two-part series on why and how to create and use your own custom perspectives would be a good one to update. Very little has changed since the original publication of this first part, but I’ve updated the screen shots and addressed one or two small differences in recent releases. This version assumes you are running at least RDi 9.5

    Who needs custom perspectives in RDi? Just about everyone. At least everyone could probably benefit from them. As you know if you’ve read my earlier tips, …

    Read more
  • Guru Classic: A Bevy of BIFs — %CHAR, %EDITC and %EDITW

    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
  • Guru Classic: Automatic Or Static Storage?

    January 16, 2019 Susan Gantner

    Author’s Note: This tip was first published in August 2008. One thing that has changed in the intervening 10-plus years is that I find a lot more RPGers regularly using subprocedures now. Something that hasn’t really changed much is that many of those using subprocedures still don’t fully understand the behavioral differences between automatic and static storage. The concepts and handling of automatic versus static storage haven’t really changed. So the only modifications I’ve made for this reprise of the tip is to update the style of the code example.

    If you write RPG subprocedures, you should know about the …

    Read more
  • Guru Classic: A Bevy of BIFs – %SCAN and %CHECK

    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
  • Guru Classic: Call Again And Again And Again . . .

    January 16, 2019 Paul Tuohy

    Author’s Note: This article was originally published in October 2011 and recently came to mind when I had a discussion with a programmer bemoaning the fact that he could not (so he thought) have a recursive process in RPG. The content of the article has been updated for free form RPG and some of the coding enhancements that have been introduced, into RPG, since 2009. 

    In programming terms, recursion is the process whereby a function may call itself. Traditionally, this is something we are not used to in RPG. Programs and subroutines cannot call themselves. Or if you did somehow …

    Read more
  • Guru: RPG Sorting and Searching, A 7.2 Update

    September 5, 2018 Susan Gantner

    Author’s Note: This is the second update I’ve done to a tip I originally wrote back in 2008. In 2010, I updated the code to use SORTA with array data structures. Here in 2018 I’m updating it once more — this time to use free-form declarations in place of the D specs, including a more obvious way to code the nested data structure used in some of the examples and references to more recent tips for handling very large arrays. The 2010 version was entitled “. . . A 7.1 Update.” I’ve renamed this one as “. . . A …

    Read more
  • Guru: An Introduction to Processing XML With RPG, Part 3

    September 5, 2018 Jon Paris

    Author’s Note: In part 1 and part 2 of this XML series, I introduced you to the basics of using RPG’s XML support. In this tip we begin to explore some of the challenges that you may face when processing commercial XML documents, and the support XML-INTO offers to handle them. In particular we will be reviewing how to ignore parts of the document through the use of the path= %XML option. We will also review how to handle XML documents that make use of namespaces and how to handle XML element names that include characters that are not valid …

    Read more
  • Guru: Handling Constraint Violations In RPG

    September 5, 2018 Paul Tuohy

    Author’s Note: The contents of this article were originally published as two separate articles – Handling Constraint Violations in RPG and Handling Constraints Revisited. The content of the article has been updated for free form RPG and some of the coding enhancements that have been introduced, into RPG, since 2009.

    Constraints have been around for a long time but apparently have not quite made it into every programmer’s tool kit. This is partly explained by the fact that implementing constraints in an existing application can be tricky, but it doesn’t explain why constraints are not used extensively in new …

    Read more

Previous Articles Next Articles

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • With Power11, Power Systems “Go To Eleven”
  • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
  • Izzi Buys CNX, Eyes Valence Port To System Z
  • IBM i Shops “Attacking” Security Concerns, Study Shows
  • IBM i PTF Guide, Volume 27, Number 26
  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle