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     [SOLVED] DEFINE FILE on APP QUERY HOLD

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] DEFINE FILE on APP QUERY HOLD
 Login/Join
 
Master
posted
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
 
Posts: 578 | Registered: October 01, 2014Report This Post
Platinum Member
posted Hide Post
Use ...

PRINT * NEWDATE
instead of ...

PRINT *


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Master
posted Hide Post
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
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
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)


Looks like I can't use real dates:
-SET &NOW = HGETC(10, 'HYYMDm');
-SET &THENDTTM = DATEADD(&NOW, 'D', -&KEEPDAYS);


Throws errors:
(FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR


Kind of throws out the help that states:
Syntax: How to Add or Subtract a Date Unit to or From a Date 
DATEADD(date, 'component', increment)
where:

date 
Date

Is a full component date.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Expert
posted Hide Post
quote:
Is a full component date.

Gavin,

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, 2004Report This Post
Master
posted Hide Post
I was using &YYMD first and I get the same results. It subtracts 10 as a number, not a date. I've figured it out though.. I'll post it as Sharing.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report 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     [SOLVED] DEFINE FILE on APP QUERY HOLD

Copyright © 1996-2020 Information Builders