Focal Point
[SOLVED] Join Error Message

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/362108534

May 06, 2010, 08:44 AM
Mark1
[SOLVED] Join Error Message
Hi,
I've got a fex that has worked for months and stopped working yesterday. It is because of a join. I get the following error message:

(FOC236) LINKED FILE DOES NOT HAVE A MATCHING KEY FIELD OR SEGMENT: EDFEESII
BYPASSING TO END OF COMMAND

When I try to run this:

TABLE FILE DSRINDCS1
SUM COL01S00A COL02S00A COL03S00A COL04S00A COL05S00A COL06S00A COL07S00A COL08S00A COL09S00A COL10S00A COL11S00A COL12S00A COL13S00A COL14S00A COL15S00A
COL16S00A
BY VLEVEL
BY NEWDATE
BY MONTH
ON TABLE HOLD AS DSRINDCS2 FORMAT FOCUS INDEX VLEVEL NEWDATE
END

TABLE FILE EDFEES
PRINT ECDFEE NUMED EDFEE
BY VLEVEL
BY NEWDATE
ON TABLE HOLD AS EDFEESII FORMAT FOCUS INDEX VLEVEL NEWDATE
END

JOIN
LEFT_OUTER VLEVEL AND NEWDATE IN DSRINDCS2 TO VLEVEL AND NEWDATE IN EDFEESII AS JEDFEES
END

TABLE FILE DSRINDCS2
PRINT COL01S00A COL02S00A COL03S00A COL04S00A COL05S00A COL06S00A COL07S00A COL08S00A COL09S00A COL10S00A COL11S00A COL12S00A COL13S00A COL14S00A COL15S00A
COL16S00A EDFEE MONTH
BY VLEVEL
BY NEWDATE
-*ON TABLE HOLD AS DSRINDCS3
END

This message has been edited. Last edited by: Mark1,


Windows version 768
May 06, 2010, 09:11 AM
Francis Mariani
Mark,

If VLEVEL and NEWDATE are aliases, they are not carried over to the HOLD file. Use the real column name, not the alias.

To verify this, run this command:
?FF DSRINDCS1
The first column is the real name, the second is the alias - they may be the same or different.


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
May 06, 2010, 10:04 AM
Mark1
Everything checks out there:

FILENAME= DSRINDCS1
VLEVEL E01 A100
MONTH E02 MTRYY
NEWDATE E03 YYMD
FILENAME= DSRINDCS2
VLEVEL E01 A100
NEWDATE E02 YYMD
MONTH E03 MTRYY
FILENAME= EDFEES
VLEVEL E01 A100
NEWDATE E02 YYMD
FILENAME= EDFEESII
VLEVEL E01 A100
NEWDATE E02 YYMD


Windows version 768
May 06, 2010, 10:33 AM
Mark1
One more thing that I just noticed... when I do a print * on EDFEESII, a field called FOCLIST that is not in any of my hold files anywhere! Does anybody know why WF puts a field in my hold file like that?

Another thing I just noticed is that when I join on one field it works fine. When I try to join on two fields it errors out.

This message has been edited. Last edited by: Mark1,


Windows version 768
May 06, 2010, 10:39 AM
GinnyJakes
It's because you did a PRINT. It forces uniqueness for each row. You don't have to worry about it.


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
May 06, 2010, 10:48 AM
Mark1
Another thing I just noticed is that when I join on one field it works fine. When I try to join on two fields it errors out.


Windows version 768
May 06, 2010, 11:10 AM
Francis Mariani
Duh! Should have realized that! Oddly enough, only one field can be joined for FOCUS DB! Multiple columns can be joined for flat files or DBMS tables.

One solution is to define a field that is a concatenation of the two indexed fields, if of course, both are alpha or integer.

Another solution is to create flat files with the data sorted in the correct order.


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
May 06, 2010, 11:16 AM
Francis Mariani
Does not work:

?FF CAR

TABLE FILE CAR
SUM 
SALES
COMPUTE CC/A100 = COUNTRY | CAR;
BY COUNTRY
BY CAR
BY BODYTYPE
ON TABLE HOLD AS H001 FORMAT FOCUS INDEX COUNTRY CAR
END

TABLE FILE CAR
SUM 
FUEL_CAP
COMPUTE CC/A100 = COUNTRY | CAR;
BY COUNTRY
BY CAR
ON TABLE HOLD AS H002 FORMAT FOCUS INDEX COUNTRY CAR
END

?FF H001
?FF H002

JOIN LEFT_OUTER COUNTRY AND CAR IN H001 TO COUNTRY AND CAR IN H002 AS J1

TABLE FILE H001
PRINT 
H001.COUNTRY
H001.BODYTYPE
END

Works:
?FF CAR

TABLE FILE CAR
SUM 
SALES
COMPUTE CC/A100 = COUNTRY | CAR;
BY COUNTRY
BY CAR
BY BODYTYPE
ON TABLE HOLD AS H001 FORMAT FOCUS INDEX CC
END

TABLE FILE CAR
SUM 
FUEL_CAP
COMPUTE CC/A100 = COUNTRY | CAR;
BY COUNTRY
BY CAR
ON TABLE HOLD AS H002 FORMAT FOCUS INDEX CC
END

?FF H001
?FF H002

JOIN LEFT_OUTER CC IN H001 TO CC IN H002 AS J1

TABLE FILE H001
PRINT 
SALES
FUEL_CAP
BY COUNTRY
BY CAR
BY BODYTYPE
END



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
May 06, 2010, 11:18 AM
Francis Mariani
Although, this does not explain
quote:
worked for months and stopped working yesterday



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
May 06, 2010, 11:30 AM
Mark1
Seriously, it had been working for months and then started to error out yesterday. At least you have given me a good example from the car file to work with. I'm not understanding why when you join on two fields... CRASH! I'm going to have to rewrite a lot of programs if this continues to be the case. Mad

This message has been edited. Last edited by: Mark1,


Windows version 768
May 06, 2010, 11:36 AM
Francis Mariani
Not a crash, just out of gas.


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
May 06, 2010, 11:42 AM
Francis Mariani
Here's some documentation regarding JOIN:

Creating Reporting Applications With Developer Studio > Joining and Merging Data Sources > Creating Multi-Field Joins

I was slightly wrong about the FOCUS multi-field join - two individual fields can be joined from the host file, the cross-referenced file requires the one concatenated field.


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
May 12, 2010, 09:49 AM
Mark1
I concatenated the two fields I was joining on and used that one field in my join. That seems to work. Thanks!


Windows version 768