Focal Point
[SOLVED] FOC2905 Trying to -INCLUDE &&IBI_IF_FILE

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

August 31, 2009, 06:28 PM
Dan Pinault
[SOLVED] FOC2905 Trying to -INCLUDE &&IBI_IF_FILE
Hi,

I'm trying to run a procedure that looks like this...
TABLE FILE SYSTABLE
SUM FST.NAME
BY NAME
-INCLUDE &&IBI_IF_FILE
ON TABLE PCHOLD FORMAT XML
END


In the users profile there is a line
 -SET &&IBI_IF_FILE = e:\[path]\includefiles.fex 


The contents of includefiles.fex is
 WHERE NAME EQ 'CAR' OR 'GGSALES'  


I've found two docs regarding this. One suggested using MRNOEDIT and the other suggested using a -DEFAULT. I've tried both but I keep getting "(FOC2905) &VARIABLE IS NOT ALLOWED AS A FILENAME IN THIS CONTEXT:"

Anyone have any suggestions on this?

Oh yeah, If I go to https://SERVER:PORT/ibi_html/homepage/adhoc.htm and paste the procedure shown above it works! Confused

Thanks,

Dan

This message has been edited. Last edited by: Dan Pinault,


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
September 01, 2009, 03:57 AM
GamP
When executing the procedure, is the value of the variable correct? You can show all variables with the command '-? &' in the fex.

Other question is: have you tried it as '-INCLUDE &&IBI_IF_FILE.EVAL'?


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 01, 2009, 10:59 AM
j.gross
"(FOC2905) &VARIABLE IS NOT ALLOWED AS A FILENAME IN THIS CONTEXT:
When operating under WFDESCRIBE, there are restrictions on where
an &VAR or &&VAR may be used. -INCLUDE is one of those cases."

I believe this means the following:

When Autoprompt is active (IBIF_wfdescribe = XMLRUN or XMLPROMPT), the server will pre-scan the fex, along with any files referenced therein by (server-side) -INCLUDE, to prompt for undefined amper vars referenced in the fex code. That pre-scan does not perform amper var substitution in the -INCLUDE directive line to determine the identify of the included child fex -- instead it issues FOC2905 and stops dead.

To achieve a server-side -INCLUDE for the module whose name is contained in a global var, I suggest you hide the entire -include in a local amper var:
-SET &where='-INCLUDE ' | &&IBI_IF_FILE ;

TABLE FILE ...
...
&where.EVAL
...
END


The Autoprompt pre-sccan will note that &where is defined by a -SET so not in need of Autoprompting, and will restrict itself to undefined vars it finds in the parent fex (plus any visible -INCLUDEs). Once the autoprompting is completed, the server's second-round execution on encountering

&where.EVAL

will evaluate and rescan the line, and find and process

-INCLUDE drive:\path\fexname

But any fex that you -INCLUDE in this manner had better not have amper variables that need Autoprompt!

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
September 01, 2009, 01:01 PM
Dan Pinault
Jack,

Way to outsmart the compiler! Good One Your technique of 'hiding' one variable inside another worked perfectly.

Thanks!

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
September 01, 2009, 06:42 PM
Gary Gerstung
The problem is your amper variable only contains the path you set it to not the contents of the file. This should solve your problem:
Step 1: filedef a file using your amper variable
ex: FILEDEF XYZ DISK &&IBI_IF_FILE.EVAL
Step 2: Prior to your table request insert lines
-READ XYZ &WHERE_STMT.A80
-RUN
Step3 : In your table request insert the line
&WHERE_STMT.EVAL