Closing VSAM data sets

To close a VSAM data set, use the Standard C fclose() library function as you would for closing non-VSAM files. See z/OS XL C/C++ Runtime Library Reference for more details on the fclose() library function.

For ESDS binary files, if fclose() is called and there is a new record in the buffer that is less than the maximum record size, this record is written to the file at its current size. A new RRDS binary record that is incomplete when the file is closed is filled with null characters to the record size.

A new ESDS or RRDS text record that is incomplete when the file is closed is completed with a new-line.