CLOSE return and reason codes

When your program receives control after it has issued a CLOSE macro, a return code in register 15 indicates whether all VSAM data sets were closed successfully, as Table 1 shows.

Table 1. Return codes in register 15 after CLOSE. Return codes in register 15 after CLOSE
Return code Meaning
0(X'0') All data sets were closed successfully.
4(X'4') At least one data set (VSAM or non-VSAM) was not closed successfully.

If register 15 contains 4, use SHOWCB to display the ERROR field in each access method control block to determine if a VSAM data set was not closed successfully and the reason it was not. See z/OS DFSMS Macro Instructions for Data Sets. Table 2 lists the reason codes that the ERROR field might contain after close processing.

Table 2. CLOSE reason codes in the ACBERFLG field of the ACB. CLOSE reason codes in the ACBERFLG field of the ACB
Reason code Meaning
0(X'0') No error (set when register 15 contains 0).
4(X'4') The data set indicated by the access method control block is already closed.
129(X'81') CLOSE TYPE=T was issued for a VSAM data set that is not open for VSAM processing.
132(X'84') An uncorrectable I/O error occurred while VSAM was reading the job file control block (JFCB).
136(X'88') Not enough virtual storage was available in your program's address space for a work area for close processing.
144(X'90') An uncorrectable I/O error occurred while VSAM was reading or writing a catalog record.
145(X'91') An uncorrectable error occurred in the VSAM volume data set (VVDS).
148(X'94') An unidentified error occurred while VSAM was searching the catalog.

For a UNIX file, an unidentified error occurred.

167(X'A7') For MACRF=RLS, abend occurred during open or close processing.
170(X'AA') For MACRF=RLS, the required CF Cache is unavailable from this system.
172(X'AC') Close was successful, but DFSMStvs was unable to write a close record to the log of logs, the forward recovery log, or both.
184(X'B8') An uncorrectable I/O error occurred while VSAM was completing outstanding I/O requests. For a UNIX file, an error occurred while VSAM was flushing output data or disconnecting from the file.
185(X'B9') LSR/GSR - Error in WRTBFR: I/O for data set not quiesced before WRTBFR TYPE=DS during close processing.
188(X'BC') The data set indicated by the ACB is not the type that may be specified by an ACB.

For MACRF=RLS, an invalid ACB address is specified for close processing.

236(X'EC') System logic error because the function no longer is supported.
246(X'F6') A call to compression management services (CMS) failed.

In addition to these reason codes, VSAM writes a message to the operator's console and the programmer's listing further explaining the error.