DMS waits for any outstanding write operations to be completed and then releases all PAM pages which are still locked for the calling job in the file to be closed. Finally, it restores the contents of the file control block to the state which they had before the OPEN call and releases any TFT entry created automatically by OPEN for the file.
DMS releases all work areas in class 5 memory which were occupied during file processing. Such as the input/output areas which were automatically allocated to the file when it was opened.
The date and time of access (ACC-DATE and ACC-TIME fields) and the access counter (ACC-COUNT field) are updated in the catalog entry of any file to be closed.
If the file was opened for writing, the date and time of the last update (CHANG-DATE and CHANG-TIME fields), the highest used page number (HIGH-US-PA field), and the number of the highest valid byte in the last logical block (last-byte pointer) are also updated. The highest used page number is the last PAM page used by the file and thus indicates the logical file size.
For newly created files, i.e. files created with OPEN mode OUTIN or OUTPUT, the date and time at which the file was created (CRE-DATE and CRE-TIME fields) and the date and time of expiration (EXPIR-DATE and EXPIR-TIME fields) are filled in as well.
The SHOW-FILE-ATTRIBUTES command or the FSTAT macro can be used to determine the above-mentioned fields and other fields from the catalog entry.