Retail organizations generate enormous daily detail: every scan at every register becomes lines in a POS extract landing on the mainframe overnight. Merchandising analysts need store totals by department; finance needs sales net of returns aligned to fiscal calendar; loss prevention needs exception listings for void-heavy cashiers. Easytrieve report programs remain a workhorse for these batch listings because REPORT control breaks, sequential FILE throughput, and familiar PROC structure fit high-volume rollups. This real-project page walks beginners through a representative retail reporting chain—not one vendor-specific format but patterns repeated across department stores, grocery, and specialty retail. You will see typical input layouts, validation and enrichment steps, break-level report design, promo and markdown handling, reconciliation with inventory feeds, scheduling dependencies, and operational checks merchandising support teams use when totals do not match the POS controller dashboard.
Store operations close registers; extract jobs package transactions with store number, register, timestamp, SKU or UPC, quantity, extended amount, tender type, transaction type (sale, return, void), and promotional flags. Easytrieve batch jobs start after extract success—often a JCL dependency on POSDAILY(+1) GDG. Downstream consumers include district managers (PDF or printed reports via AFP), finance general ledger bridges, and inventory adjustment workflows. Missing a batch window means morning merchandising decisions run on stale data; overtolerance of bad records distorts comp-store metrics. Programs must balance throughput, accuracy, and auditable exception handling.
| Stage | Input | Easytrieve role | Output |
|---|---|---|---|
| Extract landing | POS daily sequential file | Validate and classify rows | Clean work file + exception file |
| Enrichment | SKU / item master | LOOKUP department, class, cost | Enriched transaction file |
| Rollup report | Enriched file sorted by store, dept | REPORT with BREAK-LEVEL | Store/dept sales listing |
| Finance bridge | Aggregated totals | FORMAT GL interface records | Finance staging dataset |
| Reconcile | Controller control totals | Compare counts and amounts | Mismatch exception report |
Layouts vary by POS vendor; beginners should obtain the enterprise data dictionary. A simplified teaching layout might include STORE-NUM (5 numeric), TRAN-DATE (8), REGISTER (3), SKU (12), QTY-SOLD (signed numeric), EXT-AMT (signed packed), TRAN-TYPE (1 char: S/R/V), PROMO-CODE (4). Easytrieve FILE definition maps offsets; production uses macros from the retail application library so every program agrees on EXT-AMT scale and sign.
123456789FILE POS-DAILY STORE-NUM 5 N TRAN-DATE 8 N REGISTER-ID 3 N SKU 12 A QTY-SOLD 5 N SIGN EXT-AMT 7 P 2 TRAN-TYPE 1 A PROMO-CODE 4 A
Retail feeds include closed stores still transmitting, test SKUs, and duplicate sequence rows after extract retries. Validation PERFORM checks: STORE-NUM exists on store master, SKU not spaces, TRAN-TYPE in allowed set, EXT-AMT sign matches TRAN-TYPE rules. Failures WRITE EXCEP-FILE with reason code and original record image. CNT-BAD-REC increments; header SYSPRINT documents count for operations. Finance prefers controlled exceptions over silent exclusion—reconcile teams reprocess EXCEP after master fixes. See validation framework and error handling pattern pages for reusable skeletons.
POS files carry SKU; reports show department and merchandise class. Load SKU master into memory table at job start (INIT procedure) or read keyed VSAM during JOB INPUT depending on size and site standards. PERFORM ENRICH-SKU sets DEPT, CLASS, and COST for margin reports. Promotional calendar lookup maps PROMO-CODE to campaign id for marketing analytics. When lookup misses, route to exception or default to UNKNOWN class per standards—document which choice finance approved.
District managers expect subtotals when store changes and department subtotals within store. REPORT activity sorts input by STORE-NUM, DEPT (presorted upstream or SORT activity). BREAK-LEVEL 1 on STORE-NUM triggers AFTER-BREAK store totals; BREAK-LEVEL 2 on DEPT for department lines. BEFORE-BREAK resets accumulators; LINE prints detail optional when report is summary-only. TITLE macros insert chain logo text, run date, and extract generation timestamp. Footing prints page numbers and grand totals reconciled to SYSPRINT control counts.
1234567891011121314REPORT STORE-SALES BREAK-LEVEL STORE-NUM BREAK-LEVEL DEPT-CODE BEFORE-BREAK. PROC PERFORM RESET-DEPT-ACCUM END-PROC AFTER-BREAK. PROC WHEN DEPT-CODE PRINT DEPT-SUBTOTAL-LINE WHEN STORE-NUM PRINT STORE-SUBTOTAL-LINE END-PROC
Exact WHEN grammar follows your release manual; adapt to documented AFTER-BREAK break-level handling. Grand totals must tie to sum of store totals—reconciliation PROC compares to controller file.
TRAN-TYPE R multiplies or signs amounts negative per business convention—never assume without spec. Voids may zero out paired sale rows; some chains net at extract time, others require Easytrieve pairing logic (advanced; often handled upstream). Markdown reports filter PROMO-CODE or price-change reason codes from reference file. Separate PERFORM keeps regular sales report clean while markdown listing job shares same FILE macros.
Merchandising compares sales movement to inventory shrink reports. Easytrieve jobs join aggregated SKU quantities to inventory snapshot files—multi-file JOB with MATCH logic or work file from prior step. Mismatch report lists SKU, sold qty, expected on-hand delta, variance percent. Schedule after both POS rollup and inventory extract complete. These jobs are audit-sensitive; retain control totals and job logs per retention policy.
Imagine every lemonade stand in town sends a list of cups sold at end of day. Retail reporting is adding up those lists: first check each line makes sense (real stand number, not typo), then group cups by stand and by flavor, print a summary for the boss, and set aside messy lines in a pink envelope to fix tomorrow. Easytrieve is the helper that reads all the lists, sorts them, adds them, and prints the summary pages automatically.
1. Retail POS extracts typically arrive as:
2. Store-level subtotals in retail reports commonly use:
3. Invalid SKU or store records should:
4. Markdown and promotional pricing often requires:
5. Retail reporting jobs usually run: