IBM i: RPG IV ILE Programming Fundamentals
Your application requirements need to become clear, maintainable code. With IBM i, structure your development approach and connect technical choices to the expected behaviour. Build your autonomy in designing, testing and evolving your applications.
- Duration
- 5 days 35 hours
- Code
- AS06FR Code
Presentation
RPG (Report Program Generator), long recognised for its robustness on IBM i, has undergone a major transformation with free-form syntax (/free) and integration into the modular ILE architecture. These developments make the language more readable, modern and compatible with current development tools.
This course is designed for developers who want to master modern RPG IV. Participants learn to develop effectively with RDi (Rational Developer for i) and Visual Studio Code, two established environments for working comfortably on IBM i. Through a progressive approach and numerous practical exercises, they learn to create RPG programs, interact with screens, generate printed reports, access DB2 and use the system's debugging tools.
Objectives
By the end of this course, participants will be able to:
- Write RPG IV /free programs compatible with recent IBM i releases.
- Produce printed output (spools) and create interactive screens.
- Use the main control structures and subroutines.
- Access DB2 databases natively and through SQL.
- Debug batch and interactive programs effectively.
- Handle different variable types and structures (dates, pointers, data structures, etc.).
Program
1. Introduction to RPG IV /free
- History and position of RPG within IBM i.
- Modern free-form syntax (/free).
- Compilation with CRTBNDRPG and V7.x options.
🧪 Lab: Create and compile your first RPG /free program.
2. Programming structures and subroutines
- Simple and structured variables (DCL-S, DCL-DS).
- Control statements: IF, SELECT, FOR, DOW, LEAVE, ITER.
- Local subroutines (begsr/endsr) and procedures.
🧪 Lab: Develop a structured program with conditional logic.
3. Data handling
- Data types: alphanumeric, numeric, dates and pointers.
- Common built-in functions (e.g. %SUBST, %TRIM, %LOOKUP).
- Assignments, conversions and processing.
🧪 Lab: Handle strings, dates and data structures.
4. Debugging and logging
- Using STRDBG for interactive debugging.
- Stepping through code, viewing variables and nested calls.
🧪 Lab: Debug an RPG program with error handling.
5. Producing documents (spools)
- Using printer files (PRTF).
- Printing structured reports with RPG.
🧪 Lab: Generate a printed report from DB2 data.
6. Interactive screens
- Display files (DSPF), displaying menus and user input.
- Calling programs from screens and transferring data.
🧪 Lab: Create a simple screen and manage user navigation.
7. Database access
- Native access to physical and logical files (CHAIN, SETLL, READ, etc.).
- SQL access through embedded SQL in RPG (/EXEC SQL).
- Operations with FETCH, INSERT and UPDATE.
🧪 Lab: Write an RPG program that reads and updates DB2 data through SQL and native access.
Audience
Developers new to RPG IV or IBM i.
Prerequisites
A solid understanding of programming concepts.
Familiarity with the main CL commands (WRKSPLF, WRKJOB, DSPMSG, DSPJOB, etc.).
Teaching and assessment methods
- Initial skills assessment
- Training materials provided to participants
- Continuous assessment throughout the course
- End-of-course feedback questionnaire
- Combination of theory and practical application
- Attendance records
- Post-course follow-up evaluation
- Quiz / multiple-choice questions
- Practical exercises
Course highlights
- Learn RPG IV /free in a real IBM i environment.
- Use RDi and Visual Studio Code for modern development.
- Progressive training suitable for RPG beginners.
- Numerous practical exercises and examples inspired by real situations.
- Labs on V7R5 or V7R6.
Dates and sessions
Choose the date and delivery format that suit you.
No upcoming sessions are currently available.
fr
en