Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Display Time stamp, if any SQL Abends

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Thu Aug 23, 2007 3:19 pm    Post subject: Display Time stamp, if any SQL Abends
Reply with quote

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
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Thu Aug 23, 2007 4:31 pm    Post subject:
Reply with quote

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
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Thu Aug 23, 2007 6:52 pm    Post subject:
Reply with quote

He could do a ACCEPT "WS-TIME FROM systemTime" or whatever it is if the DB2 subsystem isn't available.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparision with current time arunsoods DFSORT/ICETOOL 5 Thu Nov 09, 2017 10:37 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
This topic is locked: you cannot edit posts or make replies. 00D3003B - time outs in DB2 when invo... chavinash2004 DB2 2 Mon Oct 09, 2017 4:39 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us