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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Join failed after working for years

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Join failed after working for years
 Login/Join
 
Member
posted
This problem happened a couple of years ago. The code is from FOCUS 7.6.2. I am just coming onto the team to address it. The error message appears right after the DEFINE statement: LINKED FILE DOES NOT HAVE A MATCHING KEY FIELD OR SEGMENT: J1XCHG_KEY. Does anyone have an idea of what may have happened?

JOIN O_EXCH IN REGULTR2 TO XCHG_KEY IN NPANXX AS J1
JOIN T_EXCH IN REGULTR2 TO XCHG_KEY IN NPANXX AS J2
-RUN

DEFINE FILE REGULTR2
CONTIG_KEY/A26 = J1XCHG_KEY | J2XCHG_KEY ;
GET_PERIOD/A4YM= PERIOD ;
CYM/A4 = EDIT('&YMD', '9999$') ;
XCG_KEY/A19 = J1XCHG_KEY | GET_DATE | RES_BUS | CENCELL_IND ;
JURIND/A2 = J1NPA_JDC ;
OSTATE/A2 = J1NPA_JDC ;
TSTATE/A2 = J2NPA_JDC ;
MILEJOIN/A5= JURIND | MILE_BAND | LATA_IND;
TIEXCH/A1 = IF J2ITC_FLAG EQ 'Y' THEN 'I' ELSE ' ' ;
DREVENUE/P12 = REVENUE2 ;
DMINUTES/P12 = MINUTES ;
T_NPA/A3 = EDIT(T_EXCH,'999');
T_NPANXX_A/A6 = EDIT(T_EXCH,'$$$999999');
T_NPANXX_I/I6 = EDIT(T_NPANXX_A);
T_EXCH2/A13 = IF T_NPANXX_I IS-FROM 0 TO 999999
THEN T_NPA | J2XCHG_AREA ELSE T_EXCH ;
J1XCHG_KEY/A13 = J1XCHG_KEY ;
J2XCHG_KEY/A13 = J2XCHG_KEY ;
END

TABLE FILE REGULTR2
SUM FST.CONTIG_KEY
FST.J1XCHG_KEY
FST.J2XCHG_KEY
FST.TIEXCH
FST.XCG_KEY
DMINUTES
DREVENUE
ALINE_CALL
NUM_MSGS
BY O_EXCH
BY T_EXCH2
BY OSTATE
BY TSTATE
BY MILEJOIN
BY JURIND
BY RES_BUS
ON TABLE HOLD
END


On the belief that the REGULTR2 file now had more instances of the cross reference key field than the NPANXX file, I reversed the JOIN syntax and added the ALL keyword, making NPANXX the host file and REGULTR2 the cross reference file. In that case, even though ? JOIN showed the join to be active, the field CONTIG_KEY was not recognized. That stumped me.


FOCUS 7.6.2, MVS, Flat files
 
Posts: 7 | Registered: October 27, 2010Report This Post
Platinum Member
posted Hide Post
Need an index on J1XCHG_KEY ?


WebFOCUS 8.2.06
 
Posts: 210 | Location: Sterling Heights, Michigan | Registered: October 19, 2010Report This Post
Member
posted Hide Post
Thanks for the input, the XCHG_KEY is indexed in MFD NPANXX.


FOCUS 7.6.2, MVS, Flat files
 
Posts: 7 | Registered: October 27, 2010Report This Post
Virtuoso
posted Hide Post
quote:
NPANXX
Do you have a different master file with the same name located somewhere in your APP path that precedes the one you are intending to use?

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
It was mentioned in a post a couple of days ago.

Use the WHENCE command to find you where the master is coming from.

Also, is the file a FOCUS file, SUFFIX=FOC or XFOCUS. Has someone rebuilt the file with out the index ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
The DEFINE FILE REGULTR2 unables the previous JOIN's with the FILE REGULTR2, by this reason all reference to NPANXX's field is an error.


FOCUS 7.1.1
OS/390 and Windows
Excel, Txt
 
Posts: 4 | Registered: April 14, 2009Report This Post
Expert
posted Hide Post
It is the JOIN that will negate the DEFINE virtual fields, not the other way around:

quote:
Note that if you are creating a virtual field in a DEFINE command, you must issue the DEFINE after the JOIN command, but before the TABLE request since a JOIN command clears all fields created by DEFINE commands for the host file and the joined structure. Virtual fields defined in Master Files are not cleared.

Tip: If a DEFINE command precedes the JOIN command, you can set KEEPDEFINES ON to reinstate virtual fields during the parsing of a subsequent JOIN command. For more information, see Preserving Virtual Fields Using KEEPDEFINES.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
JOIN O_EXCH IN REGULTR2 TO XCHG_KEY IN NPANXX AS J1
JOIN T_EXCH IN REGULTR2 TO XCHG_KEY IN NPANXX AS J2
-RUN

DEFINE FILE REGULTR2
CONTIG_KEY/A26 = J1XCHG_KEY | J2XCHG_KEY ; 
...

When joining to the same table twice, I always use the TAG clause:

JOIN O_EXCH IN REGULTR2 TO XCHG_KEY IN NPANXX TAG T1 AS J1
JOIN T_EXCH IN REGULTR2 TO XCHG_KEY IN NPANXX TAG T2 AS J2
-RUN

DEFINE FILE REGULTR2
CONTIG_KEY/A26 = T1.XCHG_KEY | T2.XCHG_KEY ; 
...


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
quote:
J1XCHG_KEY/A13 = J1XCHG_KEY ;
J2XCHG_KEY/A13 = J2XCHG_KEY ;

Could this perhaps be the problem? Try commenting these two lines out and see what happens...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
quote:
Originally posted by Dan Satchell:
quote:
NPANXX
Do you have a different master file with the same name located somewhere in your APP path that precedes the one you are intending to use?


No, this is no other MFD with the same name.


FOCUS 7.6.2, MVS, Flat files
 
Posts: 7 | Registered: October 27, 2010Report This Post
Member
posted Hide Post
quote:
Originally posted by Juan Romero:
The DEFINE FILE REGULTR2 unables the previous JOIN's with the FILE REGULTR2, by this reason all reference to NPANXX's field is an error.


Mr. Mariani is right, it is the other way around. I appreciate the input.


FOCUS 7.6.2, MVS, Flat files
 
Posts: 7 | Registered: October 27, 2010Report This Post
Member
posted Hide Post
[QUOTE]Originally posted by Francis Mariani:

When joining to the same table twice, I always use the TAG clause:

QUOTE]

In my troubleshooting tests I have added the TAG parameters and and continue to use them because they add more clarity. No effect on the outcome though.


FOCUS 7.6.2, MVS, Flat files
 
Posts: 7 | Registered: October 27, 2010Report This Post
Expert
posted Hide Post
Are you using the tag prefix (T1.) in your join or the join prefix (J1)? You should use the tag prefix.

Try adding
? JOIN
just after the JOIN to view the structure. Try adding
?FF REGULTR2
to view the column names.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
quote:
Originally posted by GamP:
quote:
J1XCHG_KEY/A13 = J1XCHG_KEY ;
J2XCHG_KEY/A13 = J2XCHG_KEY ;

Could this perhaps be the problem? Try commenting these two lines out and see what happens...


I thought that was strange too (I didn't write it). Commenting those lines made no difference.


FOCUS 7.6.2, MVS, Flat files
 
Posts: 7 | Registered: October 27, 2010Report This Post
Expert
posted Hide Post
Does XCHG_KEY exist in NPANXX?


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Why not just post the two master files being used. That would make life a lot easier for all of us...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
I would like to offer my thanks and apologies to everyone who offered an attempt on this one. The apology is for my lack of followup on this board recently. I tried some of the proposed solutions without success, then decided to go in a different direction.

I rewrote the beginning of the FEX to eliminate the simultaneous joins by doing the first join, writing to a hold file & then doing the second join on the result. Basically, I got the result with less complexity.

Thanks to all for your help.


FOCUS 7.6.2, MVS, Flat files
 
Posts: 7 | Registered: October 27, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Join failed after working for years

Copyright © 1996-2020 Information Builders