Focal Point
[SOLVED] Running batch WebFOCUS using edastart

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

October 22, 2008, 11:46 AM
Stan
[SOLVED] Running batch WebFOCUS using edastart
Hello all...I'm in a bit of a pickle as we have for years used Unix FOCUS as a tool for writing batch FOCUS. Unfortunately, without consulting my lowly self, my company is going to Linux Servers and IBI does not have a Linux version of Unix FOCUS. No problem, I thought I would use this opportunity to start learning how to run using the edastart command in our WebFOCUS installation.

I've been able to get a fex to run, however I have a few questions that I'm hopeful someone here can help me answer.

Currently, when I use a FILEDEF statement to place the '.ftm' output of a hold file into a different directory, I'm getting gibberish characters in the different directory. When I stay in the srv71/wfs/bin directory I'm able to see the results in the t30 file, but the minute I do a hold file it goes to gibberish.

Secondly, how does edastart look for the fexes...What directory do they have to be stored in?

Sorry if these are basic questions, but I'm a pretty basic guy.

This message has been edited. Last edited by: Kerry,
October 22, 2008, 12:03 PM
GinnyJakes
Stan,

The first thing you need to do is go to your profile and update your signature with your products, releases, and platforms so that we can better help you.

The second thing I'd recommend that you do is go to the doc link in the upper righthand corner and look for the server adminstration manual for your platform and pay special attention to the application pathing section, i.e. the APP command. Also look at profiles.

But let me quickly try to resolve your issues.

For the hold file, say ON TABLE HOLD FORMAT ALPHA. WebFOCUS by default saves all hold files in binary which is why you might be getting unreadable characters.

The WF reporting server, for which you are running a stand-alone copy when you run edastart -t, looks for programs in ibi/apps based on the contents of the global profile, edasprof.prf in wfs/etc and the contents of user profiles userid.prf in /WebFOCUS/ibi/profiles or whereever you said to put them during the install.

If you don't have any of those, you will have to type an APP PREPENDPATH dirname1 dirname2 after you run edastart -t.

I hope this helps. Once you understand the architecture, it will all become clear.

You can also run focexecs from the welcome page understanding that application pathing is important here too.

http://your-webserver/ibi_apps/welcome.jsp

Have fun!


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
October 23, 2008, 09:34 AM
jgelona
Stan,

5-6 years ago I was in the same boat. We used FOCUS for HP-UX and we moved to a Linux guest on a z90 mainframe. Here's what I do. I developed 3 pieces. This way I run any batch job from Report Caster or from cron.

The following is yifex.sh

#!/bin/ksh
umask 000
export ORACLE_SID=KIDS
export ORACLE_BASE=/opt/ibi/10gClient
export ORACLE_HOME=/opt/ibi/10gClient
export ORAENV_ASK=NO
export EDACONF=/opt/ibi/713/ibi/srv71/wfs
export EDATEMP=/opt/ibi/apps/temp/$1
export EDAPROF=.
export EDAPATH=.
export FOCUSFEX=$1
export KIDSHOME=/home/eda
TEMPDIR=/opt/ibi/apps/temp/$1
if [ ! -d $TEMPDIR ];
  then echo '$TEMPDIR does not exist...Creating.'
       mkdir $TEMPDIR
       chmod 774 $TEMPDIR
  else echo '$TEMPDIR exists.'
fi
cd $EDATEMP
pwd
$EDACONF/bin/edastart -f $KIDSHOME/yifex.t3i
#
#  Set environment variable to the current date (YYYYMMDD format)
#
CURRDT=$(/bin/date +%Y%m%d)
mv yifex.t3o $KIDSHOME/msgfiles/$1.$CURRDT
cd $KIDSHOME
rm $EDATEMP/* 2>/dev/null
rmdir $EDATEMP


Here's yifex.t3i

%connect
%begin
EX YIFEX
%end
%disconnect
%stop_server


The following is yifex.fex in baseapp.

-SET &PGM=FGETENV(8,FOCUSFEX,8,'A8');
-SET &PGM=UPCASE(8,&PGM,'A8');
 EX &PGM


Now, putting all the pieces together I can run a job from Report Caster by creating a fex name lnch640 and have RC run the job. lnch640 contains:

-UNIX /home/eda/yifex.sh yi640 (yi640 is the fex being run)


If you have a job stream, then your launch fex would look like this.
-UNIX /home/eda/yifex.sh yi640
-UNIX /home/eda/yifex.sh yi600
-UNIX /home/eda/yifex.sh yi643
etc.


If running from cron, just leave the -UNIX off.

One of the nice things this does, is give me the SYSPRINT messages and stores them in a file. If the user later reports a problem, I can review the execution messages and see if there was some type of FOC error.

One other reason for doing this. If you don't do it this way, if several batch jobs are running at the same time, they will use the same temp folder, which could very easily cause all kinds of problems.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
October 23, 2008, 04:36 PM
Waz
There are other options when it come to running a WF server like FOCUS.

Ginny has already mentioned edastart -t, which gives you the old familiar focus prompt.

John has mentioned edastart -f <script>, which runs a script file.

You can also use edastart -x "focus command", which is the same as edastart -t and execute a focus command like "EX CARTEST".


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!