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.
I have tried numerous things...none return me the numeric day of week that I can then decode to Mon/Tues/Wed etc.
The date is of type: HYYMDs. Must I perform a conversion of the date or can I get the DAY OF WEEK in one DEFINE?This message has been edited. Last edited by: RobertF,
I wrote below function just yesterday to convert a year + week number to a date (Monday of the given week):
-*
-* Calculate the date to the beginning of the given week+year
-*
DEFINE FUNCTION WEEK2DATE(YEAR/P5, WEEK/P3)
-* January 1st
IDATE/I8 = YEAR * 10000 + 101;
DATE/YYMD = DATECVT(IDATE, 'I8YYMD', 'YYMD');
DT/HYYMD = HDTTM(DATE, 8, DT);
-* Determine week 1 (as an offset to WEEK)
WK/P3 = HPART(DT, 'week', WK);
WK2/P3 = IF WK EQ 52 OR 53 THEN WEEK +1
ELSE IF WK EQ 2 THEN WEEK -1
ELSE WEEK;
-* Rewind date to Monday of that week
WD/I2 = HPART(DT, 'weekday', WD);
WD_DIFF/I2 = -IMOD(WD + 5, 7, WD_DIFF);
DT2/HYYMD = HADD(DT, 'day', WD_DIFF, 8, DT2);
-* Add WEEK -1 weeks
DT3/HYYMD = HADD(DT2, 'day', (WK2 -1) * 7, 8, DT3);
WEEK2DATE/A20 = HCNVRT(DT3, '(HYYMDS)', 20, 'A20');
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
One thing I don't see a lot of here on Focal Point is using SQL functions in WebFOCUS code. For example (this is Oracle):
TABLE FILE XYZ
PRINT SQL.DAYOFWEEK(RATECHANGEDATE) AS DAYOFWEEK
END
We can now use any (or at least everyone I've tried) function that is valid for your database.
Another thing I do is when I have a date field like RATECHANGEDATE that has no time, I will change the format in the master from USAGE=HYYMDS, ACTUAL=HYYMDS to USAGE=YYMD, ACTUAL=DATE. Now I can use any smart date format without converting from date/time format to a smart date format, for example:
DAY_OF_WEEK/W=RATECHANGEDATE;
In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006