Focal Point
Variable MFD file name

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

July 25, 2007, 05:35 PM
gregson06
Variable MFD file name
Okay, here's a real whopper. A user is requesting that they be able to specify the name of the data file that the MFD definition is pointing to. Is this even possible to pass a variable that is the filename? I would imagine that it would be something like:

DATASET='/pathname/&filename'

Is this even possible or is it just crazy-talk?

Thanks!

Oh yeah, running WebFOCUS 5.3

This message has been edited. Last edited by: gregson06,
July 25, 2007, 05:45 PM
Leah
We do it all the time in our 'production environment' Of course it's not the whole MFD name but part of it.

Example

RTRTTBL_UNO_®ION

REGION is passed as a parameter. We have three versions, PROD, TEST and QUAL. Of course when developing the report or what ever have to use a -SET command for the parameter so you can do what you need. Of course with the way DEV stuio tags everything you may have some issues there.

Where the html shows the registered trade mark symbol it is actually the characters '&' 'R' 'E' and 'G' in other words the word REGION proceeded by the '&'.


Leah
July 25, 2007, 05:55 PM
gregson06
So how would the variable name be referenced in the MFD definition?

I would think that it would be like:

DATASET=&FILENAME

but I've never passed a variable to an MFD, I think that's where I get stuck in this procedure.
July 25, 2007, 05:59 PM
Darin Lee
You wouldn't be able do insert the &FILENAME in the master file. However, you can FILEDEF (or DYNAM ALLOC or whatever is appropriate for you platform). You would need to remove the DATASET specification from teh MFD. This is how we dynamically determine the data set that will be accessed.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
July 25, 2007, 06:47 PM
gregson06
Is there an example, perhaps, that can be pointed out on this? I am not very familiar with FILEDEFs in this fashion. I sometimes use them to create temporary hold files, but beyond that they're relatively new to me.
July 25, 2007, 07:02 PM
gregson06
Nevermind, figured it out, but that basically did it thanks! I had to define it on the FILEDEF statement, of course I can use the & symbol to specify the file there.

Thanks again!
July 26, 2007, 08:46 AM
jgelona
I asked for this a while back as a new feature request. Not so much for the file name as the path, for example,

DATASET=&PATH&FILENAME

They (IBI) said that since you can accomplish the same thing with USE and FILEDEF and because it would radically change the way the .mas files are processed, they declined.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
July 26, 2007, 09:55 AM
Edan
My favorite feature in WebFOCUS is being able to use dialog manager. It is a shame that Masters can't have embeded dialog manager.

The way I envision dialog manager working with masters would be similoar to an -INCLUDE. Whenever the Master is initially invoked or at a CHECK FILE ... statement, the Master would be parsed. The normal lines in a master would be have like regular WebFOCUS statements and be put on the focstack. All dialog manager variables and statements would work to generate the focstack.
July 26, 2007, 10:51 AM
John_Edwards
How often does the update need to occur, and is it user-specific?

If I was to go after this critter I would look into using an external tool to rewrite the master file -- a scripting tool or the like, depending on the OS. Since only one small bit is changing it would be a simple concatenation of three pieces.

But! the change would apply globally since the MFD is in a public space. If it needs to change dynamically for each user, and on each run, trouble. If it needs to change overnight or when a new file arrives, it's not so bad.

I-Way may even be able to create the file for you if you want to stay in the IB toolset. The above caveats still apply though.

J.