Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Maintain - compute diff between two time variables

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Maintain - compute diff between two time variables
 Login/Join
 
Gold member
posted
In my maintain, I have two time variables:
TIMEAA/A8 and TIMEBB/A8

I initially set TIMEAA = HHMMSS();

At various intervals, I set TIMEBB = HHMMSS();

How do i compute the differnce between
TIMEAA and TIMEBB ?? (Time elapsed)

Thanks
Brad

This message has been edited. Last edited by: Kerry,


Brad S.
WF 8.05 / Win7 /Tomcat Self Serve
 
Posts: 61 | Location: St Louis | Registered: May 15, 2003Report This Post
Virtuoso
posted Hide Post
This forum entry was for totaling time. The same basics could be used for elapsed time.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Master
posted Hide Post
Brad
If that forum doesn't help, I would do this. I would just HGETC to get the System DATE / TIME and then use the HDIFF function to get the values.

Mark

MAINTAIN
COMPUTE DATE4/HYYMDS= HGETC(10, DATE4);
REPEAT 600000
ENDREPEAT;
COMPUTE DATE5/HYYMDS= HGETC(10, DATE5);
COMPUTE MINDIFF/D12.2 = HDIFF(DATE5, DATE4, 'SECOND', MINDIFF);
-* COMPONENT CAN BE HOUR, MINUTE, SECOND, MILLISECOND, ETC...
TYPE "DATE4 = << DATE4"
TYPE "DATE5 = << DATE5"
TYPE "DIFF = << MINDIFF"
END
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Gold member
posted Hide Post
Thanks....I'll give it a try.


Brad S.
WF 8.05 / Win7 /Tomcat Self Serve
 
Posts: 61 | Location: St Louis | Registered: May 15, 2003Report This Post
Gold member
posted Hide Post
Thanks Guru for the technique below
It works!



EXAMPLE:

MAINTAIN

MODULE IMPORT(MNTUWS);

-* DATA/A8 represent the time variable
-* from existing database (note the periods)
COMPUTE DATA/A8 = '12.00.00';

COMPUTE
STR3/A1 = ':';
STR2/A1 = '.';
-* used STRAN to replace "." with ":"
-* in order to get right format for DT1
TDATA/A8 = STRAN(DATA, STR2, STR3);
NOW/A10 = TODAY2();
DT1/HYYMDS= NOW | ' ' | TDATA;
DT4/HYYMDS = HGETC(16, DT4);

-* HDIFF computes differences between times
-* expressed in minutes
MINDIFF/D12.2 = HDIFF(DT1, DT4, 'MINUTE', MINDIFF);

TYPE "DT1 = <TYPE "DT4 = <TYPE "DIFF = <END


Brad S.
WF 8.05 / Win7 /Tomcat Self Serve
 
Posts: 61 | Location: St Louis | Registered: May 15, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Maintain - compute diff between two time variables

Copyright © 1996-2020 Information Builders