LearnAI ToolsCareerPractice BuildsPlayContact
Lesson 918 min read

Sequential Datasets

Learn how sequential datasets work — records read and written strictly in order — and their typical uses as input files, reports, and logs.

Introduction

Sequential datasets are the simplest, and in many ways the most common, dataset organization on the mainframe. They are the workhorse behind batch input files, generated reports, and log output. Understanding them well will also make partitioned datasets (next lesson) easier to grasp, since a PDS member behaves essentially like a small sequential dataset living inside a larger structure.

What is a Sequential Dataset?

A sequential dataset (formally, a Physical Sequential dataset, or DSORG=PS) stores its records one after another, in a fixed order, with no built-in index or lookup structure. To find any particular record, you read through the dataset from the beginning, in order, until you reach it. There is no way to "jump" directly to record number 5,000 without first passing through the 4,999 records before it.

Sequential Dataset in One Sentence

A sequential dataset is a dataset whose records are stored and read strictly in order, one after another, with no index for direct access — the mainframe equivalent of a simple flat text file processed top to bottom.

How Sequential Access Works

Programs and utilities process a sequential dataset by reading (or writing) one record, then the next, then the next, in order, until reaching the end of the dataset. Records share the same RECFM and LRECL attributes you learned about in the previous lesson, which is what allows a program to reliably read record after record without needing separators or markers between them.

Allocating and populating a sequential dataset via ISPF Edit
Menu Utilities Compilers Help
------------------------------------------------------------------
EDIT STUDENT1.TEST.DATA
Command ===> Scroll ===> PAGE
****** ***************************** Top of Data ******************
000001 SMITH JOHN 1985-04-12 ACTIVE
000002 GARCIA MARIA 1990-11-03 ACTIVE
000003 CHEN WEI 1978-07-22 INACTIVE
000004 PATEL ANIL 1995-01-30 ACTIVE
****** **************************** Bottom of Data *****************
What this shows

Click Run to see what this code prints.

Typical Uses

Sequential datasets are the natural fit whenever data is genuinely meant to be processed start-to-finish, in order, without needing to jump around.

Batch Input Files

Data feeds delivered for overnight or scheduled processing, such as a daily file of transactions to apply.

Generated Reports

Output produced by a batch job for printing or downstream review, written out record by record in order.

Logs

Job and system logs that are naturally append-and-read-in-order by nature.

Intermediate Work Files

Temporary data passed from one step of a multi-step batch job to the next.

A Sequential Dataset in Practice

You will formally learn JCL in the next lesson set of this course, but it is worth previewing here how a sequential dataset commonly appears as a step's input or output — this is the shape you will see constantly once you get there.

Referencing a sequential dataset as JCL input (preview)
//STEP010 EXEC PGM=REPTGEN
//SYSIN DD DSN=STUDENT1.TEST.DATA,DISP=SHR
//SYSPRINT DD DSN=STUDENT1.TEST.OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=133,BLKSIZE=13300),
// SPACE=(TRK,(5,5))
What this shows

Click Run to see what this code prints.

Strengths and Limitations

AspectSequential Dataset
StrengthSimple, predictable, efficient for start-to-finish processing of every record
StrengthWell suited to high-volume batch throughput — reading records in order is very efficient
LimitationNo direct/random access — finding one specific record means reading through everything before it
LimitationNot well suited to interactive lookups, where VSAM (a later lesson) is typically a better fit

Common Mistakes

Avoid These Mistakes
  • Using a sequential dataset for a workload that really needs fast, random lookups by key — that is what VSAM exists for.
  • Assuming records can be updated in place arbitrarily — sequential processing is fundamentally ordered, and mid-dataset updates are far more restricted than with indexed structures.
  • Ignoring RECFM/LRECL consistency between a dataset and the program reading it, which commonly causes read errors or misaligned data.
  • Forgetting that "sequential" describes access pattern, not just file "type" — it is a deliberate structural choice with real trade-offs, not a default to reach for automatically.

Best Practices

  • Choose a sequential dataset when your processing genuinely reads or writes records in order, start to finish.
  • Keep record layouts (RECFM, LRECL) consistent and well documented, since programs reading the data depend on them exactly.
  • For very large sequential files, consider block size carefully — larger blocks generally improve I/O efficiency up to device limits.
  • When a lookup or random-access pattern is actually needed, do not force it onto a sequential dataset — use VSAM instead, covered in an upcoming lesson.

Frequently Asked Questions

Not efficiently. Sequential datasets have no built-in index, so accessing a specific record generally requires reading through every record before it, in order. If you need fast direct access, a VSAM dataset is the appropriate choice instead.

PS stands for Physical Sequential — the formal dataset organization value for a sequential dataset, as opposed to PO (partitioned organization) or a VSAM type.

Very much so. They remain the standard choice for batch input feeds, generated reports, and logs — anywhere data is naturally processed in order from start to finish.

A PDS member behaves much like its own small sequential dataset in terms of record access, but it lives inside a larger partitioned dataset alongside other named members, organized through a directory — the subject of the next lesson.

Key Takeaways

  • A sequential dataset (DSORG=PS) stores records in a fixed order, read and written strictly from start to finish.
  • There is no built-in index — accessing a specific record means reading through everything before it.
  • Sequential datasets are the standard choice for batch input files, generated reports, logs, and intermediate work files.
  • They are efficient for high-volume, start-to-finish processing, but not well suited to random lookups.
  • RECFM and LRECL consistency between a dataset and the program reading it is essential for correct processing.

Summary

Sequential datasets are the simplest and most common way data flows through mainframe batch processing — records in, records out, strictly in order. That simplicity is a genuine strength for high-volume processing, even though it comes with real limitations around direct access. In the next lesson, you will look at partitioned datasets (PDS), which introduce a directory of named members and are the standard way mainframe shops organize things like source code and JCL libraries.

Next Lesson →

Partitioned Datasets (PDS)