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.
Hi guys, I'm trying to implement One-to-many relationship in FOCUS using MATCH statment.
DEFINE FILE CAR
COUNTRYN/A10 = COUNTRY
END
TABLE FILE CAR
PRINT MODEL CAR
WHERE COUNTRY EQ 'ENGLAND' AND CAR EQ 'JENSEN'
BY COUNTRYN
ON TABLE HOLD AS HOLD1
END
-RUN
MATCH FILE HOLD1
PRINT MODEL CAR BY COUNTRYN
RUN
FILE CAR
PRINT COUNTRY COUNTRY CAR MODEL BODYTYPE BY COUNTRY
AFTER MATCH HOLD AS CARHOLD OLD-OR-NEW
END
-RUN
TABLE FILE CARHOLD
PRINT *
END
Result of above Code is not 1-to-N. Can somebody suggest me what exactly is the mistake..?This message has been edited. Last edited by: Kerry,
Posts: 36 | Location: Boston MA | Registered: October 12, 2006
Using Sort Fields in MATCH Requests If the data sources in the MATCH share common high-order sort fields with identical names and formats, the MATCH process merges records with matching sort field values from each of the files. If the two data sources in the MATCH have the same sort field with different names, you can change one of the names with an AS phrase .
If the files in the MATCH do not share a high-order sort field, the fields are not compared. Instead, the fields from the first record in each data source are merged to create the first record in the HOLD file, and so on for all remaining records.
COUNTRYN AS COUNTRY
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
SET HOLDLIST=PRINTONLY
SET HOLDFORMAT=ALPHA
TABLE FILE CAR
PRINT MODEL CAR BODYTYPE
WHERE COUNTRY EQ 'ENGLAND' OR COUNTRY EQ 'JAPAN'
BY COUNTRY
ON TABLE HOLD AS HOLD1
END
-RUN
TABLE FILE CAR
PRINT MODEL CAR BODYTYPE
WHERE COUNTRY EQ 'ENGLAND' OR COUNTRY EQ 'ITALY'
BY COUNTRY
ON TABLE HOLD AS HOLD2
END
-RUN
TABLE FILE HOLD1
PRINT *
MORE
FILE HOLD2
END
I don't understand what you want to do. Do you want to merge data from two tales that have the same columns or different columns except for a common key column?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
DEFINE FILE CAR
COUNTRYN/A10 = COUNTRY
END
TABLE FILE CAR
PRINT MODEL
CAR
WHERE COUNTRY EQ 'ENGLAND' AND CAR EQ 'JENSEN'
BY COUNTRYN
ON TABLE HOLD AS HOLD1
END
-RUN
MATCH FILE HOLD1
SUM MODEL
CAR
BY COUNTRYN AS COUNTRY
RUN
FILE CAR
PRINT
BODYTYPE
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
AFTER MATCH HOLD AS CARHOLD OLD-OR-NEW
END
-RUN
TABLE FILE CARHOLD
PRINT *
END
If you want a FULL OUTER JOIN, you should be using and OUTER JOIN, NOT a MATCH.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007