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.
Is there a way to calculate the difference between 2 dates in days based on a 360 day year, similar to excel's days360 function?This message has been edited. Last edited by: Kerry,
Mainframe FOCUS 7.3.8 10.26.05 18.02 Windows, All Outputs
There may be other solutions, but one is to multiply the number of days calculated with DATEDIF by 72/73 (which is the same as the number of minutes in a 360 day year divided by the number of minutes in a 365 day year: 1440 / 1460).
DEFINE FILE CAR
DATE1/YYMD WITH COUNTRY = '2010/01/01';
DATE2/YYMD WITH COUNTRY = '2010/02/01';
DATE3/YYMD WITH COUNTRY = '2011/01/01';
DATE_DIFF_365M/I5 = DATEDIF(DATE1,DATE2,'D');
DATE_DIFF_360M/I5 = DATE_DIFF_365M * 72 / 73 ;
DATE_DIFF_365Y/I5 = DATEDIF(DATE1,DATE3,'D');
DATE_DIFF_360Y/I5 = DATE_DIFF_365Y * 72 / 73 ;
END
-*
TABLE FILE CAR
PRINT
DATE1 DATE2
DATE_DIFF_365M DATE_DIFF_360M
DATE1 DATE3
DATE_DIFF_365Y DATE_DIFF_360Y
WHERE RECORDLIMIT EQ 1 ;
END
This message has been edited. Last edited by: Dan Satchell,
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Just occurred to me that leap years could present a problem. May be best to calculate the number of days in the year and use that number as the divisor for converting to 360 day equivalents.
DEFINE FILE CAR
YEAR_BEG/YYMD WITH COUNTRY = '2008/01/01';
YEAR_END/YYMD WITH COUNTRY = '2008/12/31';
YEAR_DAYS/I5 = DATEDIF(YEAR_BEG,YEAR_END,'D') + 1 ;
DATE1/YYMD WITH COUNTRY = '2008/02/01';
DATE2/YYMD WITH COUNTRY = '2008/03/01';
DATE3/YYMD WITH COUNTRY = '2009/01/01';
DATE_DIFF_365M/I5 = DATEDIF(DATE1,DATE2,'D');
DATE_DIFF_360M/I5 = DATE_DIFF_365M * 360 / YEAR_DAYS ;
DATE_DIFF_365Y/I5 = DATEDIF(YEAR_BEG,DATE3,'D');
DATE_DIFF_360Y/I5 = DATE_DIFF_365Y * 360 / YEAR_DAYS ;
END
-*
TABLE FILE CAR
PRINT
YEAR_BEG YEAR_DAYS
DATE1 DATE2
DATE_DIFF_365M DATE_DIFF_360M
DATE3
DATE_DIFF_365Y DATE_DIFF_360Y
WHERE RECORDLIMIT EQ 1 ;
END
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007