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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Match file m:m
 Login/Join
 
<Mirza>
posted
Hello,

Sorry if this type of question was asked before. I'm tring to extract specific values by using a MATCH FILE command.

Say for example the two tables are ALPHA and BETA The information I want to extract is where the asterisks are.

This is a m:m relationship.

Data Table ALPHA
DATE....A...B....EXTRA
01........1...1.......-
01........2...1.......-
01........2...2.......- (----- ** (capture this file)
01........3...2.......-
02........1...1.......-
02........1...2.......-
02........2...1.......-


Data Table BETA
DATE....A...B...EXTRA
01........1...1.......-
01........2...1.......-
01........3...2.......-
02........1...1.......-
02........1...2.......-
02........1...3.......- (----- ** (capture this file)
02........2...1.......-

(the field extra contains extra data that I am trying to capture)

This is the code I am using:

MATCH FILE ALPHA
PRINT EXTRA
BY DATE
BY A
BY B
RUN

FILE BETA
PRINT EXTRA
BY DATE
BY A
BY B
AFTER MATCH HOLD OLD-NOR-NEW
RUN

TABLE FILE HOLD
PRINT *
END

My code doesn't work. My end result is that I'm getting all records from both tables.
Does anyone know how I can resolve this, or another technique that I can use?

Thank you in advance!
 
Report This Post
Virtuoso
posted Hide Post
Assuming there is only one value of extra per DATE, A, and B combination, try changing the PRINT command to a SUM command.
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
<Mirza>
posted
Just to confirm there will only be one value in field extra, per Date/field A/field B.

Unfortunately I still get the same results Frowner
 
Report This Post
Gold member
posted Hide Post
Mirza, this is the code that I used, and my answer. Hope it helps.
MATCH FILE ADATA
WRITE EXTRA BY DATE BY AFLD BY BFLD
RUN
FILE BDATA
WRITE EXTRA BY DATE BY AFLD BY BFLD
AFTER MATCH HOLD OLD-NOR-NEW
END
DATE AFLD BFLD EXTRA EXTRA
---- ---- ---- ----- -----
1 2 2 A
2 1 3 B B
 
Posts: 60 | Location: 2 penn | Registered: May 22, 2003Report This Post
<Mirza>
posted
Hi Noreen,

That didn't work either. I removed the first BY statement (BY DATE) and moved it into the PRINT/WRITE statement. The file produced the type of results I was looking for. Although I tested this for a small sample set .. if I ran this report for a large sample set I may get inaccurate results.

This is what my code looks like.
MATCH FILE ADATA
WRITE EXTRA DATE
BY AFLD BY BFLD
RUN
FILE BDATA
WRITE EXTRA DATE
BY AFLD BY BFLD
AFTER MATCH HOLD OLD-NOR-NEW
END

Would it matter if my DATE fields (from the data sources) don't have the same name? (i.e. DATE_1 and DATE_2)
 
Report This Post
Virtuoso
posted Hide Post
Check that the fields represented by A, B, and DATE have identical names and formats in your two MFDs
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Guru
posted Hide Post
If they have the same format, but just different names, then on your BY statement, rename them both to the same thing.
  BY DATE_1 AS  'DATE' 
in the first query, and
 BY DATE_2 AS 'DATE' 
in the second.
Have the setting ASNAMES ON before you do your MATCH file.
 SET ASNAMES=ON 
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
<Mirza>
posted
Wow, I can't believe that was the problem... Having the same field name DOES work.

Thanks everyone for your help!
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders