Focal Point
[SOLVED] Determine if HOLD File Exists in FOCCACHE

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

August 25, 2009, 10:59 AM
Craig R.
[SOLVED] Determine if HOLD File Exists in FOCCACHE
I'm creating a HOLD file (format ALPHA) in FOCCACHE. This file is TABLE'd again (ON TABLE PCHOLD FORMAT XML) to populate a drop-down list control in an HTML form. The HOLD file can be used repeatedly during a user's session, and I only want to create it once (i.e., first time thru). I need a way to detect if it already exists so I don't keep hitting the database server to recreate it. Can anyone help with the appropriate command? I know about the STATE command/&RETCODE combination, but I don't seem to be providing the correct path to the HOLD file -- it's never found.

Thanks!

Craig

This message has been edited. Last edited by: Kerry,


v8.1.04, 64-bit Windows (Reporting Server), Apache Tomcat (Web/App Server), HTML, PDF, AHTML, Excel outputs
August 25, 2009, 04:26 PM
j.gross
Since no takers yet, let me try. I would use CHECK FILE. It sets &LINES to the number of fields defined in the Master, and &RECORDS to number of segments, if the Master file exists and is valid; and both to zero otherwise. Since foccache start out empty, the Master file will exist in foccache if and only if the data file was already pulled during the current browser session.

So you can test whether the pull already took place as follows;
CHECK FILE FOCCACHE/holdfile
-RUN
-IF &LINES GT 0 THEN CONTINUE ;
*** code to populate FOCCACHE/holdfile ***
-CONTINUE
. . .



- Jack Gross
WF through 8.1.05
August 26, 2009, 09:10 AM
Craig R.
Mr. G.

Works like a charm. Many thanks...

And thanks for responding at all. This was my first post, and it must have been a yawner!

Best regards,

Craig


v8.1.04, 64-bit Windows (Reporting Server), Apache Tomcat (Web/App Server), HTML, PDF, AHTML, Excel outputs