Focal Point
[SOLVED] Conditional Join not working in WebFOCUS 8

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

September 23, 2013, 11:55 AM
Mighty Max
[SOLVED] Conditional Join not working in WebFOCUS 8
It appears that Conditional Joins are not working when you join on more than one field. I am testing some fex files in our test WebFOCUS 8 Environment at version 8.0.2M. The following fex works fine in our 7.6.11 environment.
Can some of you guys test this fex in your WebFocus Environemnts?
  
-* File error_cond_join_wf8.fex

SET ASNAMES = ON
SET HOLDLIST = PRINTONLY

TABLE FILE CAR
SUM
   DEALER_COST
BY COUNTRY
BY CAR
ON TABLE HOLD AS HDEALER
END
-RUN

TABLE FILE CAR
SUM
   RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE HOLD AS HRETAIL
END
-RUN

JOIN CLEAR *
JOIN LEFT_OUTER
     FILE HDEALER  AT COUNTRY AND CAR TAG T1 TO ALL
     FILE HRETAIL  AT COUNTRY AND CAR TAG T2 AS J1
  WHERE T1.COUNTRY EQ T2.COUNTRY;
  WHERE T1.CAR EQ T2.CAR;
END
-RUN
   
TABLE FILE HDEALER
SUM
   DEALER_COST
   RETAIL_COST
BY COUNTRY
BY CAR
END
-RUN

Some screenshots

This message has been edited. Last edited by: Mighty Max,


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
September 23, 2013, 12:24 PM
Tom Flynn
Took out the multiple columns, worked, for this simple test.

  
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY

TABLE FILE CAR
SUM
   DEALER_COST
BY COUNTRY
BY CAR
ON TABLE HOLD AS HDEALER
END
-RUN

TABLE FILE CAR
SUM
   RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE HOLD AS HRETAIL
END
-RUN

JOIN CLEAR *
JOIN LEFT_OUTER 
     FILE HDEALER  AT COUNTRY TAG T1 TO ALL
     FILE HRETAIL  AT COUNTRY TAG T2 AS J1
  WHERE T1.COUNTRY EQ T2.COUNTRY;
  WHERE T1.CAR EQ T2.CAR;
END
-RUN
   
TABLE FILE HDEALER
SUM
   DEALER_COST
   RETAIL_COST
BY COUNTRY
BY CAR
END
-RUN



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
September 23, 2013, 02:11 PM
Danny-SRL
Max,

This is called "code tightening". If you look at the documentation:
  
The syntax of the conditional (WHERE-based) JOIN command is
JOIN [LEFT_OUTER|INNER] FILE hostfile AT hfld1 [WITH hfld2] [TAG tag1]
TO {UNIQUE|MULTIPLE}
FILE crfile AT crfld [TAG tag2] [AS joinname]
[WHERE expression1;
[WHERE expression2;
...]
END

you can see that there is only one field after the "AT".
Most probably WF7 was more forgiving...


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

September 23, 2013, 02:45 PM
Mighty Max
Thank you Tom and Danny. Appreciate all of your help. Issue is due to incorrect syntax being used. Sweating
I've been using Conditional Joins more recently because they don't complain about indexes or data not being sorted or having to build a concatenated key. They just do the join.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
September 25, 2013, 05:06 PM
Doug
quote:
They just do the join.

That's good to know. Thanks for this post Smiler

~ Doug