Use an entry in the FILE-CONTROL paragraph in the ENVIRONMENT DIVISION to define the file organization and access modes for the VSAM files in your COBOL program.
In the FILE SECTION of the DATA DIVISION, code a file description (FD) entry for the file. In the associated record description entry or entries, define the record-name and record length. Code the logical size of the records with the RECORD clause.
Important: You can process VSAM data sets in Enterprise COBOL programs only after you define them with access method services.
| File organization | Sequential access | Random access | Dynamic access | Fixed length | Variable length |
|---|---|---|---|---|---|
| VSAM sequential (ESDS) | Yes | No | No | Yes | Yes |
| VSAM indexed (KSDS) | Yes | Yes | Yes | Yes | Yes |
| VSAM relative (RRDS) | Yes | Yes | Yes | Yes | Yes |
related tasks
Specifying sequential organization for VSAM files
Specifying indexed organization for VSAM files
Specifying relative organization for VSAM files
Specifying access modes for VSAM files
Defining record lengths for VSAM files
Using file status keys
Using VSAM status codes (VSAM files only)
Defining VSAM files