What is QSAM?

Virtual Storage Access method - ESDS, KSDS, RRDS & LDS. Basic direct access method, Basic sequential -, Queued sequential -, Basic partitioned -, Indexed sequential -, Object - access method.
Previous topicNext topic
User avatar

Topic Author
Anuj Dhawan
Founder
Posts: 2624
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Zodiac: Sagittarius

What is QSAM?

Post by Anuj Dhawan » Sun May 26, 2013 2:26 pm

QSAM stands for Queued Sequential Access Method. This is an extended version of the basic sequential access method (BSAM). When this method is used, a queue is formed of input data blocks that are awaiting processing or of output data blocks that have been processed and are awaiting transfer to auxiliary storage or to an output device.

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 the DATA 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. (And this perhaps an interview question that -- can we DELETE the records from a sequential File?). You can, however, update QSAM files on direct-access storage devices (using REWRITE), though not in the HFS.

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 HFS 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.


Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.

Previous topicNext topic

Return to “SMS & VSAM and BDAM, BSAM, QSAM, BPAM, ISAM, OAM.”