Focal Point
[SOLVED] Capture result of ? Query into a file

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

November 01, 2006, 03:59 PM
Gary Gerstung
[SOLVED] Capture result of ? Query into a file
I need to display the date and time of the last modification made to a file. The ?FDT query shows me this. Is it possible to write this information to a file that I can parse out and extract the Date/Time information? This would enable me to display this info on an HTML page of our self-service screen. The only other option I can think of is to create another field in each data base 'LAST_UPDATE_DATE' and add logic to our update programs to record the Date/Time of each update.

This message has been edited. Last edited by: Kerry,
November 01, 2006, 08:18 PM
N.Selph
Here is a fex that will get you what you need. Just modify it to show what you want to. FOCAPPQ is a special system "table" that contains this information. Set &APPFOLD to your application folder name (Self-Serve).
 
APP QUERY &APPFOLD HOLD

DEFINE FILE FOCAPPQ
FILETYPE/A3=GETTOK(FILENAME,70,2,'.',3,'A3');
RMSL/A8=EDIT (DATE, '99$99$9999');
READDATE/YYMD=DATECVT(RMSL,'A8DMYY','YYMD');
END


TABLE FILE FOCAPPQ
ON TABLE SET PAGE-NUM OFF
ON TABLE SET LINES 999999
HEADING
"WebFocus Application <APPNAME "
"On &WF_ENV Environment"
" "
FOOTING
"All files are shown lower case regardless of actual filename case."
PRINT
	FILENAME AS 'Filename'
 SIZE AS 'Filesize,in bytes'
 READDATE AS 'Date Last,Updated'
 TIME AS 'Time Last, Updated'
BY FILETYPE
ON TABLE SET STYLE *
TYPE=HEADING, LINE=1, SIZE=12, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=HEADING, LINE=1, OBJECT=FIELD, COLOR=RED, STYLE=BOLD+UNDERLINE,$
TYPE=HEADING, LINE=2, SIZE=11, STYLE=BOLD, JUSTIFY=CENTER,$
TYPE=TITLE, SIZE=10, STYLE=BOLD, COLOR=RED,$
ENDSTYLE
END

 



(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
November 02, 2006, 01:08 AM
susannah
quote:
APP QUERY &APPFOLD HOLD

N.
Can you tell me what this command does?
in FILEDEF terms?
thanks.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
November 02, 2006, 09:52 AM
Francis Mariani
From the docs:
quote:
APP QUERY app HOLD - Writes a list of all files in the application app in the file focappq.ftm in a temporary directory; the output is described by focappq.mas

http://documentation.informationbuilders.com/masterinde...adm532/05access3.htm

Simple fex:
-*--- List files in an APP folder --------------------------

APP QUERY eqp HOLD

TABLE FILE FOCAPPQ
WHERE FILENAME CONTAINS '.fex'
PRINT *
END



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
March 26, 2009, 06:31 PM
Dave Ayers
Anybody have an idea on how to capture the output of an '? FILE filename' ???


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
March 27, 2009, 05:50 AM
GamP
Currently there is no standard way of doing this. IBI is researching on how to implement this, but it won't be here soon.
Meanwhile, you could misuse the good old tracing mechanism to do this.
Example:
SET TRACEOFF = ALL
SET TRACEON = ALL
SET TRACESTAMP=OFF
SET TRACEUSER=TEST.TRC
-RUN
? FILE somefocusfile
SET TRACEOFF = ALL
-RUN
FILEDEF MASTER DISK TRACE.MAS
FILEDEF TRACE DISK TEST.TRC
-RUN
-WRITE MASTER FILENAME=TRACE, SUFFIX=FIX
-WRITE MASTER SEGNAME=TRACE
-WRITE MASTER FIELDNAME=LINE, FORMAT=A200, ACTUAL=A200, $
-RUN
APP HOLD SESSION
DEFINE FILE TRACE
RESULT/A175 = SUBSTR(200,LINE,45,200,155,'A155');
END
TABLE FILE TRACE
PRINT RESULT
IF LINE CONTAINS 'ngput'
ON TABLE SAVE AS OUTPUT
END
-RUN

Now there is a file stored in your SESSION app dir called output.ftm, which contains the output of the ? FILE command.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988