Closing files

Use the fclose() library function to close a file. z/OS® XL C/C++ automatically closes files on normal program termination and attempts to do so under abnormal program termination or abend. When closing a fixed binary terminal, z/OS XL C/C++ pads the last record with blanks if it is incomplete.

See z/OS XL C/C++ Runtime Library Reference for more information on this library function.