Does anyone know how to call a focexec from within a Win2K Batch procedure run on the Reporting Server?
Calling a FOCEXEC from a batch program requires you to call the WebFOCUS server directly or the WebFOCUS client directly. The WebFOCUS server is more consistent as installation options go, so here are a few hints for its use:
In your \ibi\srv52\wfs\bin directory you will find "edastart.bat". This allows you to start the server, run a "FOCUS" session and call programs with various flags. The flag you need for running batch (if your program does a HOLD or SAVE) is:
edastart -x fexname
Try edastart -? to get more options. I use edastart -t for testing. All the paths, etc. are as defined in your edasprof.prf
Put this call in a batch file and you're done!
You can write a small c or visual basic program that can be used to launch a focus RPC (fex). I wrote two, one uses http connections to webfocus and returns the resulting report in html - the other uses the API instead of http. This version returns the report as plain text.
The API code is based on the example code supplied with the eda client. The code currently processes SQL queries. All you have to do is to modify it to process RPC calls. The function you will need to get info on is EDARPC. There were only a few changes that needed to be made to make the thing work.
The exe file will have to accept parameters like, eda_server_name, id, password, fex_name, and a parameter string that will be passed into the fex.
We use this exe to launch RPCs from within other focus fexs and to launch RPCs from batch files and using the scheduler.
Charles in New Orleans
One other thing to understand w.r.t. John's suggestion of using the "edastart -x" option is that the command executed runs within its own dedicated tscom3 process. It does not connect to the WebFOCUS server via a normal client/server EDA connection, does not get managed by the server's Workspace Manager, and does not use one of the Reporting Server's tscom3 agent processes.
In fact the Reporting Server does not have to be running at all in order for you to use "edastart -x".
If you do use "edastart -x" you can also look at redirecting any error messages or output to a log file, e.g., "edastart -x EX CARINST >> carinst.log".
All the best,
|Powered by Social Strata|