- Shell 79.5%
- RPGLE 20.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .vscode | ||
| docs | ||
| rpg | ||
| scripts | ||
| CHANGELOG.md | ||
| README.md | ||
| test-hallo.sh | ||
| VERSION | ||
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@39–41, col@42–44, 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.