Focal Point
[CLOSED] pass Parameters in EX command.?

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

March 03, 2011, 10:02 AM
Kris K
[CLOSED] pass Parameters in EX command.?
Hi all,
can someone please explain me with a simple example on How to pass the parameters in the EX COMMAND.
i know that passing parameters can't be done using the Include so want to accomplish that using the EX COMMAND.

please reply with a simple example,for getting a better idea.

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


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
March 03, 2011, 10:16 AM
<FreSte>
EX [fexname] MONTH=1, YEAR=2011
March 03, 2011, 10:21 AM
Kris K
if i want to pass Dynamic parameters,wht is the change i need tom ake in the above example which you provided.


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
March 03, 2011, 10:33 AM
<FreSte>
That could be something like this:

-SET &ECHO='ALL';
-SET &YEAR = 2011;
TABLE FILE CAR
  BY COUNTRY
  IF RECORDLIMIT EQ 1
  ON TABLE SET HOLDLIST PRINTONLY
  ON TABLE HOLD FORMAT ALPHA
END
-RUN
-READ HOLD, &TEMP

EX [fexname] COUNTRY=&TEMP, YEAR=&YEAR

March 03, 2011, 10:42 AM
TommyKnocker
Hi Kris,
This code work fine for us.

-* Dinamically parameters loads

-SET &NPROC = 'MYFEX';
-SET &MAXLIMIT = 3;

-* Our param names comes as param1#param2#param3
-* and the values from web as param1=value1 param2=value2 param3=value3

-REPEAT GCOMBOPARAMS FOR &COUNTER2 FROM 1 TO &MAXLIMIT
-SET &PARAM = GETTOK(&PARAMS, 255, &COUNTER2, '#', 50, 'A50');
-SET &THEVAL = '&' || &PARAM;
-SET &ENTPARAMS = IF &COUNTER2 NE &MAXLIMIX THEN &ENTPARAMS || '&' || &PARAM || '=' || &THEVAL.EVAL || ', ' ELSE &ENTPARAMS || '&' || &PARAM || '=' || &THEVAL.EVAL;
-GCOMBOPARAMS

EXEC &NPROC &ENTPARAMS
-RUN

Hope this can help you.
TK.


DS 7.6.11
iSM 5.5, 5.6, 6.0.X
WXP, Ubuntu 10.04 LTS
March 03, 2011, 11:11 AM
Kris K
Hi tommy,
if the parametrs are coming from the excel or .csv or.txt file,what is the change need to be done.


WebFOCUS 7.6.10
Windows
all output (Excel, HTML, PDF)
March 03, 2011, 03:47 PM
Waz
Hris, this is basic stuff, have you had training, I would suggest it.

With a situation like this, I would suggest perhaps passing in the location of the CSV or TXT file that contains the variables,and then process these in the fex.

If you use a TXT file, and the format is FOCUS code, like:
-SET &PARM1='Val1';
-SET &PARM2='Val2';
-SET &PARMn='Valn';

Then you can -INCLUDE the file and it will be executed evaluating the commands, and the parameters will be available.

There are many more ways to do this, it all depends on your situation and what is provided in the CSV or TXT file.


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!