Easytrieve File Conversion Projects

Mainframe estates outlive applications. A vendor upgrade changes customer master from 200-byte fixed records to 350-byte layout with new date fields. A merger brings ASCII extracts that must become standard company EBCDIC sequential files. A regulatory change demands account numbers expand from nine digits to sixteen. File conversion projects are the bridge—and Easytrieve is a practical tool for them because READ-WRITE loops, MASK formatting, TABLE lookups, and exception reports live in one program. This tutorial walks through real conversion scenarios: legacy-to-new layout mapping, packed decimal handling, date format migration, header and trailer records, validation during convert, parallel run discipline, and JCL patterns operations schedule nightly until cutover completes. Beginners should pair this page with the file copy utility and validation framework design patterns for reusable COPY and VALIDATE PROCs that conversion jobs share across dozens of interface files.

Progress0 of 0 lessons

Conversion Project Lifecycle

Phases of a production file conversion
PhaseDeliverableEasytrieve role
SpecificationOld vs new field mapLibrary DEFINE for both layouts
BuildCONVERT JOB programJOB INPUT, transform, WRITE
TestSample file parityERROR-FILE for rejects
ParallelDual pipeline countsStatistics DISPLAY in TERM
CutoverSingle authoritative targetProduction JCL switch

Dual Layout Library Section

Define OLD-RECORD and NEW-RECORD field lists in Library with explicit positions and types. Conversion clarity demands separate FILE statements for SOURCE and TARGET even when both are sequential—different LRECL values. Map field by field in CONVERT-RECORD PROC; document unmapped legacy filler as spaces in new layout. When old field splits into two new fields—combined name becomes FIRST and LAST—use PARSE or substring MOVE per release grammar.

text
1
2
3
4
5
6
7
8
9
10
11
FILE SOURCE-FILE SEQUENTIAL 200 OLD-ACCT 1 9 N OLD-NAME 10 30 A OLD-BAL 40 7 P 2 END-FILE FILE TARGET-FILE SEQUENTIAL 350 NEW-ACCT 1 16 A NEW-NAME 17 46 A NEW-BAL 47 15 N 2 END-FILE

CONVERT-RECORD PROC

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
JOB INPUT SOURCE-FILE ADD 1 TO READ-COUNT PERFORM CONVERT-RECORD IF VAL-STATUS NE ZERO PERFORM WRITE-ERROR ELSE WRITE TARGET-FILE ADD 1 TO WRITE-COUNT END-IF END-JOB CONVERT-RECORD. PROC MOVE OLD-ACCT TO NEW-ACCT MOVE OLD-NAME TO NEW-NAME MOVE OLD-BAL TO NEW-BAL PERFORM VALIDATE-CONVERTED END-PROC

VALIDATE-CONVERTED checks mandatory new fields—non-blank account, balance within range—before WRITE. Leading-zero account expansion might PERFORM PAD-ACCOUNT moving OLD-ACCT into sixteen-character NEW-ACCT with MASK.

Date Format Migration

Legacy files store dates as YYMMDD packed, Julian YYDDD, or MMDDYY display. New systems expect CCYYMMDD display or ISO strings. Conversion PROC holds intermediate WORK-DATE fields; use date functions documented in date functions tutorial—never assume implicit conversion. Document century expansion rule for YY years—70–99 map to 1970–1999 versus 2070–2099 per shop policy. Wrong century breaks age calculations downstream for decades.

Code Table Translation

Legacy status codes A/B/C map to new codes 01/02/03. Load CODE-XREF TABLE in INIT-JOB; SEARCH in CONVERT-RECORD sets NEW-STATUS from OLD-STATUS. Unmapped codes set VAL-STATUS and ERROR-FILE row—do not default silently to zero unless spec allows. TABLE-driven conversion survives code set changes without recompiling IF ladders when operations maintain TABLE file.

Header and Trailer Handling

Header records

IF RECORD-TYPE = 'H' on first row: WRITE new-format header with conversion run date and source file identifier; skip or transform per spec. Some conversions strip old headers and write new standard header only once in INIT-JOB.

Trailer records

Accumulate WRITE-COUNT and amount sums in JOB; at EOF after detail loop, PERFORM WRITE-TRAILER moving counts to new trailer layout. Downstream validation jobs compare trailer to detail—missing trailer is cutover blocker.

Parallel Run Discipline

  1. Legacy job continues producing OLD-FILE.
  2. Easytrieve conversion produces NEW-FILE nightly.
  3. Comparison job or manual tool verifies READ-COUNT equals WRITE-COUNT plus rejects.
  4. Hash totals on key amounts match within tolerance.
  5. Sample record diff on fifty random keys—field-by-field.
  6. Sign-off document before switching downstream consumers to NEW-FILE only.

JCL Considerations

Typical DD statements for conversion
DDPurpose
SOURCELegacy file DISP=SHR
TARGETNew file DISP=(NEW,CATLG) with correct LRECL
ERRORSReject file for reprocessing
SYSOUTConversion statistics log

Performance on Large Conversions

Billion-record conversions run overnight—minimize DISPLAY per record, use adequate BLKSIZE, consider splitting by key range with multiple JCL steps if restart required. Pure byte copy without transform may stay with IEBGENER; Easytrieve earns its cost when every record needs logic. Profile elapsed time on ten-percent sample before full production volume.

Common Conversion Mistakes

  • Wrong output LRECL—truncation or padding garbage.
  • Ignoring packed decimal scale on MOVE to display numeric.
  • No ERROR-FILE—bad records poison TARGET.
  • Cutover without parallel hash comparison.
  • Assuming sort order preserved when adding header/trailer—document order requirements.

Explain It Like I'm Five

Your toy box has labels in one color sticky notes; the new box wants different color notes with more words. File conversion is moving each toy and rewriting the label to fit the new box rules. Broken toys go in a reject pile instead of the new box. Grown-ups count toys in both boxes to make sure none got lost before throwing away the old box.

Exercises

  1. Draw old and new field maps for a ten-field customer record with expanded account number.
  2. Write CONVERT-RECORD with TABLE status translation and VAL-STATUS check.
  3. List five parallel run checks before cutover sign-off.
  4. Describe header and trailer handling for a file with control records.
  5. When would you use utility copy instead of Easytrieve conversion? Write three criteria.

Quiz

Test Your Knowledge

1. File conversion Easytrieve jobs primarily:

  • Read legacy layout and WRITE new layout with transformed fields
  • Replace DB2 catalog
  • Compile COBOL copybooks only
  • Run CICS transactions

2. Packed decimal to display numeric conversion uses:

  • MOVE with MASK or field type change on DEFINE output
  • REPORT TITLE only
  • SCREEN GOTO
  • JCL DELETE

3. Conversion cutover parallel run compares:

  • Record counts and hash totals between old and new pipelines
  • Only compiler listing
  • PF keys
  • MACRO names

4. Variable-length to fixed-length conversion requires:

  • Matching RDW handling and correct output LRECL in FILE and JCL
  • Skipping EOF tests
  • Removing FILE section
  • SORT without keys

5. Trailer record on converted file often:

  • Carries new-format count and control totals
  • Is omitted always
  • Replaces all detail
  • Comes from TITLE
Published
Read time17 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve FILE MOVE MASK batch conversion patternsSources: Broadcom Easytrieve 11.6 Application Guide file processing; EZT Plus Application ReferenceApplies to: Easytrieve file conversion real-world projects