Example IBM i software (RPG) — hello-world etc. for the zelnet 5250 client
  • Shell 79.5%
  • RPGLE 20.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-03 20:15:47 +00:00
.vscode fix: add .vscode/rpglint.json so the RPGLE lint gate passes (v0.1.3) 2026-07-02 00:27:15 +02:00
docs feat(rpg): hello world examples for IBM i (pub400) — DSPLY + DSPF/EXFMT 2026-06-19 11:28:37 +02:00
rpg feat: greet in Hallo + a zelnet refute screen-test 2026-07-01 15:51:56 +02:00
scripts feat: environment libraries — runlib() compile (CHGCURLIB in-job) + objects.env manifest 2026-07-03 21:32:08 +02:00
CHANGELOG.md release: v0.1.5 (auto-cadence) 2026-07-03 20:15:47 +00:00
README.md feat(rpg): hello world examples for IBM i (pub400) — DSPLY + DSPF/EXFMT 2026-06-19 11:28:37 +02:00
test-hallo.sh feat: greet in Hallo + a zelnet refute screen-test 2026-07-01 15:51:56 +02:00
VERSION release: v0.1.5 (auto-cadence) 2026-07-03 20:15:47 +00:00

ibmi-examples

Example IBM i software — starting with RPG "hello world" — used to exercise zelnet, a modern TN5250/TN3270 terminal client. IBM i has no stdout: a program's "output" is the 5250 datastream the terminal renders. So these examples double as terminal test programs.

Target host: pub400.com (a free public IBM i). Profile SOMEARA.

What's here

Path What it is
rpg/hello/hello.rpgle The smallest RPG program: DSPLY 'Hello, World!' — a message line at the bottom of the screen.
rpg/helloscreen/HELLOD.dspf A DDS display file (record format MAINPANEL) that paints Hello World! full-screen with an F3=Exit.
rpg/helloscreen/helloscr.rpgle The ILE RPG driver that EXFMTs MAINPANEL until F3.
scripts/deploy.sh Compiles all three on the box via PASE system.
docs/pub400.md pub400 specifics: libraries, IFS paths, SSH, gotchas.

The two "hello worlds"

1. DSPLY (one-liner). Proves the compile→CALL loop. Output is a 5250 Write-To-Display message line; on an interactive job it waits for ENTER.

**FREE
dsply 'Hello, World!';
*inlr = *on;

2. Display file + EXFMT (the real 5250 way). Paints a screen with a record format and reads an AID key — the true terminal test. DDS is column-significant (A@6, R@17, name@19, row@3941, col@4244, constant@45):

     A                                      DSPSIZ(24 80)
     A                                      INDARA
     A                                      CA03(03 'Exit')
     A          R MAINPANEL
     A                                  5  5'Hello World!'
     A                                 23  2'F3=Exit'
**FREE
ctl-opt dftactgrp(*no) actgrp(*new);
dcl-f HELLOD workstn indds(dspind);
dcl-ds dspind qualified;
  exit ind pos(3);   // CA03 (F3)
end-ds;
dow not dspind.exit;
  exfmt MAINPANEL;
enddo;
*inlr = *on;

Build & run

CRTBNDRPG reads IFS source (SRCSTMF); CRTDSPF does not, so the DDS is copied into a QDDSSRC member first. A display-file (EXFMT) program needs a real 5250 device — compile over SSH, but CALL it from a 5250 session.

# from a clone of this repo:
scp -P 2222 -r rpg SOMEARA@pub400.com:/home/SOMEARA/ibmi-examples/   # upload source
ssh -p 2222 SOMEARA@pub400.com 'bash -s' < scripts/deploy.sh         # compile on the box

Then in a 5250 session (make powerbunker in the seanfarm repo, or zelnet pub400.com 992), at the IBM i command line:

CALL SOMEARA1/HELLO        → "Hello, World!" at the screen bottom; ENTER
ADDLIBLE SOMEARA1
CALL HELLOSCR              → paints the screen; F3 exits

Running CALL HELLOSCR from zelnet is the milestone: your own RPG screen, painted by your own terminal.

Repo flow

codeberg someara/ibmi-examples is canonical/backup; the seanfarm cluster imports it to Forgejo sean/ibmi-examples via a GitMirror and push-mirrors it back every 10 min. Push to codeberg origin, then make forgejo-sync REPOS="ibmi-examples" from the seanfarm repo to seed Forgejo.