ET,
Yes, I've looked at your sample code and made some modifications to more closely resemble the situation I'm dealing with. Here is the code:
TSO ALLOC F(CAR) DA('FOCUS.CAR') SHR REU
-RUN
-****** CREATING FOC DB EHVALART
-STEP1A
-******
DEFINE FILE CAR
CANC_CODE/A8=
IF CAR EQ 'TOYOTA' OR 'JAGUAR' OR 'ALFA ROMEO'
THEN 'ACTIVE' ELSE 'INACTIVE';
END
TABLE FILE CAR
SUM CAR NOPRINT
BY COUNTRY
WRITE CANC_CODE DEALER_COST SALES
BY COUNTRY
BY CAR
IF COUNTRY NE FRANCE
ON TABLE HOLD
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
-******
-STEP1B
-******
DEFINE FILE HOLD
CNTRY_CAR/A26 = COUNTRY | CAR;
END
TABLE FILE HOLD
BY CNTRY_CAR
PRINT CANC_CODE DEALER_COST SALES
ON TABLE HOLD AS EHVALART FORMAT FOCUS INDEX CNTRY_CAR
END
-RUN
-***** CREATING JUST COUNTRY CARS FOC DB EHHOMES
-STEP2
-*****
DEFINE FILE CAR
CNTRY_CAR/A26 = COUNTRY | CAR;
END
TABLE FILE CAR
BY CNTRY_CAR
SUM COUNTRY CAR
ON TABLE HOLD AS EHHOMES FORMAT FOCUS INDEX CNTRY_CAR
END
-RUN
-***** SIMPLE JOIN
-STEP3
-*****
JOIN CLEAR *
JOIN CNTRY_CAR IN EHHOMES TAG H1
TO CNTRY_CAR IN EHVALART TAG X1 AS J1
END
TABLE FILE EHHOMES
HEADING
"SIMPLE JOIN 1"
PRINT
H1.COUNTRY
H1.CAR
X1.CANC_CODE
X1.DEALER_COST
X1.SALES
END
-RUN
-***** SET ALL=PASS WITH IF TEST
-STEP4
-*****
SET ALL=PASS
JOIN CLEAR *
JOIN CNTRY_CAR IN EHHOMES TAG H1
TO CNTRY_CAR IN EHVALART TAG X1 AS J1
END
TABLE FILE EHHOMES
HEADING
"SIMPLE JOIN 1"
PRINT
H1.COUNTRY
H1.CAR
X1.CANC_CODE
X1.DEALER_COST
X1.SALES
IF CANC_CODE EQ 'ACTIVE'
END
-RUN
-***** TESTING CONDITIONAL JOIN
-STEP5
-*****
JOIN CLEAR *
JOIN FILE EHHOMES AT CNTRY_CAR TAG H1
TO ONE FILE EHVALART AT CNTRY_CAR TAG X1 AS J1
WHERE CANC_CODE EQ 'ACTIVE';
END
TABLE FILE EHHOMES
HEADING
"CONDITIONAL JOIN RESULTS 1"
PRINT
H1.COUNTRY
H1.CAR
X1.CANC_CODE
X1.DEALER_COST
X1.SALES
END
-RUN
Now for the results...
The SIMPLE JOIN produces:
==================================================================
PAGE 1
SIMPLE JOIN
COUNTRY CAR CANC_CODE DEALER_COST SALES
------- --- --------- ----------- -----
ENGLAND JAGUAR ACTIVE 18,621 12000
ENGLAND JENSEN INACTIVE 14,940 0
ENGLAND TRIUMPH INACTIVE 4,292 0
FRANCE PEUGEOT 0 0
ITALY ALFA ROMEO ACTIVE 16,235 30200
ITALY MASERATI INACTIVE 25,000 0
JAPAN DATSUN INACTIVE 2,626 43000
JAPAN TOYOTA ACTIVE 2,886 35030
W GERMANY AUDI INACTIVE 5,063 7800
W GERMANY BMW INACTIVE 49,500 80390
===============================================================
This is okay, i.e. it shows that the JOIN between EHHOMES and EHVALART is working. However I need to modify the JOIN to produce the following result:
==================================================================
COUNTRY CAR CANC_CODE DEALER_COST SALES
------- --- --------- ----------- -----
ENGLAND JAGUAR ACTIVE 18,621 12000
ENGLAND JENSEN INACTIVE 0 0
ENGLAND TRIUMPH INACTIVE 2 0
FRANCE PEUGEOT 0 0
ITALY ALFA ROMEO ACTIVE 16,235 30200
ITALY MASERATI INACTIVE 0 0
JAPAN DATSUN INACTIVE 0 0
JAPAN TOYOTA ACTIVE 2,886 35030
W GERMANY AUDI INACTIVE 0 0
W GERMANY BMW INACTIVE 0 0
===============================================================
Here is what the SET ALL=PASS produces:
===============================================================
PAGE 1
SIMPLE JOIN
COUNTRY CAR CANC_CODE DEALER_COST SALES
------- --- --------- ----------- -----
ENGLAND JAGUAR ACTIVE 18,621 12000
ITALY ALFA ROMEO ACTIVE 16,235 30200
JAPAN TOYOTA ACTIVE 2,886 35030
===============================================================
SET ALL=PASS drops HOST file recors when the cross-reference records are NOT active.
Finally the CONDITIONAL JOIN produces:
===============================================================
PAGE 1
CONDITIONAL JOIN RESULTS
COUNTRY CAR CANC_CODE DEALER_COST SALES
------- --- --------- ----------- -----
ENGLAND JAGUAR ACTIVE 18,621 12000
ENGLAND JENSEN ACTIVE 18,621 12000
ENGLAND TRIUMPH ACTIVE 18,621 12000
FRANCE PEUGEOT ACTIVE 18,621 12000
ITALY ALFA ROMEO ACTIVE 18,621 12000
ITALY MASERATI ACTIVE 18,621 12000
JAPAN DATSUN ACTIVE 18,621 12000
JAPAN TOYOTA ACTIVE 18,621 12000
W GERMANY AUDI ACTIVE 18,621 12000
W GERMANY BMW ACTIVE 18,621 12000
===============================================================
This result is totally bogus, it is distributing the Jaguar numbers across all subsequent records!
My next step is to initiate a "Case" with IBI Tech Support. We'll see what the come up with.
Ed
WebFOCUS 716 MVS DB2 AIX UDB