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     [CLOSED] How to find out the different of 2 date time

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to find out the different of 2 date time
 Login/Join
 
Member
posted
Hi,


How to find out the different of time between 2 date/time eg YYYYMMDD HHMMSS - 20110801 081500 and 20110802 150000 ?

Currently we are running Focus 6.9.4 on OpenVMS Alpha Operating System, Version V6.2-1H3.

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


Focus 6.9.4 on OpenVMS
, All Outputs
 
Posts: 10 | Registered: August 28, 2011Report This Post
Expert
posted Hide Post
Please check out the documentation on HDIFF.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Hi Waz,

Thanks for the information

We are using Focus 6.9.4 on OpenVMS, the function supported by this version ?


Focus 6.9.4 on OpenVMS
, All Outputs
 
Posts: 10 | Registered: August 28, 2011Report This Post
Expert
posted Hide Post
It doesn't look promising.

TECHNIQUE: How to change field with P4 format to a date or time format

You can always try it out and see.

HDIFF(value1, value2, 'component', outfield)
where:






















value1 Date-time Is the end date-time value, the name of a date-time field that contains the value, or an expression that returns the value.
value2 Date-time Is the start date-time value, the name of a date-time field that contains the value, or an expression that returns the value.
component Alphanumeric Is the name of the component to be used in the calculation enclosed in single quotation marks. If the component is a week, the WEEKFIRST parameter setting is used in the calculation. e.g. seconds minutes, etc
outfield Floating-point double-precision Is the field that contains the result, or the format of the output value enclosed in single quotation marks. The format must be floating-point double-precision. In Maintain, you must specify the name of the field.


TABLE FILE VIDEOTR2
PRINT CUSTID TRANSDATE AS 'DATE-TIME' AND COMPUTE
ADD_MONTH/HYYMDS = HADD(TRANSDATE, 'MONTH', 2, 8, 'HYYMDS');
DIFF_DAYS/D12.2 = HDIFF(ADD_MONTH, TRANSDATE, 'DAY', 'D12.2');
WHERE DATE EQ 2000;
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Hi Waz

In the link you have provided mentioned to search the document from Knowledge Base

Can you help to advise where/how to access the Knowledge Base ?


Focus 6.9.4 on OpenVMS
, All Outputs
 
Posts: 10 | Registered: August 28, 2011Report This Post
Expert
posted Hide Post
There is two things you can do.

1. Use the search facility. ecl

2. Register with Techsupport

If you register, you can put questions to IBI


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Hi Waz,

Using the example provided by you as below and the result of HHDIFF encountered negative value.

Do you have any advise on how to resolve the negative value ?

DEFINE FILE F071TCYA
TSIN/I8 = EDIT(SINDATE);
TSHP/I8 = EDIT(SHPDATE);
TDI/I8 = DAYMD(TSIN,'I8');
TDS/I8 = DAYMD(TSHP,'I8');
DAYD/I8 = TDS-TDI;
-*
BIHH/I2=EDIT(EDIT(SINTIME,'99$$$$'));
BIMM/I2=EDIT(EDIT(SINTIME,'$$99$$'));
BISS/I2=EDIT(EDIT(SINTIME,'$$$$99'));
BSEC/I9=(BIHH * 3600)+(BIMM * 60) + BISS ;
EIHH/I2=EDIT(EDIT(SHPTIME,'99$$$$'));
EIMM/I2=EDIT(EDIT(SHPTIME,'$$99$$'));
EISS/I2=EDIT(EDIT(SHPTIME,'$$$$99'));
ESEC/I9=(EIHH * 3600)+(EIMM * 60) + EISS ;
DIFFSEC/I9=ESEC-BSEC;
-*CONVERT BACK TO HH MM SS
HHDIFF/I5 = DIFFSEC/3600;


Sample data :-
SINDATE SINTIME SHPDATE SHPTIME
20110825 184201 20110904 165257
20110826 070401 20110904 041348

TDI TDS DAYD HHDIFF ESEC BSEC
40779 40789 10 -1 60777 67321
40780 40789 9 -2 15228 25441


Focus 6.9.4 on OpenVMS
, All Outputs
 
Posts: 10 | Registered: August 28, 2011Report This Post
Expert
posted Hide Post
HHDIFF comes from DIFFSEC, which comes from the subtraction of BSEC from ESEC

For the first record DIFFSEC is -6544, the next is -10213.

Because you are dividing this by 3600, and putting the result ito an integer, you will get -1 and -2.

Should you be including the dated in this as well ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Hi Waz,

Will do TTLD/P5.1 = DAYD + (DIFFSEC/3600)/24


Focus 6.9.4 on OpenVMS
, All Outputs
 
Posts: 10 | Registered: August 28, 2011Report 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     [CLOSED] How to find out the different of 2 date time

Copyright © 1996-2020 Information Builders