Focal Point
Accessing a Hold File on reloading a page

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

January 29, 2004, 08:35 AM
<JOMC26>
Accessing a Hold File on reloading a page
I am creating a filter page which loads from one stored procedure. I want to load this once into a hold file and then on re-loading the page access this pre-loaded file. Is this possible? I am including some code using CAR which on reload doesn't have access to the hold file created? I am having problems adding the code here as there are no tags allowed.

First file just launches the fex with variables used to decide whether this is a reload or first time loading.
-SET &RELOAD = N;

-HTMLFORM BEGIN
html
head
SCRIPT
function loadMenu()
{
// This is the profile used to kick off the filter screen.

var fileName = "/cgi-bin/ibi_cgi/ibiweb.exe";

var params = "?IBIMR_action=MR_RUN_FEX&" +
"IBIMR_sub_action=MR_STD_REPORT&" +
"IBIMR_fex=app%2flaunchfi%2efex&" +
"IBIMR_folder=%23performancet&" +
"IBIMR_domain=afprdmdv%2fafprdmdv%2ehtm&" +
"RELOAD=&RELOAD&" +
"IBIMR_Random=" + Math.random() + "&"
;

location.replace(fileName + params);
}
/SCRIPT
/head
body on Load="javascript:loadMenu();" bgcolor="white"

Loading filter screen...


-HTMLFORM END


The second file launchfi.fex is the filter and on the first run through this page creates a hold file and I am trying to get it so the next time the page loads it can just read from this hold file? Is this possible or do hold files disappear from memory at this stage?

-IF &RELOAD EQ 'Y' THEN GOTO RERUN;
TABLE FILE CAR
PRINT
CAR
ON TABLE HOLD AS CARINFO FORMAT ALPHA
END

DEFINE FILE CARINFO
CARSELECT/A120=
'';
END

TABLE FILE CARINFO
PRINT CARSELECT
ON TABLE HOLD AS CARDD FORMAT ALPHA
END

-IF &RELOAD EQ 'N' THEN GOTO RERUN;
-RERUN
DEFINE FILE CARINFO
CARSELECT/A120=
'';
END

TABLE FILE CARINFO
PRINT CARSELECT
ON TABLE HOLD AS CARDD FORMAT ALPHA
END
-RERUN
-HTMLFORM BEGIN
html
head

SCRIPT
function FilterChanged()
{
// Reload the page in the current
document.forms[0].target = "_self";

document.forms[0].IBIMR_domain.value='.../....htm';
document.forms[0].IBIMR_folder.value='#...t';
document.forms[0].IBIMR_fex.value= 'app/launchfi.fex';
document.forms[0].IBIF_ex.value='app/launchfi.fex';
document.forms[0].RELOAD.value='Y';

document.forms[0].submit();
}
/SCRIPT
/head
body bgcolor="white"
form action="/cgi-bin/ibi_cgi/ibiweb.exe"
method="post" target="report"
TABLE
TR
TD CAR
SELECT name="CAR" on change="FilterChanged();"
OPTION value="ALL" selected All /OPTION
!IBI.FIL.CARDD;
/SELECT
/TD
/TABLE
/body
input type='hidden' name='IBIMR_domain' value=".../.....htm"
input type='hidden' name='IBIMR_action' value="MR_RUN_FEX"
input type='hidden' name='IBIMR_sub_action' value="MR_STD_REPORT"
input type='hidden' name='IBIMR_fex' value="app/....fex"
input type='hidden' name='IBIF_ex' value="app/....fex"
input type='hidden' name='IBIMR_drill' value="RUNNID"
input type='hidden' name='IBIMR_folder' value="#xtestingarea"
input type='hidden' name='IBIMR_defer' value=""
input type='hidden' name='IBIMR_random' value=''
input type='hidden' name='RELOAD' value=''

/FORM
/html
-HTMLFORM END
February 04, 2004, 02:18 PM
<mhuber>
You might want to look into the TEMPERASE parameter. When TEMPERASE is OFF, it won't erase your temporary files (in other words, it will write your HOLD files somewhere to the file system). The WF documentation might not be entirely accurate about the ON/OFF actions.

TREAD LIGHTLY WITH THIS PARAMETER SETTING!!
The setting is persistent with the WF Agent that processes your request... meaning that even after execution is finished, that agent will always store HOLD files on the file system (no matter what FEX it's running) until the agent dies. We had some pretty crazy problems with the GUI after we played around with TEMPERASE, and had to wipe out all our agents before getting the system back to normal.

In the right environment, TEMPERASE might be a viable option, though.

Just a thought.
-Michael
February 04, 2004, 04:42 PM
susannah
wow. i didn't know about TEMPERASE. cool.
February 06, 2004, 07:47 PM
<Kyle>
SET TEMPERASE=OFF isn't much use unless you use it with SET TEMPDIR=(a directory). By itself, TEMPERASE simply leaves the files in the edatemp\tsxxxxx directories. There is no guarantee when you run the next report you will use the same temporary directories from the previous request.

NOTE: Creating permanent HOLD files in a multi-user environment can result in a very unstable environment. It's best to create these files through some sort of batch or scheduled process if possible. Also, you can create temporary directories that are specific to certain users through amper variables:

SET TEMPDIR=c:\ibi\apps\&USERID

This way users don't have to worry about stepping on each other. Of course, it requires you to have a way of identifying individual users. Using MRE or the WebFOCUS Server's authentication capabilities will suffice.

In the 52x architecture, you might try using the APP commands such as APP HOLD and APP MAP. You can duplicate the TEMPERASE and TEMPDIR commands like the following:

APP MAP WFTEMP c:\ibi\apps\&USERID
APP HOLD WFTEMP

Hope this helps.