Sample application
Follow an order through the system.
ORDERS combines RPG, COBOL, CL, DDS and SQL in an editable wholesale application.
Install and open
INSSAMPLE
GO L4SAMPLE
INSSAMPLE is an emulator extension. It creates L4SAMPLE from source
using the same create and compile commands you use. It installs 40 customers, 30 items,
120 order headers and 240 detail rows. A completed reinstall preserves your changes.
An unrelated or partial L4SAMPLE is refused: inspect its source and compiler listings before
explicitly renaming or deleting it. There is no automatic partial-install repair or version upgrade.
Try the six menu options
- Customer maintenance (RPG): page through the subfile, use 5 to display, 2 to change a name/city, or 4 to confirm deactivation. Deactivation preserves order history.
- Order inquiry (COBOL): enter an order number from 1 through 120. F12 returns to the prompt and F3 leaves the program. Try a missing order to see its message.
- New order (RPG): on a fresh sample, enter order 901, customer 1, item 2, quantity 4. Reusing 901 is refused. Each entered order has one line; writes do not use commitment control or reserve stock.
- Customer totals (SQLRPGLE): inspect a paged subfile populated by an SQL cursor over the same order data.
- Batch register (CL/COBOL): submit the report to QBATCH. Leave the menu
with F3 and run
WRKSPLFto inspectORDRPT. - Queued register (CL): send REPORT to ORDERQ and submit its receiver. The worker drains available requests, prints the register and exits when the queue is empty.
Inspect and change the source
Use PDM to browse L4SAMPLE/QDDSSRC, QRPGLESRC, QCBLLESRC,
QCLSRC, QSRVSRC and QSQLSRC. The README is also a member:
DSPPFM FILE(L4SAMPLE/QTXTSRC) MBR(README)
WRKMBRPDM FILE(L4SAMPLE/QRPGLESRC)
CALL PGM(L4SAMPLE/QUOTE)
QUOTE and order entry bind the same ORDUTIL service program. The keyed CUSTOMER, ITEM, ORDHDR and ORDDTL physical files also have sorted, selected and joined logical-file examples. SQL views OPENVIEW and ORDTOTAL query these records; POSPRICE demonstrates a price constraint.
Compare DDS and SQL definitions
Optionally create equivalent SQL tables, keys, foreign keys and a view in a separate
L4SQL schema, then copy the application data:
RUNSQLSTM SRCFILE(L4SAMPLE/QSQLSRC) SRCMBR(SQLVERSION) NAMING(*SQL) COMMIT(*NONE)
Run this once in a fresh L4SQL schema. Repeating it requires explicit cleanup. The sample is sized for learning with a load-all subfile and single-line entry. It is not a transaction-safe production order system. See tutorials, the editor guide and the source README.