Beginner ILE RPG
Build real free-format ILE RPG skills from the ground up — syntax, data types, control structures, and file I/O.
Get all 18 lessons in this course with lifetime access.
Have a coupon code?
Available codes — tap to apply:
Uses the email address entered above.
Code applied — off, new total . Click "Buy the whole course" above to continue.
Free-Format RPG: Structure, the **FREE Directive, and Spec Types
Every RPG source member is organized around a small set of specification types — control, file, definition, procedure, and calculation — that once lived in fixed columns. This lesson shows how fully free-form source replaces those columns with keyword-led statements, and what the **FREE…
Data Types: Character, Numeric, Date, Time, and Indicator
The data type chosen in a declaration fixes a field's storage size, arithmetic behavior, and compatibility with the database and with other programs. This lesson works through the type families available to DCL-S: CHAR and VARCHAR; PACKED, ZONED, INT, and UNS; DATE, TIME, and TIMESTAMP; and IND.
Variables, Constants, and Named Indicators
Every value a program touches is either expected to change, required never to change, or a two-state condition that drives a decision. This lesson covers the declaration tool for each — DCL-S variables, DCL-C named constants, and IND named indicators — and the scope and storage-duration rules…
Expressions, Operators, and Assignment
Declared storage does no work until an expression acts on it. This lesson covers assignment and its relationship to EVAL, the arithmetic operators, whole-number division with %DIV and %REM, string concatenation with %TRIM, the compound assignment operators, and the relational and logical…
Control Structures: IF, SELECT, DOW, DOU, and FOR
Every branch and loop in a program is built from five patterns: choose among a few conditions, choose among many discrete values, repeat while a condition holds, repeat until a condition is reached, and repeat a known number of times. This lesson covers the RPG structure for each —…
Built-In Functions Part 1: String Manipulation
Incoming text is rarely in the shape a program needs. This lesson covers the built-in functions that measure, extract, search, rewrite, and translate it: %LEN, %SUBST, %SCAN, %REPLACE, %XLATE, and the one-sided members of the trim family, %TRIML and %TRIMR.
Built-In Functions Part 2: Numeric and Date/Time
Numeric values rarely arrive at the precision arithmetic needs, and legacy dates rarely arrive as genuine DATE values at all. This lesson covers the conversion functions %DEC, %DECH, %INT, %UNS, and %CHAR; the constructors %DATE, %TIME, and %TIMESTAMP; the interval function %DIFF; and the…
Arrays: Declaration, Loading, and Lookup
ERP programs are full of small fixed-shape lists: region codes, carrier codes, pricing-tier thresholds. This lesson covers declaring arrays with DIM and bounding code with %ELEM; compile-time arrays with CTDATA, PERRCD, and a named **CTDATA section; loading runtime arrays safely; exact-match…
Data Structures: Qualified, LIKEDS, and Nested
A data structure groups related fields of different types under one name. This lesson covers qualified data structures and dot notation, LIKEDS for reusing a layout, TEMPLATE for structures that exist only to be copied, nested data structures, and arrays of data structures.
File I/O: READ, WRITE, UPDATE, DELETE, and CHAIN
When a program declares a database file with DCL-F, the file's record format becomes a set of fields the program reads into and writes from — in effect, a data structure the system fills. This lesson covers the five operations that move records across that boundary: READ, CHAIN, WRITE, UPDATE,…
Externally Described vs Program-Described Files
Every file has a record layout; the question is where it is recorded. An externally described file carries its layout in the file object, and the compiler generates its fields. A program-described file supplies only a record length, and the program defines every byte. This lesson covers both, in…
Procedures and Subprocedures: Definition and Scope
A subroutine has no parameters, no return value, and no local storage, so everything it touches is global. A subprocedure states its contract at the call site. This lesson covers defining subprocedures with DCL-PROC and DCL-PI, the structure of a module, cycle-main, linear-main (MAIN), and…
Prototyping: DCL-PR, DCL-PI, and Passing Parameters
Lesson 24 defined subprocedures and called them within one module, where the compiler derives a prototype from the procedure interface. This lesson covers the prototype itself — DCL-PR — and the rules that govern how data crosses a call boundary: by reference, by CONST reference, and by VALUE.
Error Handling Foundations: MONITOR/ON-ERROR
An unhandled runtime error stops a program and leaves an inquiry message for an operator. This lesson covers the structured way to handle errors in ILE RPG: MONITOR groups with ON-ERROR clauses selected by status code, the (E) operation extender with %ERROR and %STATUS, and ON-EXIT for clean-up…
Copy Members and Modular Source Organization
Once a procedure is called from more than one place, its prototype must be identical everywhere it is used. This lesson covers the compiler directives that make that possible — /COPY and /INCLUDE from source physical files and from IFS stream files — and the conditional-compilation directives…
Embedded SQL Foundations: Static SQL and Host Variables
Embedded SQL lets an RPG program state what data it needs rather than navigating to it record by record. This lesson covers the SQLRPGLE source type and the SQL precompiler, EXEC SQL statements, host variables and host data structures, SELECT INTO for single-row retrieval, and INSERT, UPDATE,…
Debugging: STRDBG, Breakpoints, and Watch Variables
Reading code finds most defects; the rest need the program observed while it runs. This lesson covers the IBM i system debugger: compiling with a debug view, starting a session with STRDBG, setting unconditional and conditional breakpoints, stepping into and over calls, displaying and changing…
Beginner ILE RPG Consolidation and Best Practices Review
This lesson brings the Beginner ILE RPG series together in one complete, production-shaped program: a linear-main program with program entry parameters, prototypes from a guarded copy member, externally described files read into local data structures, subprocedures with clear contracts, embedded…
Create your account
Takes a few seconds — you'll be right back here after.