One thing we have had sucess with is using the sql_response to query the AS400 files - as long as the IBM Iseries Access for Windows is loaded on the system where sql_response probe is installed and an ODBC connection is defined there for connection to the AS400.
You can then set the sql_response config to use the ODBC connection and then query the specific file for the error codes. This is not 'offically' supported and you may be limited in the query options. The jdbc_response probe is another option but finding a driver for iSeries DB2 is a little tricky. The sqlserver probe doesn't give an option to query this type of DB.