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.
I am confusing myself but I think I should be able to do this.
I want to evaluate a table and see what the LATEST month is in the table.
I want to set a variable equal that value.
I want to test the variable to controll which fex to run.
Example, if the latest period in the financials table is 201809 then I want to run fex1 otherwise fex2.
I have done similar things by prompting the user for, say a report type, and then evaluating what they chose but can I set a variable to the max period in my financials table?
I hope this makes sense.
Perhaps someone can share code using CAR to show me how?This message has been edited. Last edited by: FP Mod Chuck,
Run the first request to find the date you want and HOLD then -READFILE the field from the HOLD file.
Here's an example I found by another user using search:
TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
BODYTYPE
SEATS
DEALER_COST
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS HLD_VARS
END
? HOLD HLD_VARS
-RUN
-READFILE HLD_VARS
-TYPE --------------------------------
-TYPE COUNTRY --------- &COUNTRY
-TYPE CAR ------------- &CAR
-TYPE MODEL ----------- &MODEL
-TYPE BODYTYPE -------- &BODYTYPE
-TYPE SEATS ----------- &SEATS
-TYPE DEALER_COST ----- &DEALER_COST
This message has been edited. Last edited by: BabakNYC,
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
Here is another similar solution that I use to accomplish this:
TABLE FILE CAR
SUM
DEALER_COST
WHERE COUNTRY EQ 'America';
ON TABLE HOLD AS 'HOLD' FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-READ HOLD &DEALER_COST.A8.
-TYPE &DEALER_COST
BabakNYC's code looks a lot more efficient for multiple variables. I'm gonna use that moving forward!
well this works EXCEPT it prompts for a value for &PD...I can not have this prompting though...thoughts..
SET ASNAMES = ON TABLE FILE TBLMSTR_YTDEMPLOYEEFTES BY LOWEST TBLMSTR_YTDEMPLOYEEFTES.TBLMSTR_YTDEMPLOYEEFTES.ASOFPERIOD AS PD ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE HOLD AS HOLDPD FORMAT ALPHA END -RUN -READFILE HOLDPD -TYPE LATESTFTEPD IS : &PD
I believe I should be able to evaluate LATESTPD...but I can not have the user prompted...
it is reading my table and printing that latest Period when the type statement is executed. It works. It is also prompting for &PD...which is irrelevent since whatever I enter at the prompt is replaced with the data from the hold file created. How do I get rid of the prompt? It makes no sense to prompt the user.....
SET ASNAMES = ON
-DEFAULTH &PD = ''
TABLE FILE TBLMSTR_YTDEMPLOYEEFTES
BY LOWEST TBLMSTR_YTDEMPLOYEEFTES.TBLMSTR_YTDEMPLOYEEFTES.ASOFPERIOD AS 'PD'
ON TABLE HOLD AS HOLDPD
END
-RUN
-READFILE HOLDPD
-TYPE LATESTFTEPD IS : &PD
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013
What happens with parameter prompting is the Fex is scanned to all &vars, and if there is no -DEFAULT(S|H) or -SET (before the first use) then the prompt will happen.
This can be turned off in the Administration Console.
As an extra note, two suggestions were given to you to stop the prompt.
-DEFAULTH, this provides a default value of the variable. -SET, this sets the variable to a value.
An extra option is to use the -SET with no value.
e.g. -SET &PD =;
This clears the variable, and also stops the prompt.