Focal Point
[SOLVED] Conditional joins

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

September 22, 2009, 07:54 AM
Ted Michalski
[SOLVED] Conditional joins
I put the following conditional Join in a master:

SEGMENT=ZSNV865_ATTRIBUTE_VALUE, SEGTYPE=KM, PARENT=ZSNV160_RECEIVEABLE, CRFILE = ZSNV865_ATTRIBUTE_VALUE, $
JOIN_WHERE=ZSNV160_RECEIVEABLE.VEH_MAKE_CD EQ ZSNV865_ATTRIBUTE_VALUE.VAL_CD; ,$
JOIN_WHERE=VAL_CD EQ 1; ,$

And I'm geting the following error when doing a check. What is wrong with my syntax?

(FOC03601) ERROR AT OR NEAR LINE 686 IN PROCEDURE GS_WS_EXTRACT
(FOC396) MASTER ATTRIBUTE REPEATED. TERMINATOR (,$) MISSING?: >JOIN_WHERE<
----------vvvvvvvvvv
JOIN_WHERE=VAL_CD EQ 1; ,$

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


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
September 22, 2009, 08:20 AM
Danny-SRL
Ted,

I think that the problem is caused by a limitation to 1 JOIN_WHERE attribute in the master. Try:
  
JOIN_WHERE=(ZSNV160_RECEIVEABLE.VEH_MAKE_CD EQ ZSNV865_ATTRIBUTE_VALUE.VAL_CD) AND (VAL_CD EQ 1) ; ,$



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

September 22, 2009, 10:32 AM
Ted Michalski
Thanks Daniel! Looks like that may have done it. The example I used had multiple JOIN_WHERE clauses, but this did not give me the error when I did a check.


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
September 22, 2009, 11:06 AM
j.gross
According to the book multiples are allowed -- But the closing ,$ for the entire Segment declaration comes at the very end:
Syntax: How to Define a Conditional Join in the Master File

SEGNAME=seg,  
  SEGTYPE=styp,  
  PARENT=parseg,
  CRFILE=xmfd,  
 [CRSEG=xseg,
  JOIN_WHERE=expression; [JOIN_WHERE=expression; ...] 
  ,$

So remove the first two $'s (after CRFILE=..., and between the two JOIN_WHERE=...; clauses) and you s/b set.


- Jack Gross
WF through 8.1.05
September 23, 2009, 04:50 AM
Danny-SRL
Nice going Jack. I searched WebFocus and not FOCUS! Frowner
Is this not supported in WF? Doesn't seem likely. Not documented? VERY likely...


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

September 24, 2009, 07:33 AM
David Glick
We support Conditional JOINs in the Developer Studio JOIN Tool as well as the JOIN Tool in InfoAssist.


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
September 24, 2009, 08:40 AM
Ted Michalski
I put the folliowing code in the master file:

SEGMENT=ZSNV865_ATTRIBUTE_VALUE, SEGTYPE=S0, PARENT=ZSNV160_RECEIVEABLE, LOCATION=ZSNV865_ATTRIBUTE_VALUE, JOIN_WHERE=(ZSNV160_RECEIVEABLE.VEH_MAKE_CD EQ ZSNV865_ATTRIBUTE_VALUE.VAL_CD) AND (ZSNV865_ATTRIBUTE_VALUE.VAL_CD EQ 1);, $
FIELDNAME=ATTR_TYPE_CD, ALIAS=ATTR_TYPE_CD, USAGE=I11, ACTUAL=I4, $
FIELDNAME=VAL_CD, ALIAS=VAL_CD, USAGE=I11, ACTUAL=I4, $
FIELDNAME=VAL_CD_DS, ALIAS=VAL_CD_DS, USAGE=A50V, ACTUAL=A50V, $
FIELDNAME=LSTUPDT_TS, ALIAS=LSTUPDT_TS, USAGE=HYYMDm, ACTUAL=HYYMDm, $
FIELDNAME=LSTUPDT_USER_ID_CD, ALIAS=LSTUPDT_USER_ID_CD, USAGE=A9, ACTUAL=A9, $


Here is the resulting access file code:

SEGNAME=ZSNV865_ATTRIBUTE_VALUE, TABLENAME=ZSNT01RV.ZSNV865_ATTRIBUTE_VALUE,
CONNECTION=GSDev, GUI_PARAMS='0,859,411,907,459,278,160', KEYS=0, $

But when I try to run a query against this code, here's the error message I get:

(FOC1354) ACCESS FILE RECORD ABSENT, WRONG OR INCOMPLETE FOR SEGMENT :
ZSNV865_ATTRIBUTE_VALUE


Any suggestions?


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
September 24, 2009, 08:59 AM
Tom Flynn
Why would you put a Conditional Join on a LOCATION segment, which, should be your DDNAME, not a column?


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
September 24, 2009, 09:53 AM
j.gross
1. As I noted above, CRFILE attribute is required in any segment with JOIN_WHERE

2. Same document states: "Conditional joins in the Master File are supported for relational data sources only. The conditions are considered virtual fields in the Master File."

3. The LOCATION attribute applies only to Focus files.

Change LOCATION= to CRFILE=.


- Jack Gross
WF through 8.1.05
September 30, 2009, 02:43 PM
Ted Michalski
Solved.


7.7.02
Windows
EXCEL, PDF, CSV, TEXT