IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

timestamp difference in hours


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
veenus

New User


Joined: 09 Aug 2005
Posts: 2

PostPosted: Tue Aug 09, 2005 1:21 pm
Reply with quote

hi
Hi,

i need to calculate the timestamp differece in hours
say 72 hours i have written like this but it is not functioning
EXEC SQL
SELECT
HOURS(CURRENT TIMESTAMP)- HOURS(P1-TIMESTAMP)
INTO
:WS-HOURS
FROM SYSIBM.SYSDUMMY1
END-EXEC
IF WS-HOURS >= 72
MOVE 16 TO RETURN CODE
ELSE
MOVE 00 TO RETURN CODE
END-IF.


thanks in advance
veenus
Back to top
View user's profile Send private message
jagadeshdvn

New User


Joined: 27 Jun 2005
Posts: 12
Location: East Hartford

PostPosted: Wed Aug 10, 2005 3:06 am
Reply with quote

Hi Dude,

Try using this:
SELECT HOUR(CURRENT TIMESTAMP)- HOUR(CURRENT TIME)
FROM SYSIBM.SYSDUMMY1

But I am not sure if it takes min & sec into consideration. Please do try & let me now.
Back to top
View user's profile Send private message
veenus

New User


Joined: 09 Aug 2005
Posts: 2

PostPosted: Wed Aug 10, 2005 11:03 am
Reply with quote

Hi Jagadeesh,

i did what u said,
when staging it showing macc=4
when promoting it showing macc=4
& macc=0
when running the jcl it is showing macc=o
even if it exceeds 72 hours ie it is exceeding the hoursn limit

so i think the logic is not correct
it is not caluculating the hours
Thanks in advance
regards
pratap
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts After hours quick-fix support for IBM... Mainframe Jobs 0
Search our Forums:

Back to Top