MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

check the difference between timestamps is > 5 minutes

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
rsamb
Beginner


Joined: 09 Dec 2004
Posts: 1
Topics: 1

PostPosted: Wed Dec 15, 2004 1:59 am    Post subject: check the difference between timestamps is > 5 minutes Reply with quote

There are two timestamps of which one is current timestamp and other is existing one. We have to check whether the difference between the two timestamps is greater than 5 minutes.. (Consider all the fields)
How do we find that?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Dec 15, 2004 8:58 am    Post subject: Reply with quote

rsamb & vj2081,

hmm exact same question with same wording , but 2 different people . Please search before posting. The topic of getting the difference between 2 timestamps is already discussed. The following topic discusses about getting the difference in seconds. all you need is to convert the result into minutes which is quite easy.

Check the solution of the question (g) in the following topic

http://www.mvsforums.com/helpboards/viewtopic.php?t=2261

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psridhar
Beginner


Joined: 16 May 2004
Posts: 68
Topics: 26

PostPosted: Wed Dec 15, 2004 10:01 am    Post subject: Reply with quote

Hi,

This can be checked with the following SPUFI.

Code:
SELECT  *
  FROM  TBL_NAME
 WHERE  ( CURRENT TIMESTAMP - EXISTING_TMSTMP ) > 300.000000 ;


The difference between two time stamps will be always in the format "seconds.milliseconds".
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Dec 15, 2004 10:08 am    Post subject: Reply with quote

Quote:

The difference between two time stamps will be always in the format "seconds.milliseconds".


Psridhar,

I beg to differ ! Can you show me the link which specifies that ? The result of subtracting one timestamp (TS2) from another (TS1) is a timestamp duration that specifies the number of years, months, days, hours, minutes, seconds, and microseconds between the two timestamps. The data type of the result is DECIMAL(20,6).

Check this link for a detailed explanation of Timestamp arithmetic

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNSQH11/2.20.9.3?SHELF=&DT=20010718164132&CASE=

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group