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]Passing Values from one Procedure to Another

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Passing Values from one Procedure to Another
 Login/Join
 
<Meghan>
posted
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>,
 
Report This Post
Guru
posted Hide Post
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


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
<Meghan>
posted
I don't want to concatenate the results of the two tables. Here's a visual example of what I'm looking for.

Table 1 produces:
Value
92

Table 2 procduces:
Value
94

I want Table 3 to display:
Value Value
92 94

I want them side by side in the same row not two data pieces in one column.
 
Report This Post
Expert
posted Hide Post
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


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<Meghan>
posted
Ginny,

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

Basically it's quiting at the 'Define'
 
Report This Post
Virtuoso
posted Hide Post
Hold rather than Save in the first two procedures; use Match File to merge the two results, and report off the Hold file it produces.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
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


Robert Freeman

FOCUS for VM 7.6.x
 
Posts: 4 | Registered: November 12, 2003Report This Post
Virtuoso
posted Hide Post
Meghan,
When you say:
quote:

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, 2006Report This Post
Guru
posted Hide Post
Following j.gross suggestion of using MATCH FILE.

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


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
<Meghan>
posted
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.
 
Report This Post
<Meghan>
posted
Ginny -

Can you READ a variable with the format D18.2? I think using your suggestion it's actually getting hung up on the READ command.

(FOC299) UNRECOGNIZED FORMAT OF AMPER VARIABLE IN -READ
 
Report This Post
<Meghan>
posted
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.
 
Report 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]Passing Values from one Procedure to Another

Copyright © 1996-2020 Information Builders