Focal Point
[SOLVED] Force WF to reparse master and acx

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

September 10, 2019, 10:26 AM
jgelona
[SOLVED] Force WF to reparse master and acx
A few weeks ago I had an issue where I wanted to use an && variable in the WORKSHEET parameter of the .acx file for an Excel file that could hold a variable number of sheets. I could not get that to work so I thought, since the .acx file is a single line of text, just overwrite it. I wrote code to do this and it works very well. For example, the current workbook has 4 sheets named: FY19-1stQuarter, FY19-2ndQuarter, FY19-3rdQuarter and FY19-4thQuarter. The .acx file ends up looking like this:

pass 1 - SEGNAME=SHEETNM, WORKSHEET=FY19-1stQuarter, HROWS=1, $
pass 2 - SEGNAME=SHEETNM, WORKSHEET=FY19-2ndQuarter, HROWS=1, $
pass 3 - SEGNAME=SHEETNM, WORKSHEET=FY19-3rdQuarter, HROWS=1, $
pass 4 - SEGNAME=SHEETNM, WORKSHEET=FY19-4thQuarter, HROWS=1, $

However, in each pass only sheet being read is FY19-1stQuarter. It appears that WebFOCUS has cached the master and acx and doesn't reparse the files even though the .acx file has changed. I think WebFOCUS is only reading the first sheet because WORKSHEET=FY19-1stQuarter is what is in the cached .acx file. If I change the order, i.e. read the 3rd sheet first, the 3rd sheet sheet is read in each pass.

So is there a way to force WebFOCUS reparse the master and acx within the fex? I've tried doing a FILEDEF clear on the .xlsx and .acx files but that did not work.

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


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
September 10, 2019, 10:40 AM
FP Mod Chuck
jgelona

This post on techsupport may help you. https://techsupport.informatio...ttrack/10273529.html The EXPIRE_REPORTS set to 1 may be what you need.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
September 10, 2019, 10:51 AM
jgelona
Chuck, when I click on the link I get The page cannot be found


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
September 10, 2019, 11:32 AM
FP Mod Chuck
Here is what was posted in that link...

Solution Notes
Problem Section

How to prevent caching of report output.
Solution Section

To prevent this, use the following parameters that can be enable from the
WebFOCUS Admin console:

EXPIRE_REPORTS - The time when reports generated by the WebFOCUS Reporting
Server are to be re-executed. The expiration time is set in seconds, and the
default setting is 300 seconds.

You can view a previously executed report on the browser without re-executing
its request. If the request for a report you are running is the same as the one
executed previously (within 300 seconds), then the browser displays the
previously executed report stored in the cache when you use the Back, Reload,
or the Refresh button of the browser.

To ensure that the reports are re-executed, set EXPIRE_REPORTS to 1 second.

_TempFileTimeout - Deletes files from the temporary directory. Files are
deleted if they are older than the number of seconds specified. This parameter
is located on Reporting Server Console, after right click on Application
folder.

foccache_maxage - Defines the maximum number of minutes that a foccache
directory remains active. The default is 180 minutes. 0 means unlimited (that
is, the directory will be remain active as long as the session lasts or the
server is running).

Here is an example of adding a Random number:

-SET &RAND = RDUNIF('D4.2') * 100000000;

Issuing the above command at the top of the FEX. In the calling URL, pass:
RAND=&RAND


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
September 10, 2019, 11:51 AM
jgelona
Thanks but I don't think that is what I want. First, I need to do this while the fex is running so making a change on the Admin Console is not practical. Second, I only want to do this for this file, not every file used in the fex. Third, making a change on the Admin Console would affect every agent. That is not what I want. I need something I can do in the fex to force WebFOCUS to reparse the .acx file.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
September 10, 2019, 12:12 PM
FP Mod Chuck
Hopefully someone else has a way to do that.. In the mean time I suggest opening a case with techsupport.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
September 10, 2019, 12:31 PM
dhagen
It's been years, but isn't that a CHECK FILE command?


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
September 10, 2019, 04:06 PM
Waz
Yes, CHECK FILE, and possibly UNLOAD / LOAD


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!

September 11, 2019, 08:40 AM
jgelona
I don't see any option in CHECK FILE for this so I opened a problem report and the solution was to use APP DELETEF to delete the .acx file. Something like this:
 APP PATH tanf
 FILEDEF YI853QTR DISK tanf/yi853_qtrs.ftm ( LRECL 20 RECFM V
-RUN
-SET &QTRS=0;
-*
-FINDQTR
-*
-READ YI853QTR NOCLOSE &QTRNM.20.
-IF &IORETURN NE 0 THEN GOTO ENDLOOP1;
-SET &QTRS=&QTRS+1;
-SET &QTRNM.&QTRS=&QTRNM;
-GOTO FINDQTR
-*
-ENDLOOP1
-*
-SET &PASS=0;
-REPEAT ENDLOOP2 &QTRS TIMES
 APP DELETEF tanf yi853_input ACCESS
 FILEDEF YI853ACX DISK tanf/yi853_input.acx ( LRECL 80 RECFM V
-RUN
-SET &PASS=&PASS+1;
-SET &&QTRNM=&QTRNM.&PASS;
-SET &&QTRNM=TRUNCATE(&&QTRNM);
-SET &ACX='SEGNAME=SHEETNM, WORKSHEET=' | &&QTRNM | ', HROWS=1, $';
-WRITE YI853ACX &ACX
-RUN
-*
 TABLE FILE YI853_INPUT
 COUNT ROWID
 END
-RUN
-ENDLOOP2

YI853QTR holds the various sheet names in yi853_input.xlsx. The first loop counts the entries and stores the sheet names in the &QTRNM.&QTRS (which is &QTRNM1, &QTRNM2, etc.). The second loop processes the excel spreadsheet, 1 sheet at a time. The key is the APP DELETEF command to delete the acx file. The funny thing is that I had tried using -UNIX rm opt/ibi/apps/tanf/yi853_input.acx where the APP DELETEF command is and that did not work. I'm guessing that using the -UNIX rm command, WebFOCUS doesn't know the acx file was deleted but using the APP DELETEF command it does so it knows to read the file again the next time the master is referenced.

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


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
September 11, 2019, 05:23 PM
dhagen
CHECK FILE

First line:

CHECK FILE also reloads the Master File and checks the Master File syntax.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
September 11, 2019, 05:49 PM
Waz



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!

September 12, 2019, 09:57 AM
jgelona
Yes, commenting out the APP DELETEF command and putting CHECK FILE YI853_INPUT before the TABLE command does work.

This bring up one of my pet peeves about help on IBI's website. After initially reading dhagen's reply I searched for CHECK FILE syntax and never saw the page linked above because I believe that is for Mainframe FOCUS. I found several completely different pages when I searched:

CHECK FILE 1

CHECK FILE 2

Notice how link provided by dhagen has the JOIN option and the 2 links above do not and the link provided by dhagen states "CHECK FILE also reloads the Master File" and the other links do not. Actually, of the all the pages on CHECK FILE syntax, this was the only link I read that implicitly stated that CHECK FILE reloads the master. It would be nice to have consistent language. I really wish IBI would reorganize their Search. For example, have a button to select a major release and have something that is for language syntax. Many times I get better results using Google than I do using IBI's search.

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


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.