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     [CLOSED] How to clear foccache directory from FOCUS?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to clear foccache directory from FOCUS?
 Login/Join
 
Virtuoso
posted
We have a number of procedures that are started after each other as tasks in the same ReportCaster schedule. Each task accumulates quite a bit of data in the foccache directory for that session, which regularly results in our server running out of disk space (and abort the RC job).

We have just over 20GB of free disk space right now. Apparently our nightly jobs manage to fill that up temporarily, until the foccaches are cleared again after 3 hours.
We can't really reduce that time, because some RC tasks require that much time to complete, so we are wondering whether it's possible to explicitly clear the foccache of the reportcaster session when we know there's nothing in there that we still need.

Is there such a command?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Gold member
posted Hide Post
Hi,

dunno if this helps but I use the following code to determine the current foccache path for the current agent:

-* *********************
-* * Returns the path to current foccache folder in
-* * &FOCCACHE_PATH
-* * -> if empty then function failed
-* *********************

-SET &FOC_HOLD_NAME = 'FCHOLD_NEVER_USED';

-SET &FOCCACHE_PATH = '';
-SET &FOCCACHE_FILEPATH = '';

TABLE FILE CAR
PRINT CAR
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS FOCCACHE/&FOC_HOLD_NAME FORMAT ALPHA
END
-RUN

TABLE FILE SYSFILES
PRINT
  COMPUTE PATH/A1024 = PHNAME;
WHERE FILENAME EQ LOCASE(&FOC_HOLD_NAME.LENGTH, &FOC_HOLD_NAME.QUOTEDSTRING, 'A200');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS H_FOCPATH FORMAT ALPHA
END
-RUN
-IF &LINES EQ 0 THEN GOTO L_ERROR;
-READ H_FOCPATH &FOCCACHE_FILEPATH.A1024.
-SET &FOCCACHE_FILEPATH = TRUNCATE(&FOCCACHE_FILEPATH);

-* extract filename & remove
-SET &PATH_FILEPART1 = GETTOK(&FOCCACHE_FILEPATH.QUOTEDSTRING, &FOCCACHE_FILEPATH.LENGTH, -1, '\\', 1024, 'A1024');
-SET &PATH_FILEPART1 = TRUNCATE(&PATH_FILEPART1);
-SET &PATH_FILEPART2 = GETTOK(&FOCCACHE_FILEPATH.QUOTEDSTRING, &FOCCACHE_FILEPATH.LENGTH, -1, '/', 1024, 'A1024');
-SET &PATH_FILEPART2 = TRUNCATE(&PATH_FILEPART2);

-SET &PATH_FILEPART =
-   IF &PATH_FILEPART1.LENGTH EQ 0 THEN &PATH_FILEPART2.QUOTEDSTRING
-   ELSE IF &PATH_FILEPART2.LENGTH EQ 0 THEN &PATH_FILEPART1.QUOTEDSTRING
-   ELSE IF &PATH_FILEPART2.LENGTH LT &PATH_FILEPART1.LENGTH THEN &PATH_FILEPART2.QUOTEDSTRING
-   ELSE &PATH_FILEPART1.QUOTEDSTRING;

-SET &FOCCACHE_PATH = SUBSTR(&FOCCACHE_FILEPATH.LENGTH, &FOCCACHE_FILEPATH.QUOTEDSTRING, 1, &FOCCACHE_FILEPATH.LENGTH - &PATH_FILEPART.LENGTH, &FOCCACHE_FILEPATH.LENGTH - &PATH_FILEPART.LENGTH, 'A1024');
-SET &FOCCACHE_PATH = TRUNCATE(&FOCCACHE_PATH);

-L_ERROR


You could afterwards just "-DOS del &FOCCACHE_PATH|\*.*" or something.


WebFOCUS 7.7.03
 
Posts: 67 | Registered: January 05, 2011Report This Post
Virtuoso
posted Hide Post
Good One

I took the liberty to simplify the logic a bit but the concept is exactly the same. I will definitely take advantage of such a pretty neat technique, linnex. Thanks.

-SET &FOC_HOLD_NAME    = 'FCHOLD_NEVER_USED';

-SET &FOC_HOLD_NAME_LC = LOCASE(&FOC_HOLD_NAME.LENGTH, &FOC_HOLD_NAME.QUOTEDSTRING, 'A&FOC_HOLD_NAME');
-* Change '\' below to '/' or any directory delimiter used by the OS where EDASERVE runs
-SET &FOC_FILE_NAME    = '\' || &FOC_HOLD_NAME_LC || '.mas';

-SET &FOCCACHE_PATH     = '';

TABLE FILE CAR
PRINT CAR
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS FOCCACHE/&FOC_HOLD_NAME FORMAT ALPHA
END
-RUN

TABLE FILE SYSFILES
PRINT
        COMPUTE FOCCACHE_PATH/A80 = STRREP(80, PHNAME, &FOC_FILE_NAME.LENGTH, &FOC_FILE_NAME.QUOTEDSTRING, 0, '', 80, FOCCACHE_PATH);
WHERE FILENAME EQ &FOC_HOLD_NAME_LC.QUOTEDSTRING;
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD AS H_FOCPATH FORMAT ALPHA
END
-RUN
-IF &LINES EQ 0 THEN GOTO L_ERROR;

-READFILE H_FOCPATH
-SET &FOCCACHE_PATH = TRUNCATE(&FOCCACHE_PATH);
-TYPE FOCCACHE_PATH -> &FOCCACHE_PATH

-L_ERROR



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
Do you need to put all this stuff in foccache ?


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
Expert
posted Hide Post
Good point Waz, If this is all session based information, then it's available during the session without APP HOLDing to foccache, right?.
quote:
Each task accumulates quite a bit of data in the foccache directory for that session.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
You do have a point there. I'll check the results tomorrow when the RC job has run.

BTW, we AVOID using APP HOLD in (recent) reports. We use explicit paths to write our hold files to, such as:
ON TABLE HOLD AS MYAPP/MYHOLD FORMAT FOCUS
. We do the same for files that we write to FOCCACHE.

We found that APP HOLD was causing more problems than it solved. A scenario that we're too familiar with:

  • Create a procedure and start with APP HOLD MYAPP
  • Write several temporary HOLD files that end up in MYAPP instead of in session storage space
  • Display your report
  • Deploy the report to the server
  • Realize one day that those temporary hold files needlessly take up space and rewrite your code to put those in FOCCACHE (or the session, same result IIRC)
  • Deploy the improved version
  • Spend a few days being smug about how you solved that problem
  • Get a call from a user that the data is incorrect
  • Discover that the report was using the data from the temporary HOLD-files in the project directory (that were still around) instead of the ones from the session


The above scenario happens too easy if you have long warehouse-loading procedures that have been modified over time. It's too easy to miss a single APP HOLD statement several screens up in the code and accidentally write data that is supposed to be temporary (and possibly user specific) to the project directory instead of the session.


The annoying thing is that hold files that you need in launch pages, often user-specific, need to be in the app path to allow HTMLComposer to find them. The silly bugger is NOT looking in FOCCACHE for some reason and you can't add that directory to the path unless you put your foccache among your project directories (eeew!)...
We frequently end up writing a quick hold-file to our project directory so that HTMLComposer has something to work with and then remove that again as soon as the launch page works. Oh, and of course you need to modify all instances of ibiapp_app="aaa bbb ccc etc" in the HTML to include the foccache directory!


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
I am guessing you are doing data extracts. If you are creating multiple intermediate hold files within a report caster job.
You could overwrite them when they are no longer needed to free up disk space. Used this on a project when we were having disk space issues.

-* Determine the edatemp folder of the agent
-SET &TEMP_PATH_X = TEMPPATH(1000,'A1000');
-SET &TEMP_PATH   = TRUNCATE(&TEMP_PATH_X);


TABLE FILE CAR
PRINT
   CAR
   COUNTRY
   MODEL
ON TABLE HOLD AS H1 FORMAT ALPHA
END
-RUN


TABLE FILE H1
PRINT
   COUNTRY
ON TABLE HOLD AS H2 FORMAT ALPHA
END
-RUN



-* Clean up H1 we no longer need it.
-* This can be made into an EXEC routine.

-SET &HOLD_FORMAT = 'ALPHA'; 
-SET &HOLD_FILE   = 'H1';

-* Map to agent folder so we can store our new hold file there
APP MAP agent_folder &TEMP_PATH
-RUN
 
-* Set APP HOLD
APP HOLD agent_folder
-RUN
 
-* Overwrite the hold file in the agent folder
TABLE FILE CAR
PRINT
   CAR
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS &HOLD_FILE FORMAT &HOLD_FORMAT
END
-RUN
 
-* Clear APP HOLD
APP HOLD
-RUN


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report 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     [CLOSED] How to clear foccache directory from FOCUS?

Copyright © 1996-2020 Information Builders