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 am joining 2 tables with about a million records in each table. I want only those records where there is not a matched value in the second joined table. Where 'is missing' did not work. With the example below, I want the EMPDATE.PIN files that do not have a match in TRAINING.
I can join the fields and create a hold file and on that hold file create the criteria which works but I do not want to retrieve all million records in a hold file to find the 500 or so that are not in the second table.
Does anyone have a suggestion on how to do this? Most likely that will not be the case with the example below but it shows the idea.
SET ASNAMES = ON JOIN EMPDATA.EMPDATA.PIN IN EMPDATA TO MULTIPLE TRAINING.TRAINING.PIN IN TRAINING AS J2 END TABLE FILE EMPDATA PRINT PIN AS 'EMPDATAPIN' PIN AS 'TRAININGPIN' COURSECODE EXPENSES ON TABLE HOLD AS TEMP01 END
TABLE FILE TEMP01 PRINT EMPDATAPIN COURSECODE EXPENSES WHERE TRAININGPIN IS MISSING; ON TABLE HOLD AS TEMP02 ENDThis message has been edited. Last edited by: Geri,
MATCH FILE, which merges complete results extracted from two datasources, is inadvisable, if either of the two extracts will be voluminous. (That depends on the selection criteria imposed in your real-world situation.)
You are essentially looking for an "if not exists" type of test. CONTAINS and OMITS test for existence of a suitable "child" instance (an instance in the Many side of a One-to-Many join). OMITS is the proper tool:
JOIN PIN IN EMPDATA TO MULTIPLE PIN IN TRAINING END
DEFINE FILE EMPDATA MATCHED/A1= IF TRAINING.TRAINING.PIN EQ EMPDATA.EMPDATA.PIN THEN 'Y' ELSE 'N'; END
TABLE FILE EMPDATA "EMPLOYEES WITH NO TRAINING RECORDS" "" PRINT EMPDATA.EMPDATA.LASTNAME NOPRINT BY TOTAL EMPDATA.EMPDATA.LASTNAME BY PIN IF MATCHED OMITS 'Y' ON TABLE SET ALL ON END
Here, OMITS is applied to a *defined* alpha field associated with the Training side of the join; and SET ALL=ON ensures that a row will be retrieved (with default values for the child columns), and MATCHED will be evaluated as 'N', when there is no matching child instance.
Note that the test assumes that blanks (or zero) is not a valid key value.This message has been edited. Last edited by: j.gross,
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
SET ASNAMES = ON JOIN EMPDATA.EMPDATA.PIN IN EMPDATA TO MULTIPLE TRAINING.TRAINING.PIN IN TRAINING AS J2 END TABLE FILE EMPDATA PRINT PIN AS 'EMPDATAPIN' <--- 1 PIN AS 'TRAININGPIN' <--- 1 COURSECODE EXPENSES ON TABLE HOLD AS TEMP01 END
TABLE FILE TEMP01 PRINT EMPDATAPIN COURSECODE EXPENSES WHERE TRAININGPIN IS MISSING; <--- 2 ON TABLE HOLD AS TEMP02 END
Two comments to your code: 1. You need to qualify the fieldnames. As it stands, *both* columns will report the value in EMPDATA.EMPDATA.PIN. 2. If your key field is not nullable, IS MISSING will never be true (regardless of SET ALL).
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005