Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
do you mean that you want to display an informational message containing a timestamp in the 'spool' if you receive a negative value SQLCODE from a SELECT?
SQL's don't ABEND.
Is this batch or CICS/IMS?
only in batch do you drive a message to the sysout.
well, first you need to obtain a timestamp
SET :WS-TIMESTAMP TO CURRENT_TIMESTAMP
DISPLAY 'SQL ERROR: ' SQLCODE ' AT ' WS-TIMESTAMP ' FOR ROUTINE ?'
Fill in your own message for '?'.
by the way, if your negative SQLCODE concerns a connect issue, you won't beable to access a timestamp.
why must you include a time? you can tell from the JES output when your job ran - if it is batch. What is more important is what you were doing (what sql were you executing), what the host-variables contained and of course the SQLCODE. You should display the complete SQLCA.