DEPOT/i — Distribution & Warehouse Management

SteelFrame X application operation manual  ·  ← back to Operation Manuals  ·  Sign On

DEPOT/i is a distribution-centre warehouse management application: a warehouse and bin/location master, stock held by (item, location, lot), inbound receiving and put-away, wave pick release and pick confirmation, despatch, cycle counting, bin-to-bin replenishment, stock valuation and a monthly GL post. Its central discipline is that stock only ever moves — a put-away, a pick and a replenishment each take quantity out of one bin and put the same quantity into another, so the sum of on-hand across all bins for an item is conserved; only receiving (from outside), despatch (to outside) and a count variance change that total, and each writes a signed movement-ledger row that explains the delta exactly. This manual is the reference for the operator who runs the online screens and the periodic job cycles, and for the developer maintaining the application. It is grounded entirely in the committed source (wms-app/src/sources.mjs, seed.mjs, and the test/wh_*.mjs drivers). Everything runs in library DEPOT.

Contents

A. Overview & Architecture ↑ top

A.1 What it does

DEPOT/i runs the full physical flow of a distribution centre:

A.2 The conservation invariant

The one property the whole application is built around, and the one the test suites assert at every step, is that a warehouse move conserves stock. Formally: for any item, the sum of WHSTK.SQTY over all bins is unchanged by a put-away, a pick, a pick-confirm or a replenishment — each takes quantity from one bin and gives the same quantity to another. Exactly three events change the site total, and each writes a signed row into the movement ledger WHMOVE that accounts for the delta:

The COBOL reconciliation report WHMOVRP is the arbiter: it sums the ledger by type and shows the internal moves netting the site's flows, so any cycle's effect on the balance is provable after the fact.

A.3 Component & flow

  DAILY  (WHDAILY)              WEEKLY (WHWEEK)        MONTHLY (WHMONTH)     ANNUAL (WHYEAR)
  -------------------          ---------------        -----------------     ---------------
  WHPUTWY  receive/put-away    WHREPL   replenish     WHCNTPS  count post   WHPHYS   physical
  WHWAVE   pick release        WHSLOW   ABC re-rank    WHVALUE  valuation    WHRESLT  re-slot
  WHPCKPR  print pick list     WHMOVRP  reconcile      WHGLPST  GL post      WHVALUE  valuation
  WHPKCFM  pick confirm                                WHMOVRP  reconcile    WHMOVRP  reconcile
  WHDSPCH  despatch

  ONLINE (WHMENU)
    1 -> WHSTKIQ  stock inquiry (plain DSPF over WHSTK/WHITEM/WHLOC)
    2 -> WHPCKIQ  wave pick-list inquiry (SUBFILE over WHPICK)

              every posting program --writes--> WHMOVE (movement ledger, one accumulating history)
   WHRCPT --> WHSTK <-- WHORD/WHORDL --> WHPICK --> WHSTK(staging) --> out
             ^   \                                                     WHGLFEED (SQL GL feed)
   WHLOC ----+    +-- WHSTKLF (by-location LF)   WHPCKLF (by-status pick LF)
   WHITEM ---+

A daily flow runs: WHPUTWY moves receipts off the dock into bins → WHWAVE reserves pick-face stock against open orders and writes pick lines → WHPCKPR prints the floor's pick list → WHPKCFM moves the picked stock to the staging lane and releases the reservation → WHDSPCH ships the staged stock and posts the negative ledger rows. Every quantity change writes a WHMOVE row.

A.4 Object inventory

ObjectTypeRole
WHLOCPFLocation (bin) master — type/zone/capacity/velocity.
WHITEMPFItem master — UOM, case pack, min/max, cost, ABC.
WHSTKPFStock by (item, location, lot) — the heart of the app.
WHSTKLFLFStock keyed LOCID-first (by-location access path).
WHRCPTPFInbound receipt lines.
WHORD / WHORDLPFDespatch order header / lines.
WHPICKPFWave pick instructions.
WHPCKLFLFPicks keyed PSTAT-first (by-status access path).
WHMOVEPFMovement ledger — the durable audit trail.
WHCNTPFCycle-count sheets.
WHCARRPFCarrier master.
WHGLFEEDSQL tableGL feed the monthly close posts into (+ index WHGLFACC).
WHSTKD / WHPCKD / WHMENUDDSPFStock inquiry / wave subfile / menu display files.
WHPCKPPRTFPrinted pick list.
WHREFLDRPGLESeeds locations, items and carriers.
WHPUTWY / WHWAVE / WHPCKPR / WHPKCFM / WHDSPCHRPGLEThe daily receive-pick-ship chain.
WHREPL / WHSLOWRPGLEWeekly replenishment / slow-mover re-rank.
WHCNTPS / WHVALUE / WHPHYS / WHRESLTRPGLECount post / valuation / physical count / re-slot.
WHGLPSTSQLRPGLEMonthly GL post (embedded SQL into WHGLFEED).
WHSTKIQ / WHPCKIQ / WHMENURPGLEInteractive inquiry / subfile / menu programs.
WHMOVRPCBLLEILE COBOL ledger reconciliation report.
WHSETUPCLPCreate every object & compile every program.
WHDAILY / WHWEEK / WHMONTH / WHYEARCLPThe four job cycles.

The full catalogue is 10 physical files + 2 logical files + 3 display files + 1 printer file + 1 SQL table (and its index), driven by 16 RPG programs, 1 ILE COBOL program and 5 CL programs. Sections D and F expand each.

B. Online Transactions & Screens ↑ top

B.1 The command/entry line

DEPOT/i has no CICS transaction identifiers and no menu-driven transid switch. On IBM i, each program is reached by name from a 5250 command-entry line, from the WHMENU menu, or from a JOBQ/scheduler for the batch jobs. Before invoking anything, the job's library list must include DEPOT — the tested jobs run with LIBL = QSYS QGPL DEPOT QTEMP and CURLIB = DEPOT. The one-time WHSETUP creates the objects and compiles the programs; WHREFLD seeds the reference data.

To do thisType on the command line
Build the library (objects + programs)CALL DEPOT/WHSETUP
Seed reference data (7 locations, 5 items, 2 carriers)CALL DEPOT/WHREFLD
Open the main menuCALL DEPOT/WHMENU
Open stock inquiry directlyCALL DEPOT/WHSTKIQ
Open the wave pick-list inquiry directlyCALL DEPOT/WHPCKIQ
Run the daily receive-pick-ship cycleCALL DEPOT/WHDAILY (or SBMJOB it)
Run the weekly cycleCALL DEPOT/WHWEEK
Run the monthly cycleCALL DEPOT/WHMONTH
Run the annual cycleCALL DEPOT/WHYEAR

The batch drivers take no CALL parameters; a scheduled submission is a bare CALL. Only WHMENU, WHSTKIQ and WHPCKIQ are interactive; every batch program runs to completion and DSPLYs a one-line summary per step.

Honest statement on dates. DEPOT/i has no LNCTL-style batch control row. The processing dates the programs stamp onto stock and ledger rows are hard-coded literals in the source: the daily chain writes 20260801, the weekly replenishment 20260807, the monthly close 20260831, and the annual run 20261231 (and WHGLPST posts batch 202608). To move the app to a different processing date you change the source and recompile; there is no operator date parameter or control table to advance.

B.2 Menu & the two inquiry screens

WHMENU (over WHMENUD) is a plain menu: option 1 CALLs WHSTKIQ, option 2 CALLs WHPCKIQ, any other non-blank value shows “Invalid option.”; F3 exits. Both inquiries are read-only — the online layer inspects stock and picks, it does not post movements.

Stock Inquiry — WHSTKIQ / WHSTKD (plain DSPF)

Key an item number and a location; the screen chains the item master (description, unit cost) and the location master (bin type, zone), then walks that item's stock rows for the named bin and shows the on-hand, allocated and the derived pickable figure (SQTY − SALLOC).

Stock Inquiry - DEPOT/i Item number: WG100001 Location: A-01-01 Description . : WIDGET BLUE 50MM Bin type . . . : F Zone . . . . . : PF Lot number . . : L2601 On hand . . . : 70 Allocated . . : 0 Pickable . . . : 70 Unit cost . . : 3.5000 Stock found. F3=Exit Enter=Inquire
FieldType (DDS)Shows
IITEM8A input/outputItem number to look up.
ILOC10A input/outputLocation (bin) to look up.
DDESC / DCOST30A / 14A outputItem description / unit cost (from WHITEM).
DLTYPE / DZONE1A / 2A outputBin type / zone (from WHLOC).
DLOT8A outputLot in that bin.
DQTY / DALLOC / DPICK14A outputOn hand / allocated / pickable (derived).
DMSG50A output“Stock found.” / “No stock in that bin.” / “Item not found.”

Wave Pick List Inquiry — WHPCKIQ / WHPCKD (subfile)

The app's subfile screen. Key a wave number; the program clears the subfile and reloads it from WHPICK for that wave (record PSFL under control PCTL, SFLPAG(5) per page, SFLSIZ(20), ROLLUP/ROLLDOWN paging and SFLEND(*MORE)). It totals the pick lines, units and open-line count into the header fields.

Wave Pick List - DEPOT/i Wave number: 8001 Pick lines . . : 2 Total units . : 50 Open lines . . : 0 Seq Item From bin Quantity S Order 1001 WG100001 A-01-01 30 C OR000501 1102 GZ200001 A-01-02 20 C OR000501 Wave found. F3=Exit Roll=Page Enter=Inquire
FieldType (DDS)Shows
IWAVE5Y0 input/outputWave number to display.
SSEQ4Y0 outputPick walk sequence (PSEQ).
SITEM / SFROM8A / 10A outputItem / source bin.
SQTYD / SSTAT12A / 1A outputPick quantity / status (O open, C confirmed, S short, X cancelled).
SORD8A outputOrder number the pick belongs to.
DWCNT / DWQTY / DWOPEN12A outputHeader totals: pick lines / total units / open lines.
The subfile is genuinely cleared and reloaded each pass: the program writes the control record with the SFLCLR indicator (*IN31) on after the EXFMT and before the load loop, so a re-enquiry never shows the previous wave's rows. See F.5 for the one-column-left indicator placement this DDS uses so the emulator's parser reads the conditioning indicators correctly.

B.3 Controls & audit workflow (no four-eyes maker–checker)

Honest statement: DEPOT/i does not model a true four-eyes maker–checker / separate-authorization workflow, and it has no user-level security or approval gate in the application code: a batch step posts its movements the moment it runs, and the online screens are read-only. The manual documents the control model the application does have:

In sum, the control posture is durable movement audit + stable-key idempotency + status/state gating + capacity/policy enforcement, rather than a segregation-of-duties approval workflow or a security model.

C. Batch Jobs & the Periodic Cycle ↑ top

DEPOT/i's work runs as four periodic cycles, each packaged as a CL program that adds DEPOT to the library list and CALLs its steps in order: a daily receive-pick-ship chain, a weekly replenishment + slow-mover review, a monthly count-variance close + valuation + GL post, and an annual wall-to-wall physical inventory + pick-face re-slot. Every batch program takes no CALL parameters and stamps hard-coded processing dates (see B.1).

-- run a cycle interactively, or submit it as a batch job
CALL DEPOT/WHDAILY
SBMJOB CMD(CALL PGM(DEPOT/WHDAILY)) JOB(WHDAILY)

C.1 Full batch program set

ProgramCyclePurposeFiles touchedDSPLY summary
WHPUTWYDailyReceive & put away open receipt lines.WHRCPT, WHITEM, WHLOC, WHSTK, WHSTKLF, WHMOVEPUTAWAY=/SKIP=/REJECT=
WHWAVEDailyRelease open orders into a pick wave (FEFO, pick faces only).WHORD, WHORDL, WHSTK, WHLOC, WHPICKWAVE=/PICKS=/SHORT=/SKIP=
WHPCKPRDailyPrint the wave pick list (PRTF, page overflow).WHPICK, WHPCKPLINES=/UNITS=
WHPKCFMDailyConfirm open picks: pick face → staging lane.WHPICK, WHSTK, WHORDL, WHMOVECONFIRMED=/UNITS=/SKIP=
WHDSPCHDailyDespatch fully-picked orders off the staging lane.WHORD, WHORDL, WHSTK, WHMOVEORDERS=/LINES=/SKIP=
WHREPLWeeklyReplenish pick faces below min from reserve (whole case packs).WHITEM, WHSTK, WHLOC, WHMOVEMOVED=/SKIP=
WHSLOWWeeklyRe-rank each item's ABC class by shipped throughput.WHITEM, WHMOVEA=/B=/C=
WHCNTPSMonthlyPost cycle-count variances; correct the book.WHCNT, WHSTK, WHMOVEADJUSTED=/NET=/SKIP=
WHVALUEMonthly/AnnualValue stock at unit cost, split by location type.WHSTK, WHITEM, WHLOCROWS=/TOTAL=/RESERVE=/FORWARD=/STAGED=
WHGLPSTMonthlyPost the movement ledger to the SQL GL feed as balanced pairs.WHMOVE, WHITEM, WHGLFEED (SQL)BATCH=/ROWS=
WHPHYSAnnualFull physical count (reserve bins count 1 short); correct book.WHSTK, WHLOC, WHMOVEADJUSTED=/NET=/SKIP=
WHRESLTAnnualStamp item velocity class onto pick-face slots (upgrade only).WHITEM, WHSTK, WHLOC, WHMOVERESLOTTED=/SKIP=
WHMOVRPW/M/AILE COBOL ledger reconciliation report.WHMOVEPUTAWAY/INTERNAL/SHIPPED/ADJUSTED/MOVES

C.2 Daily / weekly / monthly / annual detail

Daily — WHDAILY (WHPUTWY → WHWAVE → WHPCKPR → WHPKCFM → WHDSPCH)

WHPUTWY walks the open receipt lines. Put-away policy is deterministic: honour an explicit RPUTLOC; else send a hazmat item to C-09-01 (the segregated rack) and everything else to B-05-01 (the default reserve). It sums what is already in the target bin through the location-keyed WHSTKLF path and refuses to overfill (LCAP); it takes the quantity off the dock, adds it into the bin (creating the row if new), writes a 'P' ledger row naming both bins, and flips the receipt to RSTAT='P'. WHWAVE allocates each open order's lines against forward-pick-face stock only, reserving via SALLOC (never moving SQTY), and writes one pick row per source in aisle-walk (LSEQ) order. WHPCKPR prints that wave. WHPKCFM confirms each open pick — SQTY falls in the pick face and rises in the staging lane by the same amount, SALLOC is released, a 'K' ledger row is written, the order line's OPICKQ rolls up. WHDSPCH ships every order whose lines are all fully picked: it draws the quantity off the staging lane, writes a negative 'D' ledger row (MTO blank), and rolls the header to OSTAT='D'.

Expected DSPLY (the wh_daily scenario: receipt R0000101 + order OR000501):
  WHPUTWY PUTAWAY=2 SKIP=0 REJECT=0
  WHWAVE  WAVE=8001 PICKS=2 SHORT=0 SKIP=0
  WHPCKPR LINES=2 UNITS=50
  WHPKCFM CONFIRMED=2 UNITS=50 SKIP=0
  WHDSPCH ORDERS=1 LINES=2 SKIP=0        WG total 840 -> 810, GZ 250 -> 230

Weekly — WHWEEK (WHREPL → WHSLOW → WHMOVRP)

WHREPL walks the item master. For each active item it sums what sits in forward pick faces; if that total is below IMINQ it computes the gap to IMAXQ, rounds it up to a whole case pack (IPKQTY — a picker moves cartons), finds a reserve bin holding that lot with enough free stock, and moves the quantity down (out of reserve, into the pick face), writing a 'T' ledger row naming both bins. It is a pure internal move — the total is unchanged. WHSLOW re-ranks each item's ABC class by units actually shipped ('D' ledger rows): ≥40 → A, ≥10 → B, else C (slow mover). WHMOVRP reconciles the ledger.

Expected DSPLY (the wh_cycles weekly scenario):
  WHREPL MOVED=2 SKIP=...              WG face 20+108=128 (reserve 500-108=392);
  WHSLOW A=1 B=1 C=...                SP face 10+250=260 (reserve 300-250=50)
  WHMOVRP INTERNAL   358.00           108 + 250 units moved internally
  WHMOVRP SHIPPED    -57.00           -45 + -12 shipped

Monthly — WHMONTH (WHCNTPS → WHVALUE → WHGLPST → WHMOVRP)

WHCNTPS posts each open count sheet line: it compares the counted quantity against the book quantity in that bin now, and if they differ corrects SQTY and writes a signed 'A' ledger row (both bins blank — nothing moved). A zero-variance line is left open, not falsely posted. WHVALUE values every stock row at the item's unit cost and reports the total split by location type (reserve / forward / staged — staged stock is already committed revenue). WHGLPST totals the ledger by type, values it at cost, and posts balanced DR/CR pairs into WHGLFEED, continuing the GLSEQ sequence and posting only the movement since the last close. WHMOVRP reconciles.

Expected figures (the wh_cycles monthly scenario):
  WHCNTPS ADJUSTED=1 NET=-3            counted bin 128 -> 125
  WHVALUE RESERVE=6209.50 FORWARD=1832.50 STAGED=...
  GL: 5000-CGS (CGS)   445.50         45x3.5000 + 12x24.0000
      5900-SHR (shrink) 10.50         3 units short x 3.5000
      1400-INV credited 456.00        445.50 shipped + 10.50 shrunk; SUM(DR)=SUM(CR)

Annual — WHYEAR (WHPHYS → WHRESLT → WHVALUE → WHMOVRP)

WHPHYS counts the building. Its deterministic convention: every stocked reserve bin counts 1 unit short (pallet-face shrinkage), every other bin clean; it corrects the book and writes a signed 'Y' ledger row (both bins blank). WHRESLT stamps each item's velocity class (IABC) onto the pick-face bins holding it, but only ever upgrades a slot (A beats B beats C) so a shared bay is deterministic and re-runs are stable; it writes an 'S' ledger row per re-slotted item. WHVALUE re-values, WHMOVRP reconciles.

Expected DSPLY (the wh_cycles annual scenario):
  WHPHYS   ADJUSTED=3 NET=-3          3 reserve bins each -1 (392->391, 200->199, 50->49)
  WHRESLT  RESLOTTED=2 SKIP=...       pick faces re-slotted to the faster class

C.3 Ordering & dependencies

D. Data Files (data dictionary) ↑ top

All files are in library DEPOT, grounded in the DDS/SQL members of sources.mjs. Dates are stored as zoned/packed integers in YYYYMMDD form; money is DECIMAL (unit cost is 11P4, to fractions of a cent). Field types are shown in DDS notation: A=alphanumeric, P=packed decimal, S=zoned decimal.

WHLOC — Location (bin) master (K WHSE, LOCID)

FieldTypeMeaning
WHSE3AWarehouse code (seeded DC1) (K).
LOCID10ABin coordinate, e.g. A-01-01 (K).
LDESC25ABin description.
LTYPE1AR reserve, F forward pick face, S staging/despatch, D dock/receiving.
LZONE2AZone (DK/PF/RS/SH).
LCAP9P2Capacity in units; put-away refuses to overfill.
LSEQ5S0Pick-walk sequence (pickers walk in LSEQ order).
LVELOC1AVelocity class (A/B/C) the annual re-slot stamps.
LSTAT1AStatus (A active).

Seeded set: 1 dock (DOCK-IN-01), 2 forward pick faces (A-01-01 LSEQ 100, A-01-02 LSEQ 110), 3 reserve racks (B-05-01/02, C-09-01), 1 staging lane (SHIP-LN-01). Pick faces walk before reserve racks.

WHITEM — Item master (K ITEMNO)

FieldTypeMeaning
ITEMNO8AItem number (K), e.g. WG100001.
IDESC30ADescription.
IUOM3AStocking unit (EA).
IPKQTY9P2Case pack — the granularity replenishment moves in.
IMINQ / IMAXQ9P2Forward-pick min/max (drives weekly replenishment).
ICOST11P4Unit cost, to fractions of a cent.
IHAZMAT1AY/N — a Y is segregated to C-09-01 on put-away.
IABC1AVelocity class (re-ranked weekly by shipped throughput).
ISTAT1AStatus (A active).

WHSTK — Stock by (item, location, lot) (K ITEMNO, LOCID, LOTNO)

The heart of the system. The composite key is why the same item lives in many bins and the same bin holds several lots. Pickable = SQTY − SALLOC.

FieldTypeMeaning
ITEMNO / LOCID / LOTNO8A / 10A / 8AItem + bin + lot (composite K).
SQTY9P2Physical on-hand in this bin.
SALLOC9P2Quantity a released wave has claimed but not yet picked.
SEXPDT8S0Lot expiry date (the FEFO pick order uses it).
SLSTDT8S0Last-movement date stamped by the posting programs.
SSTAT1AStatus (A active).

WHSTKLF is a logical file over WHSTK keyed LOCID-first then ITEMNO, LOTNO — the by-location access path (“what is in this bin?”), non-unique on LOCID by design.

WHRCPT — Inbound receipt lines (K RCPTNO, RSEQ)

FieldTypeMeaning
RCPTNO / RSEQ8A / 3S0Receipt + line number (K).
ITEMNO / LOTNO8A / 8AItem / lot received.
RQTY9P2Quantity received.
RDOCK10ADock the carrier dropped it in.
RPUTLOC10AExplicit put-away bin (blank = policy decides).
REXPDT8S0Lot expiry.
RSTAT1AO open, P put away, X cancelled.

WHORD / WHORDL — Despatch order header / lines

FieldTypeMeaning
ORDNO8AOrder number (K on both).
CUSTNO / CUSTNM6A / 25ACustomer number / name (header).
ODATE / OSHIPDT8S0Order / ship date (header).
OWAVE5S0Wave the order was released into (0 while open) (header).
OSTAT1AO open, R released, P picked, D despatched, X cancelled (header).
OCARR4ACarrier code (header).
OLSEQ3S0Line number (line K).
OQTY / OPICKQ / OSHIPQ9P2Ordered / picked / shipped quantity (line).
OLSTAT1AO open, R released, P picked, D despatched (line).

WHPICK — Wave pick instructions (K WAVENO, PSEQ)

FieldTypeMeaning
WAVENO / PSEQ5S0 / 5S0Wave + pick walk sequence (K).
ORDNO / OLSEQ8A / 3S0Order + line this pick serves.
ITEMNO / LOTNO8A / 8AItem / lot to pick.
PFROM / PTO10A / 10ASource bin / staging lane destination.
PQTY / PCONFQ9P2Instructed / confirmed quantity.
PSTAT1AO open, C confirmed, S short, X cancelled.

WHPCKLF is a logical file over WHPICK keyed PSTAT-first — the by-status access path (read only the open picks to confirm, the confirmed ones to despatch).

WHMOVE — Movement ledger (K MSEQ, UNIQUE)

The durable audit trail and the arbiter of conservation. Every WHSTK quantity change writes one row. MSEQ is a stable, disjoint-per-program key (see F.2), so all programs accumulate into one history and re-runs are refused.

FieldTypeMeaning
MSEQ8S0Movement sequence (K, unique, derived from a business key).
ITEMNO / LOTNO8A / 8AItem / lot moved.
MTYPE1AP put-away, K pick, D despatch, T replenish, A cycle-count, Y physical, S re-slot.
MDT8S0Movement date (YYYYMMDD).
MQTY9P2Signed quantity (negative for despatch; signed for variances).
MFROM / MTO10A / 10AThe two sides of the move; blank where not applicable.
MREF8ABusiness reference (receipt / order / literal like REPLEN).
MMEMO25AHuman-readable memo.

WHCNT — Cycle-count sheets (K CSHEET, CSEQ)

FieldTypeMeaning
CSHEET / CSEQ6S0 / 3S0Count sheet + line (K).
ITEMNO / LOCID / LOTNO8A / 10A / 8AWhat was counted, and where.
CBOOK9P2Book quantity captured (the before-image, written at posting).
CCOUNT9P2Quantity the counter keyed.
CDT8S0Count date.
CSTAT1AO open, P posted, X void.

WHCARR — Carrier master (K CARRCD)

FieldTypeMeaning
CARRCD4ACarrier code (K), e.g. RDX1, PLT2.
CARRNM / CARRSVC25A / 10ACarrier name / service level.
CARRSTA1AStatus (A active).

WHGLFEED — SQL GL feed (PK GLSEQ)

FieldTypeMeaning
GLSEQDECIMAL(8,0)GL sequence (PK), continued across closes.
GLBATCHDECIMAL(6,0)Posting batch (YYYYMM).
ACCTCHAR(9)Account: 1400-INV, 2100-GRN, 5000-CGS, 5900-SHR.
DRCRCHAR(1)D debit / C credit.
AMTDECIMAL(11,2)Posting amount.
GLREF / GLDTCHAR(8) / DECIMAL(8,0)Reference / date.

Index WHGLFACC on (ACCT, DRCR) supports the “posted-to-date” sums WHGLPST reads to post only the incremental movement each close.

Relationships

E. Operations Runbook ↑ top

E.1 Day-in-the-life

  1. One-time build: CALL DEPOT/WHSETUP then CALL DEPOT/WHREFLD; confirm the “setup complete” banner and that WHREFLD reports LOCS=7 ITEMS=5 CARRIERS=2.
  2. Book the day's inbound receipts into WHRCPT (RSTAT=O) and the day's despatch orders into WHORD/WHORDL (OSTAT=O).
  3. Submit the daily cycle: SBMJOB CMD(CALL PGM(DEPOT/WHDAILY)).
  4. Post-check the daily run (below), and use WHSTKIQ / WHPCKIQ to inspect a bin or a wave as questions arise.

Pre-checks: confirm the job's library list includes DEPOT; confirm receipts are RSTAT='O' and orders OSTAT='O' (anything else is skipped).

Post-checks after the daily cycle:

E.2 Month-end & annual close

  1. Weekly, through the month: submit WHWEEK — replenish pick faces and re-rank ABC. Confirm WHREPL MOVED= matches the items below their pick-face minimum and WHMOVRP INTERNAL equals the replenished units (a pure internal move).
  2. Month-end: raise cycle-count sheets in WHCNT (CSTAT=O), then submit WHMONTH. Confirm WHCNTPS ADJUSTED=/NET=, the WHVALUE split, and that the GL feed is balanced.
  3. Reconcile the GL: SUM(DR) must equal SUM(CR) and be non-zero; the feed row count is even (every posting is a pair).
  4. Year-end: submit WHYEAR — physical count, re-slot, re-value, reconcile. Confirm the reserve bins each fell by 1 and the pick faces carry the re-slotted velocity class.
SELECT ACCT, DRCR, SUM(AMT) FROM DEPOT.WHGLFEED GROUP BY ACCT, DRCR;
SELECT SUM(CASE WHEN DRCR='D' THEN AMT ELSE 0 END) AS DR,
       SUM(CASE WHEN DRCR='C' THEN AMT ELSE 0 END) AS CR FROM DEPOT.WHGLFEED;

E.3 Reconciling inventory balances

The site balance for an item is reconciled against the movement ledger. Opening on-hand plus every non-internal ledger delta must equal the closing on-hand — internal moves (put-away 'P', pick 'K', replenish 'T', re-slot 'S') net to zero across bins, so only despatch 'D' and count variances 'A'/'Y' change the total.

SELECT ITEMNO, SUM(SQTY) AS ONHAND FROM DEPOT.WHSTK GROUP BY ITEMNO;
SELECT ITEMNO, MTYPE, SUM(MQTY) FROM DEPOT.WHMOVE
  WHERE MTYPE IN ('D','A','Y') GROUP BY ITEMNO, MTYPE;

E.4 Failure & re-run rules

Each program DSPLYs a one-line summary. Because every posting derives a stable, disjoint ledger key and guards each write with CHAIN(EN), and because each step also gates on record status, the cycles are safe to re-submit.

SituationBehaviourAction
Daily chain fails partwayPut-away rows that posted are RSTAT='P'; the rest stay 'O'.Re-submit WHDAILY: posted rows are skipped (stable key + status guard), the rest process. Idempotent.
Re-run WHPUTWY / WHWAVE / WHPKCFM / WHDSPCHPUTAWAY=0 / PICKS=0 / CONFIRMED=0 / ORDERS=0; no double move.Safe no-op — the ledger gains no rows and totals do not fall twice.
Put-away rejected (REJECT>0)Target bin would overfill; the receipt line stays RSTAT='O'.Direct it to a bin with room via RPUTLOC, or free capacity, then re-run.
Wave line short (SHORT>0)Not enough pick-face stock; the order line is not marked released unless something was picked.Run WHREPL to top up the pick face, then re-release.
Re-run WHREPL / WHCNTPS / WHPHYS / WHRESLTMOVED=0 / ADJUSTED=0 / RESLOTTED=0.Naturally idempotent for a fixed state — the stable key refuses a second post.
Re-run WHGLPSTRe-totals the whole ledger but posts only the incremental movement since the last close; a refused insert is not counted.Safe — the sequence continues and the feed stays balanced (this was a fixed defect: see F.3).
Because every quantity change is journaled to WHMOVE with both sides named (or blank for a variance), and the COBOL WHMOVRP re-derives the flows from it, any cycle's effect on the balance is fully reconstructable after the fact for reconciliation and recovery.

F. Developer Reference ↑ top

The programs are fixed-form + free-form RPG IV (with one ILE COBOL and one SQLRPGLE), driving keyed DISK files by CHAIN/READE/UPDATE/WRITE. All objects are in library DEPOT.

F.1 Put-away / pick / despatch programs

WHPUTWY — receive & put away
Reads open WHRCPT lines; decides the bin (explicit RPUTLOC, else hazmat → C-09-01 / else B-05-01); sums the target via the location-keyed WHSTKLF and rejects an overfill; moves off the dock into the bin; writes a 'P' ledger row; flips RSTAT='P'.
WHWAVE — wave pick release
For each open order, allocates each line against forward pick faces only (LTYPE='F'), reserving SALLOC without moving SQTY; writes one WHPICK row per source keyed on a pseq that folds in the order digits, the location LSEQ and the order line; marks the line released only if something was actually picked.
WHPKCFM — pick confirmation
For each open pick, subtracts from the pick face (releasing SALLOC) and adds to the staging lane (creating the row if new); writes a positive 'K' ledger row naming both bins; rolls OPICKQ up and flips the line to P when fully picked.
WHDSPCH — despatch
Two passes per order: pass 1 checks every line is OLSTAT='P'; pass 2 draws each line's quantity off the staging lane, writes a negative 'D' ledger row (MTO blank), records OSHIPQ, and rolls the header to OSTAT='D'.
WHREPL / WHSLOW / WHCNTPS / WHVALUE / WHPHYS / WHRESLT
The weekly, monthly and annual programs described in C.2 — replenishment (whole case packs, internal 'T' move), ABC re-rank by shipped throughput, count-variance post ('A'), value-by-location-type, physical count ('Y'), and upgrade-only pick-face re-slot ('S').

F.2 The movement-ledger key scheme (disjoint ranges)

WHMOVE.MSEQ is UNIQUE and each program derives its key from a stable business key inside a disjoint 10-million-wide band, so a re-run regenerates the same key and the CHAIN(EN) guard refuses it — the mechanism that makes every cycle idempotent.

ProgramMTYPEKey formula
WHPUTWYP10000000 + receipt digits*100 + line
WHPKCFMK20000000 + wave*1000 + pick seq
WHDSPCHD30000000 + order digits*100 + line
WHREPLT40000000 + item digits*100 + occurrence
WHCNTPSA50000000 + count-sheet*100 + line
WHPHYSY60000000 + item digits*10 + bin ordinal
WHRESLTS70000000 + item digits

F.3 The GL posting model (WHGLPST)

The monthly post totals the ledger by type, values it at unit cost, reads the posted-to-date sums from WHGLFEED, and posts only the incremental movement as balanced pairs:

Fixed defect (documented in the source). The program re-totals the whole movement ledger every run and derives GLSEQ from it. Starting the sequence at 1 made month 2 re-derive month 1's keys; the inserts were correctly refused, but the return code was not checked, so the job reported success while the GL feed silently stopped tracking the ledger from month two on. The fix continues the sequence from MAX(GLSEQ), posts only the incremental movement (against the posted-to-date sums), and counts a row only when sqlcod = 0.

F.4 File-cursor & access-path patterns

F.5 Engine-compatibility notes

Two accommodations are documented in the source so the app behaves correctly on the emulator:

G. Glossary ↑ top

ABC class / velocity
A ranking of items by throughput: A fast (≥40 units shipped), B (≥10), C slow. Re-ranked weekly by WHSLOW from shipped ledger rows; stamped onto pick-face slots annually by WHRESLT.
Case pack (IPKQTY)
The quantity in one carton — the granularity replenishment moves in (a picker moves cartons, not loose units), so a top-up is rounded up to a whole case pack.
Conservation invariant
The core rule that a warehouse move conserves stock: SUM(SQTY) over all bins for an item is unchanged by put-away, pick, pick-confirm and replenishment. Only receiving, despatch and count variances change it, each with a signed ledger row.
Cycle count / physical count
Counting stock and correcting the book: a cycle count (WHCNTPS, 'A') counts selected sheets monthly; a physical count (WHPHYS, 'Y') counts the whole building annually. Both write a variance row with no bins named.
Dock / staging lane
Non-storage bins: the dock (LTYPE='D') is inbound-only, the staging lane (LTYPE='S') outbound-only. Stock is booked to the dock on receipt and leaves the site from the staging lane on despatch.
FEFO
First-Expiry-First-Out — the pick order that draws the earliest-expiry lot first, using SEXPDT.
Forward pick face vs reserve
A forward pick face (LTYPE='F') is the small, hand-pickable bin picking draws from; a reserve (LTYPE='R') is bulk pallet storage, not hand-pickable, that replenishes the pick face.
Idempotent
Safe to run again with the same result. Every DEPOT/i posting is idempotent by a stable, disjoint ledger key (F.2): a re-run regenerates the same MSEQ and the CHAIN(EN) guard refuses the duplicate.
Movement ledger (WHMOVE)
The durable, unique-keyed audit trail: one row per quantity change, naming type, quantity, both bins (where applicable), a reference and a memo. The arbiter of conservation.
Pickable
On-hand less what a released wave has reserved: SQTY − SALLOC. Shown on the stock inquiry.
Put-away
Moving a received line off the dock into a storage bin (honour explicit bin, else segregate hazmat, else default reserve), respecting bin capacity.
SBMJOB
Submit Job — the IBM i command that queues a program to run as a batch job (e.g. SBMJOB CMD(CALL PGM(DEPOT/WHDAILY))).
Subfile
A 5250 display construct listing many rows on one screen (DDS SFL/SFLCTL). WHPCKIQ's wave pick list is a subfile; the operator keys a wave and the rows reload.
Wave
A batch of order lines released together for picking (WHWAVE), sequenced in aisle-walk (LSEQ) order so a picker walks the aisle once.