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.
Smart dates are actually pretty easy to work with once you know that the date is just an integer that is an offset of the number of days since 12/31/1900. This means that the integer 1 = 1/1/1901, 2 = 1/2/1901, 43037 = 10/30/2018, etc.
Incrementing smart dates is really easy. All you need to do is add or subtract the number of days you need. Run the fex below to see some examples of different date formats.
DEFINE FILE CAR
YEAR/I4 = DTPART('&YYMD', YEAR);
MONTH/I2 = DTPART('&YYMD', MONTH);
DAY/I2 = DTPART('&YYMD', DAY);
-*ALPHA CONVERSION
DATE1_A8/A8 = EDIT(YEAR)|EDIT(MONTH)|EDIT(DAY);
DATE1_A8YYMD/A8YYMD = EDIT(YEAR)|EDIT(MONTH)|EDIT(DAY);
DATE1_YYMD/YYMD = DATECVT(EDIT(YEAR)|EDIT(MONTH)|EDIT(DAY),'A8YYMD','YYMD'); -* <-- SMART DATE
-*INTEGER CONVERSION
DATE2_I8/I8 = YEAR * 10000 + MONTH * 100 + DAY;
DATE2_I8YYMD/I8YYMD = YEAR * 10000 + MONTH * 100 + DAY;
DATE2_YYMD/YYMD = DATECVT(YEAR * 10000 + MONTH * 100 + DAY,'I8YYMD','YYMD'); -* <-- SMART DATE
SMART_DATE_DAY1/I1 = 1;
BREAK/A15 = 'Converted Date';
END
TABLE FILE CAR
PRINT YEAR
OVER MONTH
OVER DAY
OVER BREAK AS 'Alpha Conversion'
OVER DATE1_A8
OVER DATE1_A8YYMD
OVER DATE1_YYMD
OVER BREAK AS 'Integer Conversion'
OVER DATE2_I8
OVER DATE2_I8YYMD
OVER DATE2_YYMD
OVER COMPUTE SDATE/A50V = 'Smart<br>Date'; AS 'Smart Date<br>Examples'
COMPUTE DESC/A50V = '# Days After<br>12/31/1900'; AS ''
OVER SMART_DATE_DAY1/YYMD AS 'Smart Date Day 1'
SMART_DATE_DAY1/I1 AS ''
OVER DATE2_YYMD/YYMD AS 'Today''s Date'
DATE2_YYMD/I11 AS ''
OVER COMPUTE DATE_YYMD_PLUS7/YYMD = DATE2_YYMD + 7; AS 'Today''s Date + 7'
COMPUTE DATE_YYMD_PLUS7/I11 = DATE2_YYMD + 7; AS ''
BY COUNTRY NOPRINT
HEADING
"Today's Date: &DATEMDYY"
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM OFF
ON TABLE SET STYLE *
TYPE=REPORT, FONT=CALIBRI, GRID=OFF, $
TYPE=TITLE, COLUMN=P4, BACKCOLOR=SILVER, STYLE=Bold, $
TYPE=DATA , COLUMN=P4, BACKCOLOR=SILVER, STYLE=Bold, $
TYPE=TITLE, COLUMN=P8, BACKCOLOR=SILVER, STYLE=Bold, $
TYPE=DATA , COLUMN=P8, BACKCOLOR=SILVER, STYLE=Bold, $
TYPE=TITLE, COLUMN=P12, BACKCOLOR=SILVER, STYLE=Bold, $
TYPE=DATA , COLUMN=P12, BACKCOLOR=SILVER, STYLE=Bold, $
TYPE=DATA , COLUMN=P13, BACKCOLOR=SILVER, STYLE=Bold, $
TYPE=HEADING, STYLE=Bold, $
ENDSTYLE
END
-HTMLFORM BEGIN
<style>
table {border-collapse: collapse; }
</style>
-HTMLFORM END
This message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015