Focal Point
[SOLVED] Input file variable

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

October 13, 2008, 02:09 PM
JohnM
[SOLVED] Input file variable
I would like to be able to pass an input file variable to a procedure.
Example: The first line of a procedure is:
TABLE FILE ENCOUNTER_FY07_MDENT

I would like to replace the year portion of the file name with a variable, such as:
TABLE FILE ENCOUNTER_&year_MDENT

I would like to be able to pass the value for that variable from a drop-down list that would have values such as: FY07,FY08,CY07,CY08...etc.

For this specific application all of the &year varable choices will be the same for all procedures. Because of this, I would like to keep the values for the &year variable in one file to facilitate maintenance. That one file would be used as input to the drop-down list for any procedures that allow a choice of year.

From reading the documentation, the forums, and taking a few classes, it seems that the best way is to use the HTML Layout Painter to populate the drop-down list with values that could be passed to the procedure (.fex).

I have not been able to figure out exactly how to do that yet, and was hoping someone could supply me with some specifics about the code and techniques that would be required to accomplish this task.

Thank you very much.

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


WebFocus 7.7.02, Windows
October 13, 2008, 03:57 PM
Mike Honeycutt
I do something similar with the INCLUDE command. I put all the commands in a FEX file and then "include" the FEX as needed in other FEXs.

-INCLUDE mahoneyc:mahoneyc/course.fex

In my case, maintaining the included FEX is easier since creating data files on the Webfocus server seems to be prohibited.


WebFocus 7.6.6, Windows
October 13, 2008, 03:59 PM
FrankDutch
John
the simple way...

-PROMPT &YEAR.suply the yearnumber.
-SET &FILENAME='ENCOUNTER_'||'&YEAR'||'_MDENT';

....
TABLE FILE &FILENAME
...





Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

October 15, 2008, 04:18 PM
JohnM
Frank, thanks, but I was looking for a solution with a re-usable list.

Mike, could you be more specific about the commands you have in your FEX?

Thanks.


WebFocus 7.7.02, Windows
October 15, 2008, 04:36 PM
GinnyJakes
John,

I think I finally understand what you want.

Using an editor, create a file on your platform somewhere in ibi\apps and type in all of the values for &YEAR. Create a master for this flat file and put a DATASET parameter in it to point to the physical file. Make sure that the file is accessible via the global path in edasprof or is in the application path or you will have to mess with the html IBIAPP_app variable.

Now in the HTML Painter, for the control for the year variable, point to this file. As my boss would say, eazy-schmeazy.

Let me know what you don't understand.


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 15, 2008, 05:11 PM
JohnM
Pardon me but I am still new at this. Why do I create a master file for this flat file? Does that support it's use in the HTML painter to populate the drop-down list?

Thanks


WebFocus 7.7.02, Windows
October 15, 2008, 05:16 PM
GinnyJakes
Yes, absolutely. It would be a very simple one, 3-4 lines, one field. You then reference that master with the DATASET parameter pointing to the physical file in the HTML Layout Painter.

Remember, in order to get the data in the file, a query is generated against the file/master under the covers when your page is run.


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 15, 2008, 05:30 PM
JohnM
Thanks Ginny. This is the exact type of solution I was looking for.

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


WebFocus 7.7.02, Windows