Easytrieve ESDS File Processing

VSAM Entry Sequenced Data Sets (ESDS) are one of the most common input types in batch Easytrieve shops. Payroll extracts, transaction logs, and nightly feeds often land as ESDS clusters or as QSAM datasets that Easytrieve treats the same way at the language level. When your JCL DD points at a VSAM cluster defined with IDCAMS as ESDS, you declare FILE PERSNL SEQUENTIAL—or simply FILE PERSNL with the default type—and drive the file with JOB INPUT for automatic read loops or GET for controlled secondary reads. Records arrive strictly in entry order: first written, first read. There is no primary key index like KSDS, so random access by business key is not the ESDS strength. Beginners coming from COBOL sequential READ or from spreadsheet row order should think of ESDS as an ordered tape-on-disk: you start at the beginning (or reposition with supported verbs) and walk forward until EOF. This page teaches how Easytrieve maps FILE SEQUENTIAL to ESDS, how JOB INPUT and GET cooperate with EOF tests, how CREATE and UPDATE differ from indexed masters, JCL and catalog coordination, ESDS versus QSAM trade-offs, and operational mistakes that cause empty reports or ABEND 013 on length mismatch.

Progress0 of 0 lessons

What ESDS Means on z/OS

VSAM defines several organizations. ESDS stores variable-length or fixed-length records in control intervals and control areas, but the application view is sequential by entry sequence. IDCAMS DEFINE CLUSTER with INDEXED NO and NONINDEXED YES creates ESDS. KSDS uses INDEXED YES for keyed access; RRDS uses RELATIVE in Easytrieve for slot numbers. ESDS fits extract-and-report pipelines: a upstream job appends rows; your Easytrieve job reads every row once, filters, sums, and prints. Because records are not keyed for direct READ by employee number, do not declare INDEXED on FILE when the catalog says ESDS—Easytrieve and VSAM expectations would disagree and open or GET can fail or misbehave.

FILE Declaration for ESDS

text
1
2
3
4
5
6
7
8
9
10
FILE PERSNL FB(150 1800) EMP-NO 1 9 N NAME 10 30 A DEPT 40 3 A GROSS 50 7 P 2 JOB INPUT PERSNL IF DEPT EQ '100' PRINT NAME GROSS END-IF

FILE PERSNL FB(150 1800) names the logical file and states fixed blocked 150-byte records with 1800-byte blocks—classic mainframe sizing. Field definitions map columns inside each record. Omitting SEQUENTIAL still defaults to sequential, which is correct for ESDS. Adding SEQUENTIAL explicitly enables FILE-STATUS for that file when you code STATUS on GET or need return codes in procedures. UPDATE on FILE is uncommon for pure read-only ESDS extracts but is valid when your process appends or rewrites per site VSAM policy; batch automatic JOB INPUT with UPDATE issues GET HOLD on VSAM except in CICS.

ESDS Versus QSAM Sequential

Sequential FILE type: ESDS compared with QSAM
AspectVSAM ESDSQSAM disk/tape
Easytrieve FILE lineSEQUENTIAL (default)SEQUENTIAL (default)
Catalog objectVSAM clusterPS or PO sequential dataset
Typical accessForward sequential GETForward sequential GET
Extend at endYes—entry sequence appendYes—append to file
Keyed READNot primary modelNot available
Spanned recordsVSAM supports per clusterVBS on FILE if needed

Easytrieve uses the same statements for both. Your responsibility is JCL DSN= and DISP= matching the catalog, and FILE record format matching LRECL. Operations teams sometimes convert QSAM to ESDS for space or shareability; your program often needs no source change if lengths stay the same.

JOB INPUT Automatic Loop

JOB INPUT PERSNL tells Easytrieve to open the file implicitly, optionally PERFORM START, then read each record and execute the activity body until EOF. You do not code GET for the automatic input file—doing both is invalid. Inside the loop, fields EMP-NO, NAME, and GROSS refer to the current buffer row. Control breaks, totals, and IF filters run per record. At EOF the loop ends and termination cleanup runs. This is the fastest path for beginners: one FILE, one JOB INPUT, one REPORT or DISPLAY block.

GET, EOF, and FILE-STATUS

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
FILE PERSNL SEQUENTIAL FB(80 800) FILE OUTFILE FB(80 800) JOB INPUT NULL NAME PROCESS PROCESS. PROC GET PERSNL STATUS IF EOF PERSNL STOP END-IF IF DEPT EQ '200' MOVE NAME TO OUT-NAME PUT OUTFILE END-IF END-PROC

When you need a custom loop—perhaps OUTFILE is automatic output and PERSNL must be manual—use JOB INPUT NULL and GET inside a procedure. After every GET, test IF EOF PERSNL before using fields. STATUS sets FILE-STATUS with the operating-system return code; without STATUS, a bad read often raises a diagnostic. GET PRIOR walks backward when the access method supports it; on ESDS browse backward may be limited compared to KSDS paths—verify in your release notes for CICS versus batch. Constants EOF and file-presence tests are documented in the constants chapter.

CREATE and Loading a New ESDS

FILE OUTFILE SEQUENTIAL CREATE FB(100 1000) prepares a new output cluster or sequential dataset when the activity writes. CREATE loads the file from empty. On mainframe VSAM, RESET with CREATE can overwrite an existing REUSE cluster; without RESET, OPEN may fail if the cluster already exists. In CICS, RESET during CREATE causes execution errors—batch JCL jobs are the usual ESDS load path. After load, IDCAMS LISTCAT confirms organization ESDS and record counts. Pair CREATE output with JCL DISP=(NEW,CATLG,DELETE) or catalog retention per your data-management standards.

JCL and DD Coordination

text
1
2
3
4
5
//PERSNL DD DSN=PROD.PAYROLL.ESDS,DISP=SHR //OUTFILE DD DSN=PROD.PAYROLL.RPT(+1), // DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(10,5)), // DCB=(RECFM=FB,LRECL=100,BLKSIZE=1000)

The Easytrieve file-name PERSNL must match the DD name PERSNL in JCL (unless SYSNAME maps a different external name). DISP=SHR shares the ESDS for read. Output may be another ESDS, QSAM, or a generation dataset—Easytrieve still uses FILE SEQUENTIAL when organization is sequential. Mismatched LRECL between DCB= in JCL and FB(...) on FILE is a top cause of S013 or OPEN errors. BUFNO on FILE tunes buffer count for large sequential scans.

ESDS Versus KSDS and RRDS

Choose ESDS when every run processes all or most records in order and no keyed random access is required. Choose KSDS (FILE INDEXED) when you READ by key, START at a key, or update scattered master rows. Choose RRDS (FILE RELATIVE) when slot number is the natural key—tables with fixed record positions. Mixing organizations in one program is normal: JOB INPUT on an ESDS transaction file plus GET on an INDEXED customer master for enrichment is a classic pattern covered in the multiple-files tutorial.

Legacy VS ES Keyword

Older Easytrieve Plus sources use FILE name VS (ES ...) for entry-sequenced VSAM. ES meant entry-sequenced in the legacy VS parameter list. Modern programs should use SEQUENTIAL and CREATE or UPDATE keywords, but migration projects still parse VS ES during compile. Behavior maps to sequential ESDS processing described here.

Performance and Control Interval Awareness

ESDS performance depends on control interval size, BUFNO, and whether you read once or pass multiple times. Single-pass JOB INPUT with simple IF is optimal. Re-reading the same ESDS in one job without CLOSE and reposition costs extra I/O. For very wide records, confirm spanned record support if VB or VBS is used. Avoid small FB lengths that do not match the upstream writer— padding fields waste CI space and confuse DEFINE offsets.

Common ESDS Mistakes

  • FILE INDEXED on a catalog ESDS cluster.
  • GET on a file already declared as automatic JOB INPUT.
  • Skipping IF EOF after manual GET.
  • LRECL 80 on FILE but 100 in JCL DCB.
  • Expecting keyed READ on ESDS without loading a KSDS.
  • CREATE RESET on ESDS in CICS online programs.

Testing ESDS Jobs

  1. LISTCAT the cluster—confirm organization is ESDS.
  2. Run a five-record test file through JOB INPUT; verify record count on SYSPRINT.
  3. Force EOF path in PROCESS procedure; confirm STOP or clean exit.
  4. Compare FILE FB length to JCL DCB LRECL byte for byte.
  5. Scan empty DEPT filter—output should be empty, not garbage from prior buffer.

Explain It Like I'm Five

An ESDS is a line of toy cars on a shelf. Each new car goes at the end of the line. When Easytrieve reads the file, it takes cars from the front of the line, one at a time, until no cars are left. It does not jump to a car in the middle by name—you need a different shelf type (KSDS) for that. You tell Easytrieve the shelf name with FILE, and you say go through every car with JOB INPUT or GET. When the line is empty, you say EOF and stop playing with empty air.

Exercises

  1. Write FILE and JOB INPUT for an ESDS payroll file with one DEPT filter.
  2. Rewrite the same logic with JOB INPUT NULL and a GET loop with EOF test.
  3. List three differences between ESDS and KSDS for a beginner presentation.
  4. Draft JCL DD for input ESDS DISP=SHR and output sequential CREATE dataset.
  5. Explain when SEQUENTIAL on FILE should be explicit for FILE-STATUS.

Quiz

Test Your Knowledge

1. In Easytrieve, a VSAM ESDS is usually declared with:

  • FILE name SEQUENTIAL (or default type omitted)
  • FILE name INDEXED only
  • FILE name RELATIVE only
  • FILE name SQL

2. ESDS records are retrieved in Easytrieve primarily by:

  • Sequential GET or automatic JOB INPUT
  • Key READ only
  • Relative record number only
  • SQL FETCH

3. After the last ESDS record, you should test:

  • IF EOF file-name before using buffer fields
  • Only TITLE
  • Only PARM
  • HIGH-VALUES on key

4. ESDS differs from KSDS because ESDS:

  • Has no primary key index for random access
  • Always requires RELATIVE on FILE
  • Cannot be opened on z/OS
  • Uses SQL cursors

5. FILE CREATE on an ESDS typically:

  • Loads a new dataset; RESET may overwrite when REUSE applies
  • Deletes JCL
  • Opens printer only
  • Skips DEFINE
Published
Read time18 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve Report Generator 11.6 FILE SEQUENTIAL and VSAM ESDS processingSources: Broadcom Easytrieve 11.6 Language Reference FILE, GET, File Processing ModesApplies to: Easytrieve ESDS and sequential VSAM batch processing