Easytrieve Customer Master Update Projects

Customer master data—names, addresses, credit terms, tax flags, contact preferences—feeds billing, collections, marketing mail, and regulatory reporting. When data stewards submit changes from web portals, branch forms, or vendor feeds, batch Easytrieve jobs validate transactions and produce updated master generations with audit trails. Unlike read-only report jobs, master update projects read change files, match on customer id, apply ADD CHANGE DELETE logic, reject invalid rows, and write new master output consumed by invoice generation and statement jobs later the same night. This tutorial explains change file layouts, merge-apply algorithms, validation modules, exception handling, audit history files, sequential versus VSAM update strategies, and control counts operations use before swapping production master.

Progress0 of 0 lessons

Change Transaction File Layout

text
1
2
3
4
5
6
7
8
9
10
11
FILE CHGTRAN ACTION-CODE 1 A CUST-ID 9 NUM CUST-NAME 30 A ADDR-LINE1 30 A ADDR-LINE2 30 A CITY 20 A STATE-CODE 2 A ZIP-CODE 9 A CHG-DATE 8 NUM CHG-USER 8 A

ACTION-CODE values: A add, C change, D delete—document exact codes in header comment. CUST-ID is match key to master. Change file may carry full record image on change or partial fields with overlay semantics—shop standard must define whether blank ADDR-LINE2 means clear field or leave unchanged.

Action Code Processing

Customer master action codes and behavior
CodeMeaningTypical behavior
AAdd new customerInsert if CUST-ID not in master; else exception duplicate
CChange existingUpdate fields if CUST-ID found; else exception not found
DDelete / deactivateMark inactive flag or omit from new master per policy
RReactivate (if used)Clear inactive flag on previously deleted customer

Merge-Apply Pattern (Two-File Match)

Classic pattern: SORT master and changes by CUST-ID. Single pass merge: read master and change in lockstep comparing keys. When keys equal, apply change to master buffer and WRITE new master row. When change key lower, process add. When master key lower, copy master unchanged. Requires careful EOF handling on both files in JOB or two-step design with indexed lookup.

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
JOB INPUT CHGTRAN PERFORM VALIDATE-CHANGE IF W-ERROR-FLAG EQ 'Y' PERFORM WRITE-EXCEPTION GOTO JOB END-IF IF ACTION-CODE EQ 'A' PERFORM PROCESS-ADD ELSE IF ACTION-CODE EQ 'C' PERFORM PROCESS-CHANGE ELSE IF ACTION-CODE EQ 'D' PERFORM PROCESS-DELETE END-IF W-APPLY-CNT = W-APPLY-CNT + 1

Alternative: random READ master by CUST-ID for each change when master is VSAM KSDS—simpler logic, heavier I/O. Batch rewrite sequential generation suits nightly volume with full backup.

Validation Module

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
VALIDATE-CHANGE. PROC W-ERROR-FLAG = 'N' IF CUST-ID EQ ZEROES W-ERROR-FLAG = 'Y' W-ERROR-MSG = 'MISSING CUST ID' END-IF IF ACTION-CODE EQ 'A' AND CUST-NAME EQ SPACES W-ERROR-FLAG = 'Y' W-ERROR-MSG = 'NAME REQUIRED ON ADD' END-IF IF STATE-CODE NE SPACES SEARCH STATETAB WITH STATE-CODE GIVING ST-NAME IF NOT STATETAB W-ERROR-FLAG = 'Y' W-ERROR-MSG = 'INVALID STATE' END-IF END-IF END-PROC

Audit Trail Output

Write AUDIT-FILE row on every applied change: CUST-ID, ACTION-CODE, CHG-DATE, CHG-USER, key fields before and after when policy requires field-level history. Audit file append-only GDG supports compliance queries. Separate from exception file which captures rejected transactions only.

Delete Versus Deactivate

Regulatory and AR policy often forbids physical delete. PROCESS-DELETE sets INACTIVE-FLAG Y and INACTIVE-DATE rather than omitting record from new master. Invoice jobs filter IF INACTIVE-FLAG NE Y. Hard delete reserved for test environments or GDPR programs with legal approval and documented retention destruction.

Control Totals and Swap Discipline

  • W-READ-CNT change transactions read.
  • W-APPLY-CNT successfully applied.
  • W-EXCEPT-CNT rejected validations.
  • W-MASTER-OUT-CNT records on new master generation.
  • Compare W-MASTER-OUT-CNT to prior master count plus adds minus deletes within tolerance.

Operations backs up current master before swap. New generation renamed or repro loaded to VSAM only after control report sign-off. Rollback plan restores backup generation if downstream billing job fails.

Sample JCL

text
1
2
3
4
5
6
7
8
//CUSTUPD EXEC PGM=EZTPA00,REGION=0M //SYSPRINT DD SYSOUT=* //SYSIN DD DSN=MDM.LIB(EZTCUSTU),DISP=SHR //OLDMAST DD DSN=CUST.MASTER.CURRENT,DISP=SHR //CHGTRAN DD DSN=CUST.CHANGES(+1),DISP=SHR //NEWMAST DD DSN=CUST.MASTER.NEW(+1),DISP=(,CATLG,DELETE) //AUDIT DD DSN=CUST.AUDIT(+1),DISP=(,CATLG,DELETE) //EXCEPT DD DSN=CUST.CHNG.EXCEPT(+1),DISP=(,CATLG,DELETE)

Integration With Downstream Jobs

Scheduler dependency: CUSTUPD completes before INVGEN and STMTGEN. Master refresh late in window may delay billing—monitor W-EXCEPT-CNT threshold that blocks swap when too many errors indicate bad vendor feed. Staged validation environment applies same job against copy master before production feed.

Explain It Like I'm Five

Customer master update is like keeping the class phone book current. Friends bring notes saying add this person, fix that address, or remove someone who moved away. Easytrieve checks each note makes sense, updates the phone book, and keeps a diary of every change. If a note is messy, it goes on the ask-the-teacher list instead of ruining the whole book.

Exercises

  1. Define CHGTRAN and VALIDATE-CHANGE. PROC with three rules.
  2. Document action codes A, C, D behavior in program header.
  3. Design audit row fields for one address change.
  4. List four control counts for master swap sign-off.
  5. Compare VSAM in-place update versus sequential rewrite trade-offs.

Frequently Asked Questions

Quiz

Test Your Knowledge

1. Customer master update jobs typically read:

  • Change transaction file with action code
  • Compiler listing only
  • REPORT TITLE lines
  • SCREEN map definitions

2. Action code ADD when customer already exists should:

  • Reject to exception or route per duplicate policy
  • Silently overwrite without log
  • Delete master file
  • Skip validation

3. Master update audit trail records:

  • Before and after values with change date and user id
  • Only SYSPRINT page count
  • Random numbers
  • MACRO names

4. Sequential master rewrite pattern writes:

  • New master generation sorted by key
  • Only changed records unsorted
  • Empty file
  • JCL only

5. Validation on address change often checks:

  • Required fields, postal format, and state code lookup
  • Line number in source listing
  • Compiler version
  • PF keys
Published
Read time19 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Mainframe customer master maintenance batch with EasytrieveSources: Broadcom Easytrieve 11.6 file update processing, master data governance practicesApplies to: Easytrieve customer master update and maintenance batch projects