SQLIMSERRM
The SQLIMSERRM is a variable length character string set by IMS after each SQL statement which contains the error message and length.
In COBOL, SQLIMSERRM includes SQLIMSERRML and SQLIMSERRMC. SQLIMSERRMC contains the SQL error message returned by IMS. It can be up to 255 characters. SQLIMSERRML is the length of the SQL error message.