COBOL - Difference between Files

COBOL File Close COBOL Next Sentence

Advertisements


Below are the differences in between sequential, indexed and relative files.


Sequential FilesIndexed FilesRelative Files
Sequential files are called as QSAM files.Indexed files are also called as VSAM files.Relative called as VSAM files (RRDS).
Data is entered in entry sequential order.Data is entered in key sequential order.Data is entered in RRN number.
Duplicate data is allowed.Duplicate data is not allowed.Duplicate data is not allowed
Data is not in sorted order.Data is in sorted order based on key.Date is in sorted order based on RRN.
Delete is not applicable.Delete is applicable. Delete is applicable.
Access is slow.Access is faster.Access is faster than indexed files.
Key is not available.Key is available. Key is user defined. Key is part of a record.Key is available. Key is system defined, key is outside of a record.
Data is stored on tape/disk.Data is stored on disk only.Data is stored on disk only.
File modes. INPUT. OUTPUT. I-O. EXTEND.File modes. INPUT. OUTPUT. I-O.File Modes. INPUT OUTPUT I-O
Frequently used files.Rarely used files.Not yet all used.

COBOL File Close COBOL Next Sentence

Advertisements