Coding input and output statements for QSAM files
You can code the following input and output statements
to process a QSAM file or a byte-stream file in the z/OS® UNIX file system using QSAM: OPEN
, READ
, WRITE
, REWRITE
,
and CLOSE
.
About this task
OPEN
- Initiates
the processing of files. You can open all QSAM files as
INPUT
,OUTPUT
, orEXTEND
(depending on device capabilities).You can also open QSAM files on direct access storage devices as
I-O
. You cannot open z/OS UNIX files asI-O
; a file status of 37 results if you attempt to do so. READ
- Reads a record from the file. With sequential processing, your program reads one record after another in the same order in which they were entered when the file was created.
WRITE
- Creates a record in the file. Your program writes new records to the end of the file.
REWRITE
- Updates
a record. You cannot update a file in the z/OS UNIX file system using
REWRITE
. CLOSE
- Releases the connection between the file and your program.
Related tasks
Opening QSAM files
Dynamically creating QSAM files
Adding records to QSAM files
Updating QSAM files
Writing QSAM files to a printer or spooled data set
Closing QSAM files
Opening QSAM files
Dynamically creating QSAM files
Adding records to QSAM files
Updating QSAM files
Writing QSAM files to a printer or spooled data set
Closing QSAM files
Related references
OPEN statement (Enterprise COBOL for z/OS Language Reference)
READ statement (Enterprise COBOL for z/OS Language Reference)
WRITE statement (Enterprise COBOL for z/OS Language Reference)
REWRITE statement (Enterprise COBOL for z/OS Language Reference)
CLOSE statement (Enterprise COBOL for z/OS Language Reference)
File status key (Enterprise COBOL for z/OS Language Reference)
OPEN statement (Enterprise COBOL for z/OS Language Reference)
READ statement (Enterprise COBOL for z/OS Language Reference)
WRITE statement (Enterprise COBOL for z/OS Language Reference)
REWRITE statement (Enterprise COBOL for z/OS Language Reference)
CLOSE statement (Enterprise COBOL for z/OS Language Reference)
File status key (Enterprise COBOL for z/OS Language Reference)