About Modern RPG : ILE Code Workshop
An ever-growing list of lessons looking at various programming techniques using RPGLE and SQLRPGLE on the IBM i Power System.
Module Content
MODULE 5
An ever-growing list of lessons looking at various programming techniques using RPGLE and SQLRPGLE on the IBM i Power System.
Example RPG for Beginners
MEMBERS ONLY
Read a flat file into a variable in a simple RPGLE program. In this example we will start with an old RPG3 format, modernize it to freeformat and compare styles!
Here is a little RPG program - just reading a file (table) and populating each file (row) into a Data Structure (Array). Capeeeche?
Yesterday I had to upgrade some codes from the 1990's It was column based RPG400 which basically reads a file, checks a field and updates it if certain conditions are met. Simple Right? So, let's grab that and upgrade it to use SQLRPGLE...
Ever coded in the wild west of old-school RPG, where GOTO tags and subroutines ruled with an iron fist? Yeah, me too! But what if I told you there's a smoother path forward? In this video, we're ditching those spaghetti-code relics and leveling up to modern RPGLE with clean, modular sub-procedures. We'll refactor real examples, slash complexity, and unlock code that's easier to read, test, and maintain (hopefully) without breaking a sweat. Stick around as we bridge the gap from legacy chaos to future-proof elegance. If you're an IBM i dev ready to evolve, hit that play button, like if you've battled a GOTO beast, and subscribe for more RPGLE magic. Let's code smarter, not harder!
Example RPG Code using SQL
MEMBERS ONLY
This lesson introduces learners to the fundamentals of creating a Customer Master Table on the IBM i platform using SQL. Designed for developers transitioning from traditional native I/O methods to modern SQL-based data management, the lesson walks through: 📋 Defining a normalized customer master schema 🛠️ Using SQL CREATE TABLE statements tailored for IBM i Db2 🔍 Exploring key fields like customer ID, name, address, contact info, and status flags 🔗 Understanding relationships with supporting tables (e.g., orders, addresses) 🧪 Sample queries to validate structure and retrieve customer data By the end of this lesson, learners will be equipped to design and implement a robust customer master table using SQL on IBM i, setting the foundation for scalable and maintainable enterprise applications.
Example RPG Code using IFS
MEMBERS ONLY
In computer science, pseudocode is a textual representation of an algorithm's steps, blending programming language conventions with informal, often self-explanatory notations for actions and conditions. While it shares characteristics with formal programming languages, pseudocode is designed for human comprehension, not for direct execution by machines.
Simple IBM i RPG program using SQL to read an IFS file into program variables for business logic processing.
QSYS2.IFS_WRITE is a system-provided function in IBM i (formerly known as AS/400 or iSeries) that allows you to write data to the Integrated File System (IFS). The IFS is the file system on IBM i that provides a UNIX-like file structure and allows access to files and directories.
RPG from the AS400 Days
MEMBERS ONLY
In today’s video, we’re diving into good old-fashioned column based RPG from the last century! Let's play with an internally defined print file and look at how the EXCEPT operation is used to print lines on that report. Whether you’re a beginner or a seasoned coder, I’ll break it down step-by-step to help you level up your skills. So, grab your coffee (preferably not the terrible store bought iced one I was choking down while recording this), fire up your code editor, and let’s get started!
