Focal Point
[CLOSED] How to find out when is the last time a file get updated.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/289102483

March 02, 2010, 08:06 AM
VINH-DINH HO
[CLOSED] How to find out when is the last time a file get updated.
Thank you to Francis, Dan, Darin, njsden and Waz for your suggestions.
Will look for an answer and post if found.

This message has been edited. Last edited by: Kerry,
March 03, 2010, 09:04 AM
knegrotto
I had a need to find out the date a reporting file was last updated.

I cobbled this solution together from posts on this forum and the user manuals and thought it might just help someone else.

It uses APP QUERY to dump a directory listing into system table FOCAPPQ which is defined in WebFocus.

I then queried the table to select the file I wanted and stored the date in a hold file which I then read.

Here is the sample code.

SET PCOMMA=ON
SET ALL=ON
APP QUERY CLECO_TEMP HOLD
TABLE FILE FOCAPPQ
WHERE FILENAME EQ 'IBIMRUSR.TXT' OR FILENAME EQ 'ibimrusr.txt'
PRINT DATE
ON TABLE SAVE AS FILEINFO FORMAT ALPHA
END
-RUN
-SET &TEXTDATE = 'NOT FOUND';
-READ FILEINFO, &TEXTDATE
-RUN

Other file attributes are also available (see definition of the FOCAPPQ table fo list).


WebFOCUS 769
Windows
all
March 03, 2010, 10:17 AM
Francis Mariani
This technique will work with flat files, not with database tables.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server