__last_op values

The __last_op field is the most important of the __amrc fields. It defines the last I/O operation C/C++ was performing at the time of the I/O error. You should note that the structure is neither cleared nor set by non-I/O operations, so querying this field outside of a SIGIOERR handler should only be done immediately after I/O operations. Table 1 lists __last_op values you could receive and where to look for further information.

Table 1. __last_op values and diagnosis information
Value Further Information
__IO_INIT Will never be seen by SIGIOERR exit value given at initialization.
__BSAM_OPEN Sets __error with return code from OS OPEN macro.
__BSAM_CLOSE Sets __error with return code from OS CLOSE macro.
__BSAM_READ No return code (either __abend (errno == 92) or __msg (errno == 66) filled in).
__BSAM_NOTE NOTE returned 0 unexpectedly, no return code.
__BSAM_POINT This will not appear as an error lastop.
__BSAM_WRITE No return code (either __abend (errno == 92) or __msg (errno == 65) filled in).
__BSAM_CLOSE_T Sets __error with return code from OS CLOSE TYPE=T.
__BSAM_BLDL Sets __error with return code from OS BLDL macro.
__BSAM_STOW Sets __error with return code from OS STOW macro.
__TGET_READ Sets __error with return code from TSO TGET macro.
__TPUT_WRITE Sets __error with return code from TSO TPUT macro.
__IO_DEVTYPE Sets __error with return code from I/O DEVTYPE macro.
__IO_RDJFCB Sets __error with return code from I/O RDJFCB macro.
__IO_TRKCALC Sets __error with return code from I/O TRKCALC macro.
__IO_OBTAIN Sets __error with return code from I/O CAMLST OBTAIN.
__IO_LOCATE Sets __error with return code from I/O CAMLST LOCATE.
__IO_CATALOG Sets __error with return code from I/O CAMLST CAT. The associated macro is CATALOG.
__IO_UNCATALOG Sets __error with return code from I/O CAMLST UNCAT. The associated macro is CATALOG.
__IO_RENAME Sets __error with return code from I/O CAMLST RENAME.
__SVC99_ALLOC Sets __alloc structure with info and error codes from SVC 99 allocation.
__SVC99_ALLOC_NEW Sets __alloc structure with info and error codes from SVC 99 allocation of NEW file.
__SVC99_UNALLOC Sets __unalloc structure with info and error codes from SVC 99 unallocation.
__C_TRUNCATE Set when C or C++ truncates output data. Usually, this is data written to a text file with no newline such that the record fills up to capacity and subsequent characters cannot be written. For a record I/O file this refers to an fwrite() writing more data than the record can hold. Truncation is always rightmost data. There is no return code.
__C_FCBCHECK Set when C or C++ FCB is corrupted. This is due to a pointer corruption somewhere. File cannot be used after this.
__C_DBCS_TRUNCATE This occurs when writing DBCS data to a text file and there is no room left in a physical record for anymore double byte characters. A new-line is not acceptable at this point. Truncation will continue to occur until an SI is written or the file position is moved. Cannot happen if MB_CUR_MAX is 1.
__C_DBCS_SO_TRUNCATE This occurs when there is not enough room in a record to start any DBCS string or else when a redundant SO is written to the file before an SI. Cannot happen if MB_CUR_MAX is 1.
__C_DBCS_SI_TRUNCATE This occurs only when there was not enough room to start a DBCS string and data was written anyways, with an SI to end it. Cannot happen if MB_CUR_MAX is 1.
__C_DBCS_UNEVEN This occurs when an SI is written before the last double byte character is completed, thereby forcing C or C++ to fill in the last byte of the DBCS string with a padding byte X'FE'. Cannot happen if MB_CUR_MAX is 1.
__C_CANNOT_EXTEND This occurs when an attempt is made to extend a file that allows writing, but cannot be extended. Typically this is a member of a partitioned data set being opened for update.
__VSAM_OPEN_FAIL Set when a low level VSAM OPEN fails, sets __rc and __fdbk fields in the __amrc struct.
__VSAM_OPEN_ESDS Does not indicate an error; set when the low level VSAM OPEN succeeds, and the file type is ESDS.
__VSAM_OPEN_RRDS Start of changeDoes not indicate an error; set when the low level VSAM OPEN succeeds, and the file type is RRDS.End of change
__VSAM_OPEN_KSDS Start of changeDoes not indicate an error; set when the low level VSAM OPEN succeeds, and the file type is KSDS.End of change
__VSAM_OPEN_ESDS_PATH Start of changeDoes not indicate an error; set when the low level VSAM OPEN succeeds, and the file type is ESDS PATH.End of change
__VSAM_OPEN_KSDS_PATH Start of changeDoes not indicate an error; set when the low level VSAM OPEN succeeds, and the file type is KSDS PATH.End of change
__VSAM_MODCB Set when a low level VSAM MODCB macro fails, sets __rc and __fdbk fields in the __amrc struct.
__VSAM_TESTCB Set when a low level VSAM TESTCB macro fails, sets __rc and __fdbk fields in the __amrc struct.
__VSAM_SHOWCB Set when a low level VSAM SHOWCB macro fails, sets __rc and __fdbk fields in the __amrc struct.
__VSAM_GENCB Set when a low level VSAM GENCB macro fails, sets __rc and __fdbk fields in the __amrc struct.
__VSAM_GET Set when the last op was a low level VSAM GET; if the GET fails, sets __rc and __fdbk in the __amrc struct.
__VSAM_PUT Set when the last op was a low level VSAM PUT; if the PUT fails, sets __rc and __fdbk in the __amrc struct.
__VSAM_POINT Set when the last op was a low level VSAM POINT; if the POINT fails, sets __rc and __fdbk in the __amrc struct.
__VSAM_ERASE Set when the last op was a low level VSAM ERASE; if the ERASE fails, sets __rc and __fdbk in the __amrc struct.
__VSAM_ENDREQ Set when the last op was a low level VSAM ENDREQ; if the ENDREQ fails, sets __rc and __fdbk in the __amrc struct.
__VSAM_CLOSE Set when the last op was a low level VSAM CLOSE; if the CLOSE fails, sets __rc and __fdbk in the __amrc struct.
__QSAM_GET __error is not set (if abend (errno == 92), __abend is set, otherwise if read error (errno == 66), look at __msg.
__QSAM_PUT __error is not set (if abend (errno == 92), __abend is set, otherwise if write error (errno == 65), look at __msg.
__QSAM_TRUNC This is an intermediate operation. You will only see this if an I/O abend occurred.
__QSAM_FREEPOOL This is an intermediate operation. You will only see this if an I/O abend occurred.
__QSAM_CLOSE Sets __error to result of OS CLOSE macro.
__QSAM_OPEN Sets __error to result of OS OPEN macro.
__CMS_OPEN Sets __error to result of FSOPEN.
__CMS_CLOSE Sets __error to result of FSCLOSE.
__CMS_READ Sets __error to result of FSREAD.
__CMS_WRITE Sets __error to result of FSWRITE.
__CMS_STATE Sets __error to result of FSSTATE.
__CMS_ERASE Sets __error to result of FSERASE.
__CMS_RENAME Sets __error to result of CMS RENAME command.
__CMS_EXTRACT Sets __error to result of DMS EXTRACT call.
__CMS_LINERD Sets __error to result of LINERD macro.
__CMS_LINEWRT Sets __error to result of LINEWRT macro.
__CMS_QUERY __error is not set.
__HSP_CREATE Indicates last op was a DSPSERV CREATE to create a hiperspace for a hiperspace memory file. If CREATE fails, stores abend code in __amrc__code__abend__syscode, reason code in __amrc__code__abend__rc.
__HSP_DELETE Indicates last op was a DSPSERV DELETE to delete a hiperspace for a hiperspace memory file during termination. If DELETE fails, stores abend code in __amrc__code__abend__syscode, reason code in __amrc__code__abend__rc.
__HSP_READ Indicates last op was a HSPSERV READ from a hiperspace. If READ fails, stores abend code in __amrc__code__abend__syscode, reason code in __amrc__code__abend__rc.
__HSP_WRITE Indicates last op was a HSPSERV WRITE to a hiperspace. If WRITE fails, stores abend code in __amrc__code__abend__syscode, reason code in __amrc__code__abend__rc.
__HSP_EXTEND Indicates last op was a HSPSERV EXTEND during a write to a hiperspace. If EXTEND fails, stores abend code in __amrc__code__abend__syscode, reason code in __amrc__code__abend__rc.
__CICS_WRITEQ_TD Sets __error with error code from EXEC CICS® WRITEQ TD.
__LFS_OPEN Sets __error with reason code from HFS services. Reason code from HFS services must be broken up. The low order 2 bytes can be looked up in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
__LFS_CLOSE Sets __error with reason code from HFS services. Reason code from HFS services must be broken up. The low order 2 bytes can be looked up in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
__LFS_READ Sets __error with reason code from HFS services. Reason code from HFS services must be broken up. The low order 2 bytes can be looked up in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
__LFS_WRITE Sets __error with reason code from HFS services. Reason code from HFS services must be broken up. The low order 2 bytes can be looked up in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
__LFS_LSEEK Sets __error with reason code from HFS services. Reason code from HFS services must be broken up. The low order 2 bytes can be looked up in z/OS UNIX System Services Programming: Assembler Callable Services Reference.
__LFS_FSTAT Sets __error with reason code from HFS services. Reason code from HFS services must be broken up. The low order 2 bytes can be looked up in z/OS UNIX System Services Programming: Assembler Callable Services Reference.