November 09, 2007, 10:40 AM
johneyreport caster can't see the server variables value set inside a called FEX
Hi All,
I have an FEX file which for selecting the server settings dynamicaly.This will be included in any main fex programs to set the css path, report caster path, databse connection etc.
Sample code of my common.fex is as below,
-IF &FID_ENV EQ 'xxxxxxx.yyy.com' THEN GOTO DEV_CONN
-ELSE IF &FID_ENV EQ 'yyyyyy.yyy.com' THEN GOTO UAT_CONN
-DEV_CONN
-SET &SRVR='mydevserver';
-SET &SRVR_FULL_PATH='mydevserver/ibi/7.1.1/ibi/WebFOCUS711/basedir/';
-SET &SRVR_PATH='http://mydevserver.xxx.com:23000';
-SET &CSS='http://mydevserver.xxx.com:23000/approot/frec_code/frecsty.css';
-SET &DATABASE ='dev1';
-GOTO DONE_SRVR
-UAT_CONN
-SET &SRVR='myuatserver';
-
-
Now my issue comes here ,
If I run an FEX called main.fex which has the call to this common.fex directly from EDASERVE environment I am getting all the values and doing great, whereas if I schedule the same main.fex report in the report caster it is giving the error &FID_ENV is not set.
My main.fex will have following code related to this.
-INCLUDE common
-*dynamically construnct SQLS , BY clauses etc -here, then the dynamic values from common.fex will be used for next statement as &DATABASE,
ENGINE SQLORA SET DEFAULT_CONNECTION &DATABASE
SQL SQLORA PREPARE SQLOUT FOR
&SQLQRY1_FINAL
END
TABLE FILE SQLOUT
PRINT *
&BYVAL
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
Any idea, why the report caster can't see the varaible of &FID_ENV?
Thanks and regards,
Johney.
November 12, 2007, 12:23 AM
johneyThanks TexasStingray ,
Is there any alternative for this ?
Regards,
Johney.
November 12, 2007, 10:11 AM
GinnyJakesJohney,
Just a couple of ideas:
Can you pass a dummy variable from RC? On the task tab, go to Advanced and add the variable.
Also can you put a -DEFAULT in your common.fex?
November 18, 2007, 07:32 AM
johneyThanks Ginny,
I also thought the same logic, but I have one issue here as ,
I am not calling common.fex directly , it is just an INCLUDE in my main fex which is actualy getting called from report caster.How do I pass the values of the variable passed from caster to an INCLUDE call from main to common?
Any idea ?
Regards,
Johney.
November 19, 2007, 11:33 AM
cburttTry moving the parameters into &&vars.
These last for the whole session and are accessable to all INCLUDEd code.
1) Via the 'Advanced' button on the 'Task' tab, RCaster passes "FORD" to MAIN.fex as the value of parameter MAKE.
2) MAIN.fex contains:
-SET &&CAR_MAKE = &MAKE;
-INCLUDE COMMON
3) COMMON.fex contains:
-TYPE RCaster says "&&CAR_MAKE".
You will output "RCaster says "FORD".