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     [Solved] Maintain -- A mini-Maintain inside a Focexec: write to an amper variable?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Maintain -- A mini-Maintain inside a Focexec: write to an amper variable?
 Login/Join
 
Virtuoso
posted
Hey folks!

One of my top people brought me a question that I can't quite find an answer to. She has very complicated calculations that she needs to make prior to running a report, and I recommended using a small chunk of Maintain inside her Focexec to do the dirty work. We can calculate the values in Maintain with ease, but how do we get them into the TABLE FILE calls that follow?

Before telling her to write to a temporary table I thought I'd ask if anyone has a way to take variables in Maintain and turn them into amper variables for use farther down the routine. Needless to say, both of us are all ears.

J.

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



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Platinum Member
posted Hide Post
John,

Just a quick thought...

You could pass the calculation results as variables to an EXEC'd focexec which could then -WRITE them to a file, which could then be retrieved as &Vars with a -READ


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Report This Post
Master
posted Hide Post
John
You will have to set up some kind of table, whether flat (using -READ / -WRITE) or focus / relational (using INCLUDE / PRINT). If flat, you can place the Filedef in the EDASPROF.

The problem is, when you EXEC a procedure, you are starting a different agent so you can't set & or && variables and expect them to be available when you return. Also, while you can EXEC a TABLE from the Maintain procedure, the output is not displayed.

Mark
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Virtuoso
posted Hide Post
I have all of this in a single Focexec folks -- One after the other. All that is missing is digging the value out of the Maintain variable and getting it to the FOCUS that follows. I was hoping not to write to a table and then read (or join), but that appears to be the option available.

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
John

Do you mean something like:
APP FI MYVAL DISK BASEAPP/MYVAL.TXT
-RUN
MAINTAIN FILE CAR
FOR ALL NEXT CAR.COUNTRY INTO CARSTACK;
TYPE "<CARSTACK.FOCCOUNT  <CARSTACK(1).COUNTRY";
TYPE ON MYVAL "<<CARSTACK(1).COUNTRY";
END
-RUN
-READ MYVAL &CNTRY.A10
-TYPE &CNTRY


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
That's about it -- seems to be the easiest way though I hadn't thought it as tight as you have it there.

I wasn't going to App Fi into an application. Will multiple users overwrite each other if I do it the way you show?

J.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Virtuoso
posted Hide Post
An neater alternative (IMHO) is to have the Maintain emit a temp fex containing -SET statements, and then invoke it with -INCUDE -- for example:
FILEDEF FEXFILE DISK ./FEXFILE.FEX

MAINTAIN FILE CAR
-* the calculations:
 COUNTRY="USA";
 CAR="HUMMER";
-* populate the fex:
 TYPE ON FEXFILE "-SET &|COUNTRY='" <COUNTRY "';";
 TYPE ON FEXFILE "-SET &|CAR    ='" <CAR"';";
END
-RUN

-INCLUDE ./FEXFILE.FEX

-? &C


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Virtuoso
posted Hide Post
Whichever way you go, just APP FI MYFILE DISK INAGENT.TMP to use the agent folders.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report 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     [Solved] Maintain -- A mini-Maintain inside a Focexec: write to an amper variable?

Copyright © 1996-2020 Information Builders