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.
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.
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.
12345678910FILE 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.
| Method | Best for | Caution |
|---|---|---|
| JCL inline DD DATA | Handful of fixed records in tutorials and first compile | Manual column alignment; easy to mis-type packed fields |
| IEBGENER from template | Copying a known-good layout member to a new DEV dataset | Template must already match FILE FB definition |
| DFSORT OUTFIL / INCLUDE | Subsetting production-like shape without full volume | Mask PII; confirm sort control cards preserve LRECL |
| IDCAMS DEFINE / REPRO | VSAM KSDS test clusters with specific duplicate key cases | Key length and CI size must match FILE INDEXED attributes |
| Shop record generator | Packed decimal, signed amounts, trailer control totals | Document generator version with regression README |
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.
123456//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
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.
1234000000001SMITH JOHN 100 000000002JONES MARY 100 000000003BROWN ALAN 200 000000004NO DEPT MATCH 999
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.
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.
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.
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.
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.
123456789101112FILE 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.
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.
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.
123456789JOB 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
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.
1. Test data in Easytrieve development should:
2. Inline JCL test files are best for:
3. When FILE defines FB(80 800), test records must:
4. Production payroll data in DEV tests risks:
5. After changing test input, verify results by:
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.
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.
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.
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.
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.