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 have values that I need to pass from one procedure to another and it's not working correctly. Below is my code.
Baseline Value Procedure TABLE FILE TESTCOREMEASURES PRINT Value WHERE ComparitorDateID1 EQ 'FY2009'; WHERE Location_Parent_ID_caption EQ 'SystemWide'; WHERE Measure_Name1 EQ 'Composite Quality Index - Heart Attack (AMI)'; WHERE Comparitor_Type_Name1 EQ 'Operational Planning Grid - Baseline'; ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SAVE AS BASELINE END
Target Value Procedure TABLE FILE TESTCOREMEASURES PRINT Value WHERE ComparitorDateID1 EQ 'FY2009'; WHERE Location_Parent_ID_caption EQ 'SystemWide'; WHERE Measure_Name1 EQ 'Composite Quality Index - Heart Attack (AMI)'; WHERE Comparitor_Type_Name1 EQ 'Operational Planning Grid - Target'; ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SAVE AS TARGET END
I want the 'Value' data from BOTH procedures to display in a third procedure. I cannot get the last procedure to work. Will someone please post code that will work. I've tried -INCLUDE, -READ, and combinations of all sorts of things. HELP!This message has been edited. Last edited by: <Meghan>,
You can use a MORE statement to concatenate the two table requests. Look it up in the Developer Studio help. A MORE statement requires that the two tables be identical. Each table has to have the same number of columns and the datatypes of the columns should match. Very similar to a UNION statement in SQL.
-* 1st table request we need data from
TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE HOLD AS TABLE1
END
-* 2nd table request we need data from
TABLE FILE CAR
PRINT
COUNTRY
CAR
MODEL
WHERE COUNTRY EQ 'FRANCE';
ON TABLE HOLD AS TABLE2
END
-* Using MORE statement to concatenate the two tables
TABLE FILE TABLE1
PRINT
COUNTRY
CAR
MODEL
ON TABLE HOLD AS FINAL_TABLE
MORE
FILE TABLE2
END
-* Print the results of our final table
TABLE FILE FINAL_TABLE
PRINT
COUNTRY
CAR
MODEL
END
If you have 3 separate focexecs that run independently, you are going to have to physically save your SAVE files in a permanent location so that can be picked up and -READ in a 3rd program. You would have to filedef baseline.ftm and target.ftm then -READ the contents into amper variables, then use them in a report.
Here is a model for program 3:
APP FI BASELINE DISK your_save_directory/baseline.ftm
APP FI TARGET DISK your_save_directory/target.ftm
-RUN
-READ BASELINE &BASELINE
-READ TARGET &TARGET
DEFINE FILE filename
BASELINE/I2=&BASELINE;
TARGET/I2=&TARGET;
END
TABLE FILE filename
PRINT BASELINE TARGET
BY whatever
END
I get the following error using your code: 0 ERROR AT OR NEAR LINE 4 IN PROCEDURE ADHOCRQ FOCEXEC * (FOC374) DIALOGUE MGR VARIABLE IS NOT SPECIFIED BEFORE USE IN -READ: -READ BASELINE &Value
It appears that the data is coming from the same file with the same selections - except that one value is the baseline and the other is the target. You can do this in one pass of the data, in one TABLE request, with no HOLD or SAVE files, MATCH, or -READ. A simple DEFINE will do the trick. Change the WHERE test to include both the Baseline and Target records. Define one value from the database when it matches the selection criteria, or zero if it does not (or blank if the field is alphanumeric). Use SUM MAX. to display the largest value and put both records on the same line.
DEFINE FILE TESTCOREMEASURES
BASELINE/I5=IF Comparitor_Type_Name1 EQ 'Operational Planning Grid - Baseline'
THEN Value ELSE 0;
TARGET/I5=IF Comparitor_Type_Name1 EQ 'Operational Planning Grid - Target'
THEN Value ELSE 0;
END
TABLE FILE TESTCOREMEASURES
SUM MAX.BASELINE MAX.TARGET
WHERE ComparitorDateID1 EQ 'FY2009';
WHERE Location_Parent_ID_caption EQ 'SystemWide';
WHERE Measure_Name1 EQ 'Composite Quality Index - Heart Attack (AMI)';
WHERE Comparitor_Type_Name1 EQ 'Operational Planning Grid - Baseline'
OR 'Operational Planning Grid - Target';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SAVE AS BASELINE
END
I want the 'Value' data from BOTH procedures to display in a third procedure
do you mean that each procedure retrieves only 1 value? where do you want the values to be displayed? in a heading? as a list? According to your answers, there will be different solutions.
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006
SET ASNAMES = ON
-* 1st table request we need data from
TABLE FILE CAR
PRINT
COUNTRY AS 'COUNTRY_A'
CAR AS 'CAR_A'
MODEL AS 'MODEL_A'
COMPUTE LINK/A4 = 'LINK';
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE HOLD AS TABLE1
END
-* 2ND TABLE REQUEST WE NEED DATA FROM
TABLE FILE CAR
PRINT
COUNTRY AS 'COUNTRY_B'
CAR AS 'CAR_B'
MODEL AS 'MODEL_B'
COMPUTE LINK/A4 = 'LINK';
WHERE COUNTRY EQ 'FRANCE';
ON TABLE HOLD AS TABLE2
END
MATCH FILE TABLE1
PRINT
COUNTRY_A
CAR_A
MODEL_A
BY LINK
RUN
FILE TABLE2
PRINT
COUNTRY_B
CAR_B
MODEL_B
BY LINK
AFTER MATCH HOLD AS HOLD1 OLD-OR-NEW
END
TABLE FILE HOLD1
PRINT
COUNTRY_A
CAR_A
MODEL_A
COUNTRY_B
CAR_B
MODEL_B
END
-EXIT
I've tried the DEFINE suggested by Robert and the MATCH FILE suggested by j.gross and Mighty Max - both to no avail.
To answer Daniel's questions: Yes, each procedure only retrieves 1 value - a baseline and a target value coming from the same cube.
I want the values to be displayed in the body of a report. What I'm looking for in my final report is this - the name of my measure, the baseline (from procedure 1), the score for my measure, and the target (from procedure 2). I want the two values to be displayed in 1 line.
OK...one last message from me. I figured it out. Here's my final code:
BASELINE TABLE TABLE FILE TESTCOREMEASURES PRINT Value AS 'Baseline' WHERE ComparitorDateID1 EQ 'FY2009'; WHERE Location_Parent_ID_caption EQ 'SystemWide'; WHERE Measure_Name1 EQ 'Composite Quality Index - Heart Attack (AMI)'; WHERE Comparitor_Type_Name1 EQ 'Operational Planning Grid - Baseline'; ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SAVE AS 'BASELINE' END
TARGET TABLE TABLE FILE TESTCOREMEASURES PRINT Value AS 'Target' WHERE ComparitorDateID1 EQ 'FY2009'; WHERE Location_Parent_ID_caption EQ 'SystemWide'; WHERE Measure_Name1 EQ 'Composite Quality Index - Heart Attack (AMI)'; WHERE Comparitor_Type_Name1 EQ 'Operational Planning Grid - Target'; ON TABLE SET PAGE-NUM OFF ON TABLE NOTOTAL ON TABLE SAVE AS 'TARGET' END
FINAL PROCEDURE -INCLUDE app/testing_baseline.fex -INCLUDE app/testing_target.fex -RUN -READ BASELINE &Baseline.A18 -READ TARGET &Target.A18 DEFINE FILE TESTCOREMEASURES Baseline/D18.2=&Baseline; Target/D18.2=&Target; END TABLE FILE TESTCOREMEASURES PRINT Baseline Percent_of_Qualifying_Accounts/D12.2% Target BY Measure_Set WHERE Measure_Set EQ 'Composite Quality Index - Heart Attack (AMI)'; ON TABLE NOTOTAL END
Where it was getting hung up was on the -READ. I did some searching and you cannot use D18.2 as a format in the READ even if the variable you are trying to READ is a D18.2. I had to trick it by putting it as a A18 and then using the DEFINE to set it right again. Works like a charm. No APP FI necessary.
THANK YOU ALL for your help - couldn't have done it without you.