Programming on IBM i: sources, ILE, RPG and SQL

Reviewed on Verified on IBM i 7.5

Log in to save

This guide explains how software is written, compiled and maintained on IBM i: where the code lives, how it becomes a program, what distinguishes a module from a service program, why the same file can be read in two different ways, and how to find out where something broke.

Who it is for

Anyone arriving from other languages. Besides RPG syntax there is everything around it: source inside a file, compiling that produces an object, activation groups, the difference between reading a file by record and querying it in SQL.

Anyone who has worked on it for years. Much of the guide is familiar ground, but the chapters on ILE, embedded SQL and modernisation cover things many departments have not adopted.

What it is not

It is not an RPG course: syntax appears where it helps explain a concept, and for the language statement by statement there is IBM's manual, the ILE RPG Reference. Nor is it a modernisation manifesto: that chapter is about changing the parts worth changing, not rewriting everything.

How it is organised

Part Chapters
Where code lives and how it becomes an object where the code lives, ILE
The languages RPG, CL
The data DDS and SQL, SQL inside programs
When something breaks errors and debugging
Changing software without stopping it modernising, today's tools

Read the chapters in order the first time, then consult them on their own. Each lists at the end the IBM pages it rests on.

Note

this guide assumes you know what a library is and how the library list works. If those terms are new, the administration guide covers that ground.

Chapters in this guide

  1. Where the code lives Source lives inside a file, compiling produces an object, and there is no project directory. The first obstacle for anyone arriving from outside.
  2. ILE: modules, programs and service programs What changes between CRTBNDRPG and the module-plus-program pair, what a service program is for, and why activation groups cause damage when nobody chose them.
  3. RPG: from columns to free-form Why old code is written in columns, what changed with free-form, and how to live with two forms of the same language in one application.
  4. CL: the language that holds the rest together Not a second-class language: it launches the batch work, handles the errors and talks to the system. And it is the one nobody was ever properly taught.
  5. DDS and SQL: two ways of describing data The same file is both a physical file and a table. When to stay with DDS, when to move to SQL, and what it costs not to decide.
  6. SQL inside programs How to write SQL inside RPG, why SQLCODE zero does not mean everything went well, and where injection hides on this platform too.
  7. When it breaks: errors and debugging How to read an RPG error, how to get into the debugger on a job that is not yours, and how to stop a program dying silently at three in the morning.
  8. Modernising without rewriting Old code is not technical debt by virtue of being old. What is worth changing, in what order, and how an existing program is exposed to the rest of the world.
  9. The tools the work is done with today SEU does not understand fully free-form RPG, and that alone says where the trade has got to. What is actually used to write code on this platform.
← Back to blog

Comments

No comments yet. Be the first to comment!

You need an account to comment. Log in · Sign up