View previous topic :: View next topic
|
Author |
Message |
Anand78
New User
Joined: 06 Mar 2006 Posts: 50 Location: PUNE
|
|
|
|
HI ,
Can anybody tell me how to resolve below issue.
If any select sql abends , I want to display timestamp in spool.
Pls tell me how to do that.
Thanks
Anand |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Anand78,
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
Code: |
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.
But what gain will that give you? |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
He could do a ACCEPT "WS-TIME FROM systemTime" or whatever it is if the DB2 subsystem isn't available. |
|
Back to top |
|
|
|