AS/400 Programming Overview

AS/400 programming refers to writing software for the IBM AS/400 system (now known as IBM iSeries or IBM i). It’s a robust midrange server system widely used in banking, manufacturing, insurance, and logistics for its stability, performance, and security.

🧠Overview of AS/400 Programming

AspectDescription
PlatformIBM AS/400 (now IBM i)
Main LanguagesRPG, CL, COBOL, SQL, Java
DatabaseDB2/400 (integrated relational DB)
InterfaceGreen-screen terminal (5250) and modern GUI/web interfaces
ToolsIBM Rational Developer for i (RDi), SEU, PDM

πŸ’»Main Languages Used

1. RPG (Report Program Generator)

The primary and most common AS/400 programming language.

Variants: RPG III, RPG IV, and modern Free-Format RPG (RPGLE)

βœ… Free-Format RPG Example:

**FREE
ctl-opt dftactgrp(*no) actgrp('MYPGM');

dcl-s msg varchar(50);

msg = 'Hello, AS/400!';
dsply msg;

*inlr = *on;
return;

2. CL (Control Language)

Used for scripting, job control, and calling programs.

βœ… CL Example:

PGM
DCL VAR(&NAME) TYPE(*CHAR) LEN(10)
CHGVAR VAR(&NAME) VALUE('IBMUSER')
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Hello' *BCAT &NAME)
ENDPGM

3. SQL on AS/400 (DB2/400)

You can write SQL in interactive SQL or embed it in RPG/CL.

βœ… SQL Example:

SELECT * FROM EMPLOYEES WHERE DEPARTMENT = 'IT';

πŸ“Key Components of AS/400 Programming

ComponentDescription
LibrariesContainers for related objects (like folders)
ObjectsEverything on AS/400 is an object: files, programs, etc.
Physical File (PF)Like a table
Logical File (LF)Like a view/index
Data Areas/QueuesShared memory or communication between programs
Job/Job QueueHow tasks are scheduled and run

🧰Tools You Might Use

ToolUse
SEU (Source Entry Utility)Edit source code (old style)
PDM (Program Development Manager)Navigate/edit source
RDi (IBM Rational Developer for i)Modern Eclipse-based IDE
ACS (Access Client Solutions)Modern GUI for database and terminal

πŸ”Example Project Ideas

ProjectInvolves
Payroll SystemRPG + DB2 + CL
Inventory ManagementRPGLE + SQL
User Audit LoggingCL + SQL
Menu NavigationCLP (menus)
REST API on IBM iRPG + Node.js or Java