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.
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.
12345678910FILE 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.
| Aspect | VSAM ESDS | QSAM disk/tape |
|---|---|---|
| Easytrieve FILE line | SEQUENTIAL (default) | SEQUENTIAL (default) |
| Catalog object | VSAM cluster | PS or PO sequential dataset |
| Typical access | Forward sequential GET | Forward sequential GET |
| Extend at end | Yes—entry sequence append | Yes—append to file |
| Keyed READ | Not primary model | Not available |
| Spanned records | VSAM supports per cluster | VBS 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 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.
123456789101112131415FILE 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.
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.
12345//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.
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.
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.
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.
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.
1. In Easytrieve, a VSAM ESDS is usually declared with:
2. ESDS records are retrieved in Easytrieve primarily by:
3. After the last ESDS record, you should test:
4. ESDS differs from KSDS because ESDS:
5. FILE CREATE on an ESDS typically: