• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: RPG’s New %INFO BIF. Is It Time to Retire the SDS?

    November 30, 2026 Gregory Simmons

    If you’ve been developing RPG applications for any length of time, chances are you’ve used the Program Status Data Structure (PSDS) or, as many of us simply call it, the SDS.

    Need the current program name? Check the SDS. Need the job number, user, or job name? The SDS has you covered. And when something goes wrong, it can provide helpful details about the program’s status and the location of an exception.

    But with the latest round of RPG enhancements announced alongside IBM i 7.5 Technology Refresh 9 (TR9) and IBM i 7.6 TR3, IBM has introduced a new built-in function, %INFO, that retrieves much of this same information without defining a data structure.

    Before we ask IBM Bob to replace every SDS in our source libraries, let’s take a look at what %INFO offers and whether our trusty old friend is ready for retirement.

    Our Trusty Old Friend, The SDS

    Suppose we’re working on one of our mushroom applications and want to identify the program and job currently running. For decades, we’ve accomplished this with a Program Status Data Structure:

    **free
    ctl-opt dftactgrp(*no);
     
    dcl-ds SDS psds qualified;
       ProgramName char(10) pos(1);
       JobName char(10) pos(244);
       JobUser char(10) pos(254);
       JobNumber char(6) pos(264);
    end-ds;
     
    dsply ('Program: ' + %trim(SDS.ProgramName));
    dsply ('Job: ' + %trim(SDS.JobNumber) + '/' +
           %trim(SDS.JobUser) + '/' +
           %trim(SDS.JobName));
     
    *inlr = *on;
    

    Nothing particularly exciting here. We define the subfields in the SDS using their positions and reference them whenever needed.

    But those positions aren’t especially meaningful. Why does the job name start at 244 and the job number at 264? Most experienced RPG developers have a copy member containing these definitions rather than memorizing them.

    What if we could retrieve the same information without defining a data structure or remembering those positions?

    Meet The New Kid On The Block

    With %INFO, we can simply ask for the information we need:

    **free
    ctl-opt dftactgrp(*no);
     
    dsply ('Program: ' + %trim(%info(*PGM)));
    dsply ('Library: ' + %trim(%info(*LIB)));
    dsply ('Job: ' + %trim(%info(*JOB)));
    dsply ('User: ' + %trim(%info(*USER)));
     
    *inlr = *on;
    

    No data structure definitions or hardcoded positions, but fewer lines of code aren’t the biggest advantage.

    IBM points out that the PSDS is initialized during the *INIT phase of the RPG cycle. Consequently, certain information in the PSDS can become outdated while the program continues running.

    For example, %INFO(*PGM) retrieves the current program name, even if the program has been renamed since the PSDS was initialized. Similarly, %INFO(*LIB) retrieves the current library, even if the program has been moved.

    And %INFO(*USER) returns the current user profile, which might differ from the value captured earlier in the PSDS.

    This matters particularly in long-running applications, where a program might remain active for hours or days.

    One related detail is worth noting. Our SDS example retrieves the job user from positions 254 through 263, while %INFO(*USER) retrieves the current user profile. The corresponding PSDS field for the current user profile is at positions 358 through 367. A profile swap can cause the job user and current user to differ, so those fields aren’t necessarily interchangeable.

    More Than Just a Replacement

    IBM has included several options that give us additional insight into our running applications:

    dsply ('Object type: ' + %trim(%info(*OBJTYPE)));
    dsply ('Module: ' + %trim(%info(*MODULE)));
    dsply ('Activation group: ' + %trim(%info(*ACTGRP)));
    dsply ('Statement: ' + %char(%info(*STMT)));
    

    *OBJTYPE identifies whether the executing code belongs to a *PGM or *SRVPGM. *MODULE identifies the module containing the current procedure, and *ACTGRP identifies its activation group.

    These values describe the code currently executing. Inside a service program procedure, they identify that service program and module, not necessarily the calling program. That’s worth remembering when building reusable diagnostic routines.

    Then there’s %INFO(*STMT), which returns the statement number containing the BIF, using the same numbering found in debugger and job-log information.

    In my previous articles about procedure-driven RPG, I’ve discussed how smaller, focused procedures simplify troubleshooting. Combining a procedure name with %INFO(*STMT) can help identify precisely where a diagnostic message originated.

    Just remember that %INFO(*STMT) identifies the statement containing the BIF, not necessarily the statement that caused an exception.

    When Current And Initialized Aren’t The Same

    One of %INFO’s more interesting capabilities is distinguishing current job attributes from values captured when an RPG module was initialized.

    Consider the job’s CCSID:

    dsply ('Current CCSID: ' + %char(%info(*JOBCCSID : *CURRENT)));
    dsply ('Module CCSID: ' + %char(%info(*JOBCCSID : *MODULE)));
    

    Under normal circumstances, these values will probably be identical. But suppose another program changes the job’s CCSID after our RPG module has been initialized.

    Now the current job’s default CCSID and the value our module is using for conversions could be different.

    If you’ve ever spent an afternoon chasing down a mysterious character conversion problem, you can probably appreciate why IBM decided to expose both values.

    There’s another detail worth mentioning. When a job’s CCSID is 65535, %INFO(*JOBCCSID : *CURRENT) returns the derived default job CCSID rather than simply returning 65535.

    In addition to *JOBCCSID, IBM supports the same *CURRENT and *MODULE distinction for several other job attributes:

    • *JOBDATE retrieves the job date, with the current value returned in ISO format.
    • *JOBDATFMT retrieves the job date format and separator.
    • *JOBDECFMT retrieves the job’s decimal format.

    These options are especially useful when job attributes are changed with CHGJOB while an RPG module remains active.

    A Little Mushroom Troubleshooting

    Suppose our mushroom inventory program has been running all morning, but another application changed the job’s CCSID.

    We can detect a mismatch with a few lines of RPG:

    **free
    ctl-opt dftactgrp(*no);
     
    dcl-s CurrentCCSID int(10);
    dcl-s ModuleCCSID int(10);
     
    CurrentCCSID = %info(*JOBCCSID : *CURRENT);
    ModuleCCSID  = %info(*JOBCCSID : *MODULE);
     
    if CurrentCCSID <> ModuleCCSID;
       dsply ('Mushroom CCSID mismatch!');
       dsply ('Current: ' + %char(CurrentCCSID));
       dsply ('Module:  ' + %char(ModuleCCSID));
    endif;
     
    *inlr = *on;
    

    Admittedly, this is a simplified example, but it demonstrates something important.

    Previously, detecting this particular difference would have required additional work to retrieve the job’s current attributes and compare them with the values our RPG module was using.

    Now IBM has made both values directly accessible.

    And while a mismatched CCSID doesn’t automatically mean something is wrong, it’s certainly something worth investigating when your mushroom inventory suddenly starts producing unexpected characters.

    So, Is It Time To Retire The SDS?

    Not quite. The SDS still has a few tricks up its sleeve.

    While %INFO makes retrieving program and job information easier, the PSDS continues to provide exception details, status codes, and other diagnostic information that %INFO doesn’t offer.

    There’s also compatibility to consider. The new BIF requires updated RPG compiler support and a runtime PTF on every system where programs using %INFO will execute. That’s particularly important for shops that compile on one IBM i partition and deploy to others.

    As of this writing, the specific compiler and runtime PTF numbers have not yet been published. You can find the latest information in IBM’s %INFO announcement on RPG Cafe.

    Existing SDS definitions aren’t suddenly obsolete. But for new development, particularly reusable procedures and service programs, %INFO offers a cleaner way to access information about our execution environment.

    And when it comes to distinguishing current job attributes from the values our module is actually using, %INFO provides something more valuable than simply saving a few lines of code.

    Our trusty old SDS isn’t ready for retirement just yet. But IBM has given it a pretty capable new co-worker.

    Until next time, happy coding.

    Gregory Simmons is a Project Manager with PC Richard & Son. He started on the IBM i platform in 1994, graduated with a degree in Computer Information Systems in 1997 and has been working on the OS/400 and IBM i platform ever since. He has been a registered instructor with the IBM Academic Initiative since 2007, an IBM Champion and holds a COMMON Application Developer certification. When he’s not trying to figure out how to speed up legacy programs, he enjoys speaking at technical conferences, running, backpacking, hunting, and fishing.

    RELATED STORIES

    Guru: From Hiking Boots To Long-Term Memory

    Guru: Environment Variables – Global Variables Wearing Hiking Boots

    Guru: When RNF0722 Won’t Let Your Legendary RPG Program Compile

    Guru: Two More Small But Handy RPG Enhancements: LIKE(*EXT) And %LOOKUPNE

    Guru: Beyond Three-Part Naming – Running SQL Across Remote IBM i Systems

    Guru: Finding Data In The Forest – Exploring Three-Part Naming In SQL

    Guru: SQL Sequences In RPG Let Db2 Handle The Counting

    Guru: IBM i Job Log Detective Brings Structure To Job Log Analysis In VS Code

    Guru: Managing The Lifecycle Of Your Service Programs – Updates Without Chaos

    Guru: Are Binding Directories A Shortcut Or A Source Of Chaos?

    Guru: Service Programs And Activation Groups – Design Decisions That Matter

    Guru: Binder Source Is Your Service Program’s Owner’s Manual

    Guru: Access Client Solutions 1.1.9.11 – Security First, With Continued Investment In SQL Tooling

    Guru: Taming The CRTSRVPGM Command – Options That Can Save Your Sanity

    Guru: CRTSRVPGM Parameters That Can Save or Sink You

    Guru: A First Look at Bob, The IBM i Assistant That’s Closer Than You Think

    Bob More Than Just A Code Assistant, IBM i Chief Architect Will Says

    IBM Pulls The Curtain Back A Smidge On Project Bob

    Big Blue Converges IBM i RPG And System Z COBOL Code Assistants Into “Project Bob”

    Guru: When Attention Turns To You – Writing Your Own ATTN Program

    Guru: WCA4i And Granite – Because You’ve Got Bigger Things To Build

    Guru: When Procedure Driven RPG Really Works

    Guru: Unlocking The Power Of %CONCAT And %CONCATARR In RPG

    Guru: AI Pair Programming In RPG With Continue

    Guru: AI Pair Programming In RPG With GitHub Copilot

    Guru: RPG Receives Enumerator Operator

    Guru: RPG Select Operation Gets Some Sweet Upgrades

    Guru: Growing A More Productive Team With Procedure Driven RPG

    Guru: With Procedure Driven RPG, Be Precise With Options(*Exact)

    Guru: Testing URLs With HTTP_GET_VERBOSE

    Guru: Fooling Around With SQL And RPG

    Guru: Procedure Driven RPG And Adopting The Pillars Of Object-Oriented Programming

    Guru: Getting Started With The Code 4 i Extension Within VS Code

    Guru: Procedure Driven RPG Means Keeping Your Variables Local

    Guru: Procedure Driven RPG With Linear-Main Programs

    Guru: Speeding Up RPG By Reducing I/O Operations, Part 2

    Guru: Speeding Up RPG By Reducing I/O Operations, Part 1

    Guru: Watch Out For This Pitfall When Working With Integer Columns

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    Tags: Tags: %INFO, 400guru, BIF, FHG, Four Hundred Guru, IBM i, IBM i 7.5 TR9, IBM i 7.6 TR3, Program Status Data Structure, PSDS, RPG, SDS

    Sponsored by
    FalconStor

    Simplify Secure Offsite Data Protection for IBM Power with FalconStor Habanero™

    IBM i teams are under growing pressure to ensure data is protected, recoverable, and compliant—without adding complexity or disrupting stable environments.

    FalconStor Habanero™ provides secure, fully managed offsite data protection purpose-built for IBM Power. It integrates directly with existing IBM i backup tools and processes, enabling reliable offsite copies without new infrastructure, workflow changes, or added operational overhead.

    By delivering and managing the service end-to-end, FalconStor helps organizations strengthen cyber resilience, improve disaster recovery readiness, and meet compliance requirements with confidence. Offsite copies are securely maintained and available when needed, supporting recovery, audits, and business continuity.

    FalconStor Habanero offers a straightforward way to modernize offsite data protection for IBM i: focused on simplicity, reliability, and resilience.

    Learn More

    Share this:

    • Share on Reddit (Opens in new window) Reddit
    • Share on Facebook (Opens in new window) Facebook
    • Share on LinkedIn (Opens in new window) LinkedIn
    • Share on X (Opens in new window) X
    • Email a link to a friend (Opens in new window) Email

    Big Blue Backs Off On Power Memory Redundancy As Memory Prices Soar Could You Recover Tomorrow? A CISO’s Perspective On IBM i Security In 2027

    Leave a ReplyCancel reply

TFH Volume: 36 Issue: 41

This Issue Sponsored By

  • i-Rays
  • Lightedge
  • FalconStor
  • WorksRight Software
  • Raz-Lee Security

Table of Contents

  • MIMIX 11 Ships As Tech Outages Dominate Headlines
  • Could You Recover Tomorrow? A CISO’s Perspective On IBM i Security In 2027
  • Guru: RPG’s New %INFO BIF. Is It Time to Retire the SDS?
  • Big Blue Backs Off On Power Memory Redundancy As Memory Prices Soar
  • IBM i PTF Guide, Volume 28, Number 42

Content archive

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

Recent Posts

  • MIMIX 11 Ships As Tech Outages Dominate Headlines
  • Could You Recover Tomorrow? A CISO’s Perspective On IBM i Security In 2027
  • Guru: RPG’s New %INFO BIF. Is It Time to Retire the SDS?
  • Big Blue Backs Off On Power Memory Redundancy As Memory Prices Soar
  • IBM i PTF Guide, Volume 28, Number 42
  • IBM i Delivers New Development Tooling With 2026 Fall Tech Refreshes
  • Big Blue Says AI Is Not Behind The Big Uptick In IBM i Security Alerts
  • Guru: Web Service With Pagination
  • The GenAI Revolution And Product Shortages Send IT Budgets Skyward
  • IBM i PTF Guide, Volume 28, Number 40

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