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.
If the fieldsyou are joining to are not indexed then you can't do the join anyway with FOCUS files. You can with some non-FOCUS files like SQL Server or Oracle. Syntax is JOIN field1 and field2 IN FILE1 to field1 and field2 IN FILE2 AS joinname END If you have FOCUS files (ie .FOC) and the fields are not indexed then you will need to use MATCH not JOIN.
Posts: 140 | Location: Adelaide South Australia | Registered: October 27, 2006
Per you comments, I tried concatenating multiple fields for a single field join. However, I get an error: (FOC279) NUMERIC ARGUMENTS IN PLACE WHERE ALPHA ARE CALLED FOR.
I assume it is because I'm concatenating alpha and numeric fields. WEEK_ID/I11, DEPT_ID/I6 and DIVISION_ID/I6 are integers and BUYER_VENDOR/A6 is an alpha.
DEFINE FILE F_INVE_VLR52W NEWKEY=WEEK_ID||DEPT_ID||DIVISION_ID||BUYER_VENDOR; END
Short of concatenating multiple fields for a single field join, is it at all possible to join multiple unique fields from 2 holds that are indexed?
I have 2 holds that have 4 fields that are indexed, WEEK_ID, DEPT_ID, DIVISION_ID and BUYER_VENDOR. When I join all 4 fields, Focus creates 4 separate joins, creating 4 separate sets of query tables unique to each field join.
The following is syntax for the holds: . . . . ON TABLE HOLD AS HOLD_INV_AVG FORMAT FOCUS INDEX WEEK_ID DEPT_ID DIVISION_ID BUYER_VENDOR . . . . ON TABLE HOLD AS HOLD_52W_VND FORMAT FOCUS INDEX WEEK_ID DEPT_ID DIVISION_ID BUYER_VENDOR . . . .
The following join works in SQL (Access): FROM HOLD_INV_AVG LEFT JOIN HOLD_52wk_VND ON (HOLD_INV_AVG.buyer_vendor = HOLD_52wk_VND.buyer_vendor) AND (HOLD_INV_AVG.week_id = HOLD_52wk_VND.week_id) AND (HOLD_INV_AVG.department_id = HOLD_52wk_VND.department_id) AND (HOLD_INV_AVG.division_id = HOLD_52wk_VND.wlsr_division_id)
WebFOCUS 7.6.11, Windows XP, Excel, HTML, PDF
Posts: 25 | Location: Salt Lake City | Registered: June 03, 2008
Please check page 590 of manual 760snf.pdf, section called "Multi-field Joins to Fixed Format Files". You can't use FOCUS files but you can use hold files. Just make sure that both files are sorted in the same order.
You can download this manual (Summary of New Features, 7.6) from the doc link at the top right of this page.
Another possibility which I use now and then, is to join on one field (the indexed field in the to-file) and do the rest of the join by means of where statements. This will always give me the same results as if I were joining on more fields. So: join field1 in a to field1 in b And: where a.field2 eq b.field2 and a.field3 eq b.field3 This will do the trick, but you will have to have at least one field indexed in the to-file to be able to join at all (as already indicated earlier).
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Per your suggestion, I tested my fex by joining on one indexed field with rest of the join by means of a where statement. However, I'm not getting the same resolute as I get from SQL.
Example Code......... ON TABLE HOLD AS HOLD_INV_AVG FORMAT FOCUS INDEX WEEK_ID .......... ON TABLE HOLD AS HOLD_52wk_VND FORMAT FOCUS INDEX WEEK_ID .......... JOIN LEFT_OUTER HOLD_INV_AVG.SEG01.WEEK_ID IN HOLD_INV_AVG TO UNIQUE HOLD_52WK_VND.SEG01.WEEK_ID IN HOLD_52wk_VND AS J1 END TABLEF FILE HOLD_INV_AVG PRINT COST SALES BY WEEK_ID BY DEPT_ID BY DIV_ID BY VENDOR_ID WHERE (( HOLD_INV_AVG.DEPT_ID EQ HOLD_52wk_VND.DEPT_ID ) AND ( HOLD_INV_AVG.DIVISION_ID EQ HOLD_52wk_VND.DIVISION_ID ) AND ( HOLD_INV_AVG.BUYER_VENDOR EQ HOLD_52wk_VND.BUYER_VENDOR )); ..........
With the where above, it come out as: WEEK_ID DEPT_ID DIV_ID VENDOR_ID COST SALES 200732 1 1 123320 258,622.76 285,451.53 200832 1 1 123320 263,554.93 291,653.50
Without the where, It come out as: WEEK_ID DEPT_ID DIV_ID VENDOR_ID COST SALES 200732 1 1 123320 258,622.76 285,451.53 200732 8 1 123320 258,622.76 285,451.53 200832 1 1 123320 263,554.93 291,653.50 200832 8 1 123320 263,554.93 291,653.50 200832 9 1 123320 263,554.93 291,653.50
From SQL, with the same where as above: WEEK_ID DEPT_ID DIV_ID VENDOR_ID COST SALES 200732 1 1 123320 258,622.76 285,451.53 200732 8 1 123320 1,043.85 1,185.69 200832 1 1 123320 263,554.93 291,653.50 200832 8 1 123320 790.4 887.85 200832 9 1 123320 0 0
Ginny & Frank, thank you for you comments. They were very helpful as well.
WebFOCUS 7.6.11, Windows XP, Excel, HTML, PDF
Posts: 25 | Location: Salt Lake City | Registered: June 03, 2008
Example Code......... ON TABLE HOLD AS HOLD_INV_AVG FORMAT FOCUS INDEX WEEK_ID .......... ON TABLE HOLD AS HOLD_52wk_VND FORMAT FOCUS INDEX WEEK_ID .......... JOIN LEFT_OUTER HOLD_INV_AVG.SEG01.WEEK_ID IN HOLD_INV_AVG TO UNIQUE HOLD_52WK_VND.SEG01.WEEK_ID IN HOLD_52wk_VND AS J1 END
You didn't show the table requests that create the Holds. If they use single verbs (resulting in a single-segment Focus structure) then the join is not "UNIQUE". That would explain the data discrepancy - you are not retrieving all instances.
Either use "conditional join" syntax (placing conditions that ensure uniqueness in the Join rather than in the Table), or change UNIQUE to MULTIPLE, or (better yet) use multiple verbs in the second Hold request, so that the join on WEEK_ID is unique. TABLE ... SUM ... BY WEEK_ID SUM ... BY WEEK_ID BY other keys ON TABLE HOLD ... FORMAT FOCUS INDEX WEEK_ID END
Note that the "from" file need not be indexed, in fact it need not be a Focus file.This message has been edited. Last edited by: j.gross,
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005