Focal Point Banner


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.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Creating a variable from a table to be used as a Global

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Creating a variable from a table to be used as a Global
 Login/Join
 
Platinum Member
posted
This should be easy but I'm stumped...... Confused

I would like to create a variable from a field on a table to be used in multiple focexecs in my domain. Like a Global ?

My first thought was a simple -INCLUDE but I don't know how to pass variables between focexecs in the -INCLUDE

My particular need is to extract a date value from a parameter table. Then use that date in all my other focexecs to pull info based upon this date.

For Example:
DEFINE FILE WCPARMS
REPT_DATE/A4 = EDIT (TXPARM, $$$$9999');
END
TABLE FILE WCPARMS
PRINT REPT_DATE (field to be used for date check)
END

How do I get REPT_DATE set up so my other focexecs can use it like a global?

TABLE FILE BU01
PRINT FLDA FLDB
WHERE FLD_YEAR EQ &&REPT_DATE
END


Thanks in advance for any assistance
 
Posts: 132 | Location: Kansas | Registered: November 12, 2003Report This Post
<Kyle>
posted
Try this:

DEFINE FILE EMPLOYEE
NEWDATE/MDYY=HIRE_DATE;
END
TABLE FILE EMPLOYEE
SUM MAX.NEWDATE
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1, &LDATE
-* The TYPE is simply for testing purposes.
-TYPE &LDATE


Simply -INCLUDE this routine at the top of your focexecs.
 
Report This Post
Platinum Member
posted Hide Post
That worked GREAT ...... Is it possible to create more than one for example:

It currently works great with just the Budget_cy being passed .... can I pass NY and PY also ....

I tried a couple of things with no luck ... I'm sure it was bad syntax on my part .....

I'm going to go give you a 5 star rating for helping me with this one......

DEFINE FILE WRCPARM
BUDGET_CY/A4 = EDIT( TX_DATACOL , '9999' );
BUDGET_NY/A4 = EDIT( TX_DATACOL , '$$$$9999');
BUDGET_PY/A4 = EDIT( TX_DATACOL , '$$$$$$$$9999');
END
TABLE FILE WRCPARM
SUM BUDGET_CY
WHERE ID_TABLE_NAME EQ 'BULABOR'
WHERE ID_KEYCOL EQ 'BUCURRYR3000'
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1, &&BUDGET_CY
-TYPE &&BUDGET_CY
 
Posts: 132 | Location: Kansas | Registered: November 12, 2003Report This Post
<Kyle>
posted
You can create more than one. In the example below, I changed the -READ syntax slightly. Notice I don't have a comma after HOLD1 and individual variables have the format specified after them. These options mean you are reading fixed format file. See the doc I mention below for more details.

DEFINE FILE EMPLOYEE
NEWDATE/MDYY=HIRE_DATE;
END
TABLE FILE EMPLOYEE
SUM MAX.NEWDATE MAX.EMP_ID
ON TABLE HOLD AS HOLD1 FORMAT ALPHA
END
-RUN
-READ HOLD1 &LDATE.A8. &MAX_EMP.A9.

-TYPE &LDATE
-TYPE &MAX_EMP

Look in the Developing Reporting Applications manual (DN4500514.0903) for more examples of loading variables from a file.
 
Report This Post
Expert
posted Hide Post
wondering if you can pass this date field and the other fields to all your other fexes via drill downs? or are all your other fexes independently launched?
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
As I understand your reply, I need to retrieve only 1 date from a parameters table and have that date available to all my focexecs. I'm using this date to pull data in all my reports but I didn't want to duplicate code across my twenty some focexecs in my Self Serv App. The focexecs aren't all connnected to pass via a drilldown.

There may have been a better way but I thought 1 program to my parms table, -INCLUDE in my focexecs and a common variable would be easier to maintain, connect and reuse.........

If you have other ideas I'm always look for new things to try I'd love to hear them ......
 
Posts: 132 | Location: Kansas | Registered: November 12, 2003Report This Post
Expert
posted Hide Post
take Kyles idea..make a hold file format alpha with the key date, say 20040109
Call the file MYDATEFF
then in your fexes, use this :
IF DATE EQ (MYDATEFF)
and this will cause the DATE field in each fex to compare itself to the contents of that MYDATEFF file, which can, btw, contain a whole bunch of dates.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Creating a variable from a table to be used as a Global

Copyright © 1996-2020 Information Builders