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] MATCH - one -to - many not working

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] MATCH - one -to - many not working
 Login/Join
 
Silver Member
posted
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, 2006Report This Post
Expert
posted Hide Post
You'll need to do a join, not a match to do 1:many. MATCH performs SET arithmetic on data. One row is matched against one row, not many.


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
Silver Member
posted Hide Post
Thanks Ginny for quick reply.

But I'm looking for FULL OUTER JOIN Functionality. betwee HOLD1 & CAR files.

Result:
1.) Want to see matching Records. HOLD1 - CAR (1 - N)
2.) If not matching record - show blanks in host file or Cross Reference file.
 
Posts: 36 | Location: Boston MA | Registered: October 12, 2006Report This Post
Expert
posted Hide Post
quote:
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
MATCH
.
.
AFTER MATCH HOLD AS CARHOLD OLD-OR-NEW -- This will result in FULL OUTER JOIN in SQL World.

But I'm unable to attain this FULL outer join with 2 DATA sources in MATCH file.

I would really appreciateif Someone provide example on CAR file..?

--------------
Dev: WF 7.1.7 with 7.1.7 WFRS; AIX 5.3;
MRE
 
Posts: 36 | Location: Boston MA | Registered: October 12, 2006Report This Post
Silver Member
posted Hide Post
Thanks guys.. I got this issue resolved.
 
Posts: 36 | Location: Boston MA | Registered: October 12, 2006Report This Post
Expert
posted Hide Post
Merging two files that have the same columns:

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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Is this what you are after ?

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


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Expert
posted Hide Post
quote:
Thanks guys.. I got this issue resolved.


And how???


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
My code exactly looks same as Waz post.
Thanks Waz
 
Posts: 36 | Location: Boston MA | Registered: October 12, 2006Report 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] MATCH - one -to - many not working

Copyright © 1996-2020 Information Builders