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     Returning a File Date

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Returning a File Date
 Login/Join
 
Gold member
posted
Is there a function in WebFOCUS to return a file's timestamp? I'd like to compare FOC files from 2 different days using a WF report and in my heading I'd like to show the last modification date of each corresponding FOC file. Thanks in advance for your help.


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Virtuoso
posted Hide Post
You can do something like we did with the FEX files.

With some dos commands you can put all the file names in an text file with the date and time stamp.
Then you create a master that describes this text file. next step is create a report.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
Here's a response from Tony: check timestamp on file

With a couple of small modifications, here's the code he suggested:

-SET &ECHO=ALL;

DOS CD D:/ibi/apps/ibisamp
DOS DIR car.mas /TC > D:/ibi/temp/tempfile.txt
FILEDEF tempfile DISK D:/ibi/temp/tempfile.txt
-RUN

-*-- bypass header lines
-REPEAT endLoop 3 TIMES;
-READ tempfile &x.A10.
-endLoop

-*-- read file info
-READ tempfile &x.A1. &FileDate.A10. &x.A2. &FileTime.A8.

-TYPE &FileDate &FileTime
-RUN

This will give you the date and time in Dialogue Manager variables.

Strangely, the command
? FILE CAR

Gives me a different date/time, newer than the DOS update date/time.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
There is also a way to read the creation date and the last modification date. I have to look it up at the office.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
Thanks, I was going to try some embedded JavaScript, but this seems more straightforward.

Francis, you are definitely better at searching the Forum for solutions than I am.


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Virtuoso
posted Hide Post
The most accurate approach is to use AUTODATE in the FOCUS db. This can be applied to each segment and gives the most accurate data, particularly if using FDS. Have used it for couple of years now, it is simple to use and report from.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
If you know which directory the Foc file is in, you could use the APP command.

APP QUERY IBISAMP HOLD
TABLE FILE FOCAPPQ
PRINT *
END


The benefit to this is that it will work on other platforms, say Unix, and is all done in WebFOCUS code, not OS calls.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
There is a 18 char limititaion on the use of APP QUERY and it does not work on a folder with a space int the name, so what you have to do is create a MAP then APP QUERY to the PATH you created.
I use APP QUERY to check about 100 files & folders then create a database of this output then 24 hrs later run another APP QUERY that compares the old data base to the new data and if any changes was made on date or time due to an update the file will show on an my reports

APP MAP CAT E:\ibi\srv71\home\catalog
APP PATH CAT
APP QUERY CAT HOLD

APP HOLD AUDIT_CHECK
FILEDEF CATALOG1 DISK E:\AUDIT_CHECK\CATALOG1.DAT

DEFINE FILE FOCAPPQ
FILETYPE/A3=GETTOK(FILENAME,70,2,'.',3,'A3');
RMSL/A8=EDIT (DATE, '99$99$9999');
READDATE/YYMD=DATECVT(RMSL,'A8DMYY','YYMD');
FOLDER1/A18 = 'E:\IBI\SRV71\HOME\';
FOLDER2/A60 = FOLDER1|APPNAME;
FILENAME/A70=UPCASE(70, FILENAME, 'A70');
APPNAME/A18=UPCASE(18, APPNAME, 'A18');
-*FOLDER2/A79 = FOLDER|FILENAME;
-*< TO CREATE THE FOLDER LIST/FILENAME SO THEY COULD BE COPIED AND PASTED IN THE REPORT
TODAY/MDYY = &MDYY
END

TABLE FILE FOCAPPQ
-*WHERE FILENAME CONTAINS '.fex' OR '.FEX'

WHERE FILENAME CONTAINS '.'

-*WHERE FILENAME OMITS '.'
-*< TO PULL THE FOLDER NAMES SO THEY COULD BE COPIED AND PASTED IN THE REPORT FROM EXCEL OUTPUT

PRINT
FILENAME
READDATE AS 'ORG_DATE'
TIME AS 'ORG_TIME'
SIZE AS 'ORG_SIZE'
FOLDER2 AS 'ORG_LOCATION'
TODAY AS 'OLD_TODAY'
AND COMPUTE

NOWTIME/A8 = HHMMSS(NOWTIME); AS 'OLD_NOWTIME'
ON TABLE HOLD AS CATALOG1 FORMAT ALPHA
-*ON TABLE PCHOLD FORMAT EXL2K
END

after a match of old and new i compare the 2 database for a change

COMPUTE
CHANGED/I1 = IF ORG_DATE NE NEW_DATE THEN 1 ELSE
IF ORG_TIME NE NEW_TIME THEN 2 ELSE 0;

HEAD_TIME/A8 = IF ORG_DATE EQ ' ' THEN LAST OLD_NOWTIME ELSE OLD_NOWTIME;
HEAD_DATE/MDYY = IF ORG_DATE EQ ' ' THEN LAST OLD_TODAY ELSE OLD_TODAY;
CUR_DATE/MDYY = &MDYY;
NOWTIME2/A8 = HHMMSS(NOWTIME); NOPRINT

WHERE TOTAL CHANGED EQ '1' OR '2'

BY FILENAME NOPRINT
ON TABLE HOLD AS HOLD2 FORMAT ALPHA
END


DEFINE FILE HOLD2
-* -1 counts from right to left at end, anything ge to 0 counts from left to right the number of beganning
FILETYPE/A3=GETTOK(FILENAME,70,-1,'.',3,'A3');
END

Chuck




Prod: WebFOCUS 7.1, 7.13, 7.6
Test: DevStudio 7.1, 7.6 Servlet - Self Service - MS Windows XP SP2 - Apache Tomcat 5.0.28
Output: HTML, Excel 2000 and PDF

 
Posts: 26 | Registered: October 25, 2006Report 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     Returning a File Date

Copyright © 1996-2020 Information Builders