• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: Decoding Base64 ASCII

    August 18, 2025 Chris Ringer

    A co-worker of mine recently asked me how to decode a base64 ASCII string in RPG, received from an HTTP response. My response was “that’s easy”, simply use the relevant SQL function BASE64_DECODE. I promptly wrote some sample code and after some debugging I realized this function threw me a curveball.

    Let me demonstrate the issue and offer a simple solution.

    01 **Free
    02 ctl-opt DftActGrp(*No) Copyright('(C) Chris Ringer');
    
    03 dcl-s string_UTF8   varchar(1000) ccsid(*UTF8);
    04 dcl-s base64_UTF8   varchar(1350) ccsid(*UTF8);
    05 dcl-s decoded_UTF8  varchar(1000) ccsid(*UTF8);
    06 dcl-s decoded_Hex   varchar(1000) ccsid(*HEX);
    
    07 Exec SQL Set Option Commit=*NONE, Naming=*SYS;
    08 string_UTF8 = 
    …

    Read more
  • Guru: A Faster Way To Sign A JWT

    July 21, 2025 Chris Ringer

    In my prior article, which you can read here, I discussed using the OpenSSL tool to asymmetrically sign a JWT. I like OpenSSL because it’s an open source solution available on many platforms and easy to use. But the decision to use OpenSSL should be coupled with the performance level expectations (the PLA) for your project.

    For instance, how many tokens will you need to create in a given interval? Will your newly minted tokens expire 24 hours from now or in 5 minutes? In my case currently, only about 5 JWTs are needed per day so …

    Read more
  • Guru: When Procedure Driven RPG Really Works

    July 14, 2025 Gregory Simmons

    In the vast and varied ecosystems of Earth, few interactions between species have captured the imagination of scientists and casual observers alike as much as the relationship between bottlenose dolphins and puffer fish. This curious dance, often involving the deliberate provocation of the puffer fish to trigger its natural defense mechanism, has led to many interpretations – from simple play to speculative pharmacological experimentation. I submit to you today, that in the digital ocean of RPG development, developers should interact with their procedures in ways that, to the outside eye, might seem equally cryptic, yet are deeply intentional, meticulously orchestrated, …

    Read more
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set

    May 12, 2025 Mike Larsen

    Continuing to build out the stored procedure series, I’m going to show how to create an SQL stored procedure that returns a result set. This is very similar to the previous article where I showed how to do this using RPG. In this example, we’re just using pure SQL to achieve the same results.

    I created an SQL script (Figure 1) that selects all rows from the Departments table. The SQL statement is the same as the one I used in the RPG program from the prior article, but I’ll describe it again here. I didn’t add any selection criteria …

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

    April 14, 2025 Gregory Simmons

    When working with strings in RPG, especially in modern free-format code, the %CONCAT and %CONCATARR built-in functions (BIFs) offer efficient and readable solutions for combining strings. These functions simplify the process of concatenating multiple string values, making your code cleaner and easier to maintain. In this article, we will explore how they work and demonstrate their practical applications.

    The %CONCAT BIF allows you to combine multiple strings. It’s a more efficient and readable alternative to traditional concatenation using the + operator.

    Here’s a simple example:

    **Free
    Ctl-Opt Main(CONCAT_1) ActGrp(*Caller);
    
    Dcl-Pr pause ExtProc('sleep');
      time_to_sleep Uns(10) Value;
    End-Pr;
    
    Dcl-Proc CONCAT_1;
    
      Dcl-S firstName 
    …

    Read more
  • Guru: Creating An RPG Stored Procedure That Returns A Result Set

    March 17, 2025 Mike Larsen

    In the previous article, I showed how to create an RPG stored procedure that uses parameters. In this article, I’m going to show how to create an RPG stored procedure that returns a result set, as we would likely encounter this scenario more frequently. The data used in this example comes from the Department table from IBM’s Sample database.

    I created an RPG program (Figure 1) that selects all rows from the Departments table. I didn’t add any selection criteria as I know there aren’t many rows in the table, but you may want to limit the number of rows …

    Read more
  • Guru: AI Pair Programming In RPG With Continue

    March 10, 2025 Gregory Simmons

    In my last article, I shared a brief introduction to the GitHub Copilot extensions. These extensions provide an easy way to get up and running with an AI coding assistant to aid you in your RPG development. Being cloud based, it’s lightweight in terms of system resources, but it does cost a little money per month, per user.

    For this article, I would like to share with you what I have learned about a newer extension for VS Code named Continue. Continue runs locally on your PC, is 100 percent free, and as of this writing, is the leading …

    Read more
  • Guru: Avoiding Land Mines During A Role Swap

    March 3, 2025 Steven McIver

    Having a disaster recovery plan is crucial for many businesses running on IBM i. The data that resides on these systems is often mission critical to the business. Implementing a strategy for disaster recovery is tough. Planning and actually executing on the strategy is even tougher.

    Even with excellent planning, role swap tests to a designated disaster recovery machine can many times fall short due to unforeseen circumstances that force an immediate role swap back to the production site. In this article, I’ve compiled a few of those land mines to look out for to help ensure a successful swap …

    Read more
  • Guru: AI Pair Programming In RPG With GitHub Copilot

    February 17, 2025 Gregory Simmons

    If you have been meaning to give VS Code a try, but just haven’t had a chance, I encourage you to avail yourself today. Yes, for you RDi users, it will take a little bit to migrate your favorite settings, code snippets, and compile commands – but I promise, you won’t regret the move.

    In my article, Getting Started With The Code 4 i Extension Within VS Code, I offer a few more insights to help get you started. And if you are an SEU user, yes, the switch may seem daunting, but one of the great things about …

    Read more
  • Guru: Creating An RPG Stored Procedure With Parameters

    January 20, 2025 Mike Larsen

    There are times we need to build processes that will be used across different platforms. An example is a pricing routine. When a system needs to get pricing, we need to make sure the price the customer pays is the same regardless of how the order was created in our system.

    One way to create this functionality is using web services. Another way we can provide this functionality is through stored procedures. This series of tips will focus on different ways we can build stored procedures on IBM i.

    For the first part, I created an RPG program (Figure 1) …

    Read more

Previous Articles

Content archive

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

Recent Posts

  • Tool Aims To Streamline Git Integration For Old School IBM i Devs
  • IBM To Add Full System Replication And FlashCopy To PowerHA
  • Guru: Decoding Base64 ASCII
  • The Price Tweaking Continues For Power Systems
  • IBM i PTF Guide, Volume 27, Numbers 31 And 32
  • You Can Now Get IBM Tech Support For VS Code For i
  • Price Cut On Power S1012 Mini Since Power S1112 Ain’t Coming Until 2026
  • IBM i: Pro and Con
  • As I See It: Disruption
  • IBM i PTF Guide, Volume 27, Number 30

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