Processing QSAM files
Queued sequential access method (QSAM) files are unkeyed files in which the records are placed one after another, according to entry order.
Your program can process these files only sequentially,
retrieving (with the READ
statement) records in the
same order as they are in the file. Each record is placed after the
preceding record. To process QSAM files in your program, use COBOL
language statements that:
- Identify and describe the QSAM files in the
ENVIRONMENT DIVISION
and theDATA DIVISION
. - Process the records in these files in the
PROCEDURE DIVISION
.
After you have created a record, you cannot change its length
or its position in the file, and you cannot delete it. You can, however,
update QSAM files on direct-access storage devices (using REWRITE
),
though not in the z/OS® UNIX file system.
QSAM files can be on tape, direct-access storage devices (DASDs), unit-record devices, and terminals. QSAM processing is best for tables and intermediate storage.
You can also access byte-stream files in the z/OS UNIX file system using QSAM. These files are binary byte-oriented sequential files with no record structure. The record definitions that you code in your COBOL program and the length of the variables that you read into and write from determine the amount of data transferred.
z/OS DFSMS: Using Data Sets (Access methods)