Working with VSAM data sets under z/OS and z/OS UNIX
Be aware of special coding considerations for VSAM files under z/OS® and z/OS UNIX for access method services (IDCAMS) commands, environment variables, and JCL.
A
VSAM file is available if all of the following conditions
are true:
- You define it using access method services.
- You define it for your program by providing a
DD
statement, an environment variable, or anALLOCATE
command. - It has previously contained a record.
A VSAM file is unavailable if it has never contained a record, even if you have defined the file.
You always get
a return code of zero on completion of the OPEN
statement
for a VSAM sequential file.
Use the access method services REPRO
command
to empty a file. Deleting records in this manner resets the high-use
relative byte address (RBA) of the file to zero. The file is effectively
empty and appears to COBOL as if it never contained a record.