Easytrieve Test Data

Test data is the controlled input you feed Easytrieve while you are still proving the program works. Production files carry millions of rows, sensitive names, and unpredictable edge cases you cannot afford to hit during your first compile-and-go run. Good test data is small enough to read on SYSPRINT, aligned with your FILE and DEFINE layout, and deliberately nasty in the ways operations worry about: empty files, duplicate keys, signed packed totals that do not match the trailer, and lookup misses on indexed masters. Beginners often debug logic against a screen full of production names copied into DEV, then wonder why security audits fail and why a single bad packed field causes S0C7 on record forty thousand. This page explains how to build safe synthetic datasets, wire them through JCL DD statements, isolate DEV from PROD, design regression sets you can rerun after every change, and pair test input with DISPLAY and listing review so you trust output before schedulers depend on it.

Progress0 of 0 lessons

Why Test Data Matters in Easytrieve

Easytrieve programs are declarative about files. You describe record layout in the Library section, then JOB logic assumes every byte in the buffer matches those positions. When test input drifts from FILE FB length, from packed decimal alignment, or from key field width, the symptom is often a data exception or silent wrong totals rather than a friendly compiler error. Test data closes that gap by giving you known records whose field values you can predict before READ or automatic JOB INPUT runs.

Debugging without test data forces you to interpret production anomalies where multiple problems overlap: bad source, wrong JCL dataset, layout mismatch, and business rule gaps all at once. A five-record DEV file with documented expected output lets you change one rule, rerun in minutes, and see exactly which line moved. That feedback loop is what makes test data a debugging tool, not merely a compliance checkbox.

Align Test Records with FILE Definitions

Every test record must honor the FILE statement you compiled. If FILE PAYROLL FB(200 2000) defines EMPNO at position 1 length 9 numeric and GROSS at position 50 length 7 packed, your generator must place those values on those columns. Text editors that pad lines with spaces are fine for character fields but dangerous for packed zones unless you use a generator that writes true packed decimal.

text
1
2
3
4
5
6
7
8
9
10
FILE PAYROLL FB(80 800) EMPNO 1 9 N EMPNAME 10 20 A DEPT 50 3 N GROSS 53 5 P 2 JOB INPUT PAYROLL IF DEPT EQ 100 PRINT DEPT100-RPT END-IF

The FILE block above expects 80-byte records. A test file with 72-byte lines truncates GROSS or shifts DEPT. Verify LRECL with LISTDSI or catalog panels before blaming IF logic. When you change DEFINE positions, regenerate test data; old members silently become invalid even when JCL still allocates successfully.

Methods to Create Test Data

Common test data creation approaches
MethodBest forCaution
JCL inline DD DATAHandful of fixed records in tutorials and first compileManual column alignment; easy to mis-type packed fields
IEBGENER from templateCopying a known-good layout member to a new DEV datasetTemplate must already match FILE FB definition
DFSORT OUTFIL / INCLUDESubsetting production-like shape without full volumeMask PII; confirm sort control cards preserve LRECL
IDCAMS DEFINE / REPROVSAM KSDS test clusters with specific duplicate key casesKey length and CI size must match FILE INDEXED attributes
Shop record generatorPacked decimal, signed amounts, trailer control totalsDocument generator version with regression README

Inline JCL Test File Example

Inline data is ideal when you are learning and can represent character zones in readable form. For numeric and packed fields, many shops prefer a small sequential dataset built offline. The JCL below illustrates pointing PAYROLL DD at a DEV sequential dataset; swap to inline DD DATA when you need a self-contained classroom job.

jcl
1
2
3
4
5
6
//EZTTEST EXEC PGM=EZTPA00,REGION=2M //STEPLIB DD DSN=DEV.EASYTRIEVE.CBAALOAD,DISP=SHR //SYSPRINT DD SYSOUT=* //PAYROLL DD DSN=DEV.EZT.TEST.PAYROLL,DISP=SHR //RPTOUT DD SYSOUT=* //SYSIN DD DSN=DEV.EZT.SOURCE(DEPT100),DISP=SHR

Synthetic Character Records

When all test fields are alphabetic or zoned numeric displayed as characters, you can craft records in a text member. Pad EMPNAME with spaces to width 20. Right-align DEPT zoned fields if your FILE uses numeric picture rules that expect leading zeros. Document each test line in comments beside the member so future you knows why DEPT 100 appears twice.

text
1
2
3
4
000000001SMITH JOHN 100 000000002JONES MARY 100 000000003BROWN ALAN 200 000000004NO DEPT MATCH 999

Edge Cases Your Test Suite Should Cover

A single happy-path record proves the program runs. It does not prove the program is correct. Build intentional edge cases and keep them in a regression library you rerun after every maintenance change.

  • Empty input file: FINISH or RECORD-COUNT logic should report zero rows without abend.
  • Single-record file: exercises division and control break without multi-row buffering.
  • All records filtered out: JOB logic matches nothing; report should be empty or show header only.
  • Duplicate keys on INDEXED master: READ or GET paths per your error PROC design.
  • Missing master key on transaction file: not-found branch must not print blank names.
  • Maximum and minimum amounts: packed overflow and sign handling in SUM and arithmetic.
  • Trailer control total mismatch: detect reconciliation failure before PUT to output.
  • Synchronized multi-file input: one file shorter than another; EOF ordering matters.

Test Data Versus Production Data

Isolation and naming

Use qualifiers such as DEV, TST, or personal prefixes in dataset names. JCL for tests should never accidentally DISP=OLD on a production file during a WRITE experiment. Some shops require //PAYROLL DD DSN=*.PAYROLL,DISP=SHR with a catalog alias that resolves only in DEV; verify alias targets before submit.

PII and regulatory constraints

Employee names, account numbers, medical codes, and government identifiers belong in masked or entirely synthetic form in test libraries. Replace names with tokens like TESTEMP01. Scramble account digits while preserving length and check-digit rules if you test validation logic. Copying production to DEV without masking is a common shortcut that creates audit findings unrelated to Easytrieve syntax skill.

Volume and performance tests

Functional test data stays small. Performance tests use separate large datasets generated by sort or copy utilities, often scheduled overnight. Do not conflate the five-record regression set with the million-row EZTVFM tuning run; they serve different purposes and different JCL streams.

VSAM and Indexed Test Clusters

Indexed FILE definitions require KSDS test clusters with correct key offset and length. IDCAMS DEFINE CLUSTER creates the VSAM object; REPRO or Easytrieve itself loads records. For duplicate key tests, load two records with the same key deliberately and confirm your program branches per site standards. For not-found tests, use a transaction key that does not exist in the master and assert IF NOT file-name or FILE-STATUS handling before PRINT uses master fields.

text
1
2
3
4
5
6
7
8
9
10
11
12
FILE MASTER INDEXED ACCT-KEY 1 10 N ACCT-NAME 11 30 A JOB INPUT CHANGES READ MASTER IF NOT MASTER DISPLAY 'MISSING MASTER' CHG-KEY ELSE MOVE MASTER:ACCT-NAME TO OUT-NAME PUT EXTRACT END-IF

Test data for this pattern needs a CHANGES file with keys both present and absent on MASTER, plus at least one duplicate if you test DUPKEY handling on alternate paths.

Golden Output and Regression Sets

Save expected report text or output file snapshots alongside input test data. After a code change, diff new SYSOUT or output dataset against the golden copy. Regression sets should be version-controlled like source members. When business rules change intentionally, update the golden output in the same change ticket as the source edit. Document in a README member: input datasets, JCL job name, expected record counts, expected totals, and any DISPLAY lines you expect on SYSPRINT.

  1. Create input datasets IN1, IN2, and optional MASTER in DEV.EZT.TEST.*.
  2. Store source member and JCL proc in controlled libraries.
  3. Run baseline job; capture RPTOUT and SYSPRINT as golden references.
  4. After maintenance, rerun and compare counts, totals, and selected detail lines.
  5. Escalate differences: expected rule change versus accidental regression.

Pairing Test Data with DISPLAY and Listings

Test data proves runtime behavior; SYSPRINT proves compile input. Use DISPLAY on selected keys or counters when five records are not enough to eyeball in the report formatter. Remove or gate verbose DISPLAY before production promotion. PARM SYNTAX runs help validate FILE and DEFINE against test JCL before you spend cycles building datasets. When a test fails, read compiler messages first if the step never executed; read FILE-STATUS and DISPLAY next if the step ran but totals disagree.

text
1
2
3
4
5
6
7
8
9
JOB INPUT PAYROLL DISPLAY 'TEST EMPNO' EMPNO ' DEPT ' DEPT IF DEPT EQ 100 TALLY = TALLY + 1 END-IF FINISH. PROC DISPLAY 'DEPT100 COUNT' TALLY END-PROC

Common Test Data Mistakes

  • FILE FB length 80 but test generator writes 72-byte lines.
  • Using production dataset names in DEV JCL through habit or copy-paste.
  • Testing only the happy path while production fails on empty file or trailer mismatch.
  • Changing DEFINE positions without regenerating aligned test records.
  • Assuming VB input when FILE still declares FB fixed layout.
  • Indexed tests without rebuilding KSDS after key definition change.
  • Storing unmasked employee data in shared test libraries.

Troubleshooting Checklist

  1. Confirm JCL DD dataset names point to test libraries, not production.
  2. Verify LRECL and RECFM match FILE FB or VB declaration.
  3. Open test input in a viewer that shows column positions or use LISTDSI.
  4. Run smallest possible record count before scaling up.
  5. Compare SYSPRINT compile listing to the source member you intended.
  6. Check FILE-STATUS and EOF handling with intentional error records.
  7. Update golden output when business rules change by design.

Explain It Like I'm Five

Test data is a small practice workbook you make before the real homework arrives. You write a few math problems you already know the answers to—one easy, one tricky, one empty page on purpose. You hand the practice workbook to Easytrieve and check whether it gets the same answers you wrote in crayon on the answer key. You do not use your friend's real diary as practice paper because that would share secrets and might be way too long to finish before snack time.

Exercises

  1. Design a four-record PAYROLL test file covering two departments and one invalid DEPT.
  2. Write JCL that allocates PAYROLL from DEV.EZT.TEST.PAYROLL with DISP=SHR.
  3. List five edge cases missing from a single happy-path record and how you would encode each.
  4. Explain why masked synthetic names are preferable to copying production EMPNAME values.
  5. Describe a golden-output regression workflow for a report that sums GROSS by DEPT.
  6. Sketch VSAM MASTER and CHANGES test members for not-found and successful READ paths.

Quiz

Test Your Knowledge

1. Test data in Easytrieve development should:

  • Match FILE layout and exercise realistic edge cases
  • Always copy production files unchanged
  • Ignore LRECL and record positions
  • Replace SYSPRINT entirely

2. Inline JCL test files are best for:

  • Small controlled samples during initial debugging
  • Million-row performance baselines
  • Production month-end archives
  • Permanent audit retention

3. When FILE defines FB(80 800), test records must:

  • Be 80 bytes per record with fields at declared positions
  • Be any length the editor allows
  • Omit packed decimal alignment
  • Use only variable-length VB without updating FILE

4. Production payroll data in DEV tests risks:

  • PII exposure and compliance violations
  • Faster compiles only
  • Automatic SORT optimization
  • Eliminating SYSPRINT

5. After changing test input, verify results by:

  • SYSPRINT listing, DISPLAY output, and expected record counts
  • Assuming JCL CLASS=A guarantees correctness
  • Skipping FILE-STATUS checks
  • Deleting EZTVFM before every run

Frequently Asked Questions

What is test data in Easytrieve?

Test data is input and expected-output datasets you create or subset specifically to exercise an Easytrieve program under controlled conditions. It includes sequential files, VSAM test clusters, parameter cards, and golden reference reports used to confirm logic before production promotion.

How do I create small test files for Easytrieve?

Common approaches include JCL inline DD DATA blocks, IEBGENER copies from templates, IDCAMS REPRO from master samples, DFSORT OUTFIL with INCLUDE for subsets, and shop utilities that generate fixed-layout records. Always match FILE FB or VB definitions in your Library section.

Should test data use the same dataset names as production?

No. Use DEV or TST qualifiers, separate high-level qualifiers, or personal test libraries. Point JCL DD statements at test datasets explicitly. Never DISP=SHR on production files during destructive WRITE or REPLACE tests without operations approval.

What edge cases should Easytrieve test data include?

Include empty files, single-record files, duplicate keys on indexed files, missing lookup keys, maximum and minimum numeric values, signed packed fields, high and low account numbers, blank name fields, trailer count mismatches, and multi-file synchronized scenarios where one file exhausts before another.

How does test data relate to compiler listings?

Test data does not replace listings. Compile with PARM SYNTAX or full compile on test JCL, then run against test input. SYSPRINT proves which source compiled; test output proves runtime behavior against known records.

Published
Read time16 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve FILE layout rules; z/OS JCL test dataset conventionsSources: Broadcom Easytrieve 11.6 Language Reference FILE and JOB input; z/OS JCL DD DATA and IEBGENER patternsApplies to: Easytrieve development and debugging with synthetic test datasets on z/OS