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.
We have an audit that logs quite a bit of stuff, but we need to create something that does a clean up after 5 days. For some reason the DEFINE FILE FILELIST below isn't adding the new column. Anyone see something wrong with the following code that would prevent NEWDATE from showing up?
-SET &THENDTTM = DATEADD(&YYMD, 'D', -5);
-SET &THENDTTM = EDIT(&THENDTTM,'9999') | '/' | EDIT(&THENDTTM,'$$$$99') | '/' | EDIT(&THENDTTM,'$$$$$$99');
-TYPE THENDTTM = &THENDTTM
APP QUERY audit_logger HOLD
-RUN
TABLEF FILE FOCAPPQ
PRINT
DATE
TIME
FILENAME
ON TABLE HOLD AS FILELIST
END
-RUN
DEFINE FILE FILELIST
NEWDATE/YYMD = DATE;
END
-RUN
TABLE FILE FILELIST
PRINT *
-*WHERE NEWDATE LT '&THENDTTM';
END
This message has been edited. Last edited by: GavinL,
- FOCUS Man, just FOCUS! ----------------------------- Product: WebFOCUS Version: 8.1.04 Server: Windows 2008 Server
Thanks, I figured that out, but I come to the conclusion I must be overthinking this process, because it's kicking my @$$. I can have this written in 2 minutes within .NET, but using FOCUS, it's been 2 days.
- FOCUS Man, just FOCUS! ----------------------------- Product: WebFOCUS Version: 8.1.04 Server: Windows 2008 Server
Date conversions are an absolute nightmare in WebFocus. That really needs to be worked on.
How exactly does
DATEADD(&YMD, 'D', -10)
Result in:
160397
Looks like it convert it to an int and just subtracted 10 from it, unless there is 97 days in March all of a sudden.
Help clearly gives an example with use of string date.
Example: Using the Weekday Unit
If you use the weekday unit and a Saturday or Sunday is the input date, DATEADD changes the input date to Monday. The function
DATEADD('910623', 'WD', 1)
This is the important piece, a full component date. Not a partial representation such as &YMD but a full date representation as in &YYMD.
Folks have always had trouble in getting date conversion / addition / movement functions to work and it is usually down to a misunderstanding of what the documentation states. Whether that calls for a legacy date, full component date etc.
Once it clicks then ......
Good luck
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004