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've got two datasets that I want to do some MATCH logic against. Both datasets can contain the same data (i.e., perhaps an Employee ID. I want to end up having only one dataset, containing data from dataset 1 and if there is a match in dataset 2, excluding the matching record found in dataset 2.
My question: to get all records from dataset 1 and to exclude matching records from dataset 2, however, to also include all non-matching records from dataset 2. Would I use OLD-NOT-NEW or would I use OLD-NOR-NEW?
In my program, I am not seeing records from dataset1, and am curious as to what I might be doing wrong.
Here's my piece of code for trying to work this MATCH logic:
MATCH FILE S079Y&INSTX
PRINT
TX_GRANT
TXGRANT1 TXGRANT2 TXGRANT3 TXGRANT4
-* AWD_PERIOD
AWARDYR
BY STU_ID
BY HIGHEST TX_GRANT NOPRINT
BY AWD_PERIOD NOPRINT
RUN
FILE S079X&INSTX
PRINT
TX_GRANT
TXGRANT1 TXGRANT2 TXGRANT3 TXGRANT4
-* AWD_PERIOD
AWARDYR
BY STU_ID
BY HIGHEST TX_GRANT NOPRINT
BY AWD_PERIOD NOPRINT
AFTER MATCH HOLD OLD-NOT-NEW
END
-RUN
-*
Thank you in advance to all who answer...looking forward to hearing from you!
Wow! You folks are fast!!Thank you all so very much for your offers of help and advice! I'll incorporate as much as possible from your comments and see what comes out the other side.
Webmeister, If I read you correctly, you have 2 files with exactly the same fields and you want to take only the unmatching records: from the first file records which do not have a match with the second file and vice-versa. This is the OLD-NOR-NEW option. What you are going to be left with is a HOLD file with the BY fields and 2 sets of PRINT or SUM fields with the same names. Also when there is data in the first set, the second set wil be blank or zero and vice-versa. So I would do the following:
MATCH FILE S079Y&INSTX
PRINT
TXGRANT1 TXGRANT2 TXGRANT3 TXGRANT4
AWARDYR
BY STU_ID
BY TX_GRANT
BY AWD_PERIOD
RUN
FILE S079X&INSTX
PRINT
TXGRANT1 TXGRANT2 TXGRANT3 TXGRANT4
AWARDYR
BY STU_ID
BY TX_GRANT
BY AWD_PERIOD
AFTER MATCH HOLD AS ABC OLD-NOR-NEW
END
webmeister In a MATCH paragraph, the second verb always has to be SUM, even tho it may make no particular sense to the developer at the moment. In your example, you second verb is PRINT (as is your first, which is fine).
It just gets confusing to me, when I see HOLD AS GOT_EM followed by FILE HOLD2. In other words, my confusion stems from holding a file with one name, but then following that with a totally different file name.
I appreciate you replying so quickly also....many thanks.
My question: to get all records from dataset 1 and to exclude matching records from dataset 2, however, to also include all non-matching records from dataset 2. Would I use OLD-NOT-NEW or would I use OLD-NOR-NEW?
I may be the only one reading this different. I take this to mean you want all of the records in your "OLD" dataset and the ones from the "NEW" dataset that do not match. I agree with Tom that you need to run through the data twice, but I do not agree how to go about it. Tom's output would be the same as OLD-NOR-NEW. The set that doesn't match. STEP 1 What you want in your first iteration is NEW-NOT-OLD which will give you the set from the NEW file that is not on the OLD file. STEP 2 Then you either want to concatenate the HOLD file from step 1 to your original "OLD" file(MORE) or MATCH your original "OLD" file to the HOLD file from step 1 as the "NEW" file and hold OLD-AND-NEW.
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007
Webmeister, This is what you said at the beginning:
quote:
I want to end up having only one dataset, containing data from dataset 1 and if there is a match in dataset 2, excluding the matching record found in dataset 2.
My question: to get all records from dataset 1 and to exclude matching records from dataset 2, however, to also include all non-matching records from dataset 2.
So tell us what you want: Records from 1 that don't match with 2. Records from 2 that don't match with 1. Do both files have the same fields?
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
I'll try your comments and see what I get as a result....thanks!
Daniel,
What I want is to have ALL the records from Dataset 1, plus only those records from Dataset 2 that do not match the records in Dataset 1. And yes, both files have the same fields. Thank you for replying also!
Webmeister, Ok. I suggest you combine what I wrote above with Tom's MORE.
TABLE FILE ABC
PRINT
TXGRANT1 TXGRANT2 TXGRANT3 TXGRANT4
AWARDYR
BY STU_ID
BY TX_GRANT
BY AWD_PERIOD
WHERE AWARDYR NE 0
ON TABLE HOLD AS WEBMEISTER
MORE
FILE S079Y&INSTX
END
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
Shalom and manishma! What I ended up doing, after all of this MATCH logic, was to discard all of the MATCH logic and instead to use HIGHEST and MAX logic. That got my data into the sequence I was looking for and then I was able to use FST code.
I'm going to be out of the office for a couple of days, but if your'e interested, I can send you the piece of code that I ended up using to make my program work.
How is Tel Aviv? I had a job in the Sinai years ago and during my first few months, stayed at the Hotel Dan in your city.... I enjoyed Tel Aviv tremendously.