Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

timestamp difference in hours

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: timestamp difference in hours
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    Post subject: Re: timestamp difference in hours
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    Post subject: Re: timestamp difference in hours
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    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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Converting EBCDIC to Unicode (TimeStamp) muralikrishnan_new COBOL Programming 2 Mon Jul 25, 2016 10:42 pm
No new posts Convert Timestamp Value mrdinesh DFSORT/ICETOOL 7 Thu May 05, 2016 6:01 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us