As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you have any questions or need access: Contact email@example.com
this is going to be a little difficult unless none of the defines reference any fields (or every TABLE request is against the same file name.) All defines are unique to the table/segment where they are defined. For example
DEFINE FILE CAR DMARGIN=RCOST - DCOST; END
would not work if you TABLE FILE EMPLOYEE because those fields don't exist in employee.
If you have something like
DEFINE FILE CAR TODAY_DT/YYMD='&YYMD'; END
where no real fields are referenced you could make it work. If you want TODAY_DT to be available in ANY request, add it to a .FEX without the DEFINE or END statements.
DATEFEX.FEX would look like
Note that this fex does NOT have to be standalone code (can be run by itself).
Then you could
DEFINE FILE CAR -INCLUDE DATEFEX END
DEFINE FILE EMPLOYEE -INCLUDE DATEFEX END
The other alternative would be to include those define statements in each of the Master Files that you would use. This, however, causes problems sometimes when using amper variables because the MFD can't be parsed correctly.This message has been edited. Last edited by: Darin Lee,
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
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
If the DEFINE is based on columns in the specific table, why not put the define in the master for the table itself? That way any report that uses the table would have access to the define statement, without having to code it in the report. The drawback is that the master would have to be manually edited to add the define, and you'd have to remember to edit it again, if you ever recreate the master.
Diptesh WF 7.1.7 - AIX, MVS
Posts: 79 | Location: Warren, NJ, USA | Registered: October 25, 2006
Keep in mind that if you put a define in the MFD, it will execute every time, for every row of data. In my experience, it seemed to execute even if you don't use it. We experienced a HUGE drop in response time doing that.
As for how it would look, it would look like a regular define statment but Darin is correct, you'd have to know what to Define. I also made access to everyone for different version of the date and time, but I didn't use DEFINE, I used -SETs like this:
-***-SET &ECHO='ALL'; -* ZISYSDAT.FEX - Uses the current system date to determine various date/time derivations. -* CREATED: 10/03/2005 - CMALLAIN -* UPDATED: -*------------------------------------------------------------------------------------- -DEFAULT &NOWYYMD='99999999'; -* -*IMPORTANT NOTE: -*IMPORTANT NOTE: -*IMPORTANT NOTE: -*IMPORTANT NOTE: -*IMPORTANT NOTE: -*in EVERY program that uses this, you MUST set &NOWYYMD to the date that you wish -* to process. Most likely it will be today's date, but then it's easily changeable -* for testing purposes. -* -****copy this to your code and set as needed --> -SET &NOWYYMD='&YYMD.EVAL'; -* -*just in case, it's forgotten, I'm going to default it to 99999999 and if -* it's not there, then I'll default it to the current date.... -SET &XNOWYYMD=IF '&NOWYYMD.EVAL' EQ '99999999' THEN '&YYMD.EVAL' ELSE '&NOWYYMD.EVAL'; -* -*now restate the original field with the value. It's better to see this transition using -* 2 steps instead of just revising the original...trust me. -SET &NOWYYMD='&XNOWYYMD.EVAL'; -* -*pick out the current year -SET &NOWYEAR=EDIT(&NOWYYMD,'9999$$$$');
I can email you the whole thing if you'd like.
I'm not sure how you're going to use these but if it's for date checking, then you can just use the &ervar and not waste the system time to redefine a new field.
Posts: 36 | Location: Rolling Meadows, IL | Registered: September 05, 2007
You ask for a define but you suggest something like &YYMD
These are two different things.
I would suggest to use the edasprof.prf file to put amper values you use every day in several reports. It's all done with -SET commands and you create double amper values like "&&YESTERDAY" or "&&PREVWORKDAY"
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
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006