Field notes
Blog
Data Structures in ILE RPG: Model the Shape of Your Data
QUALIFIED, LIKEDS, TEMPLATE, nested structures and arrays of data structures in free-format ILE RPG โ and why they replace parallel arrays.
Arrays in ILE RPG: Declare, Load, Search, Sort
DIM and %ELEM, compile-time arrays, safe array loading, %LOOKUP and the ranged %LOOKUPxx functions, and SORTA with %SUBARR in free-format ILE RPG.
Numbers and Dates in ILE RPG: Convert, Measure, Project
%DEC vs %DECH, %INT and %UNS, %CHAR, %DATE/%TIME/%TIMESTAMP, %DIFF and %DAYS/%MONTHS/%YEARS in free-format ILE RPG.
Five String Functions That Clean Up Real-World Data in ILE RPG
%LEN, %SUBST, %SCAN, %REPLACE, %XLATE, %TRIML and %TRIMR in free-format ILE RPG, with the %SCAN-to-%SUBST defect to avoid.
Five Control Structures, One Habit: Choosing on Purpose
IF/ELSEIF, SELECT/WHEN, DOW, DOU, and FOR in free-format ILE RPG โ and how LEAVE and ITER change a loop's behavior.
Expressions in ILE RPG: Assignment, Operators, and Precedence
How ILE RPG evaluates and stores expressions: truncation vs EVAL(H), %DIV and %REM, %TRIM concatenation, compound operators, and precedence.
Variables, Constants, and Named Indicators: Three Declarations, Three Jobs
When to use DCL-S, DCL-C, and IND in ILE RPG โ plus global vs local scope, the STATIC keyword, and replacing numbered *INxx indicators.
Choosing ILE RPG Data Types Is a Design Decision
CHAR vs VARCHAR, PACKED vs ZONED vs INT, DATE/TIME/TIMESTAMP, and IND: how to choose the right ILE RPG data type for each business field.
Free-Format RPG Structure: What **FREE Changes, and What It Doesn't
How a fully free-form ILE RPG source member is organized: the **FREE directive, statement rules, and how each fixed-format spec maps to free form.