If your mainframe you could always call DSNTIAR(Batch) or DSNCIAR(CICS) to extract any information in the SQLCA which may be of use to you.
If your on AIX I believe you need to use the sqlaintp function, although I haven't used this myself.
This translates all the information is the SQLCA into more meaningful text and as such can be of use in finding out why your SQL failed.
You will probably still have to do some detective work from the text output, but it usually helps.