Focal Point
Solved (FOC370) THE FIELDNAME USED IN JOIN CANNOT BE FOUND IN THE FILE: BLANK

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

May 07, 2012, 04:38 PM
steveyosteve
Solved (FOC370) THE FIELDNAME USED IN JOIN CANNOT BE FOUND IN THE FILE: BLANK
This code was working in WF 7.1.7 not working in WF 7.7.04. I'm new to focus. Not sure what they are trying to do. Create a dummy row in a focus table?

Any help is appreciated

JOIN CLEAR *
JOIN BLANK WITH BUSINESS_UNIT_NAME IN HOLD TO ALL BLANK IN TWGIF100

DEFINE FILE HOLD
LEGAL_ENTITY_SORT/A4 = IF (FOCLIST EQ 1) THEN LEGAL_ENTITY_SORT
ELSE IF (FOCLIST EQ 2) THEN '9999'
ELSE ' ';
COMPANY_CODE/A8 = IF (FOCLIST EQ 1) THEN COMPANY_CODE
ELSE IF (FOCLIST EQ 2) THEN 'TOTAL'
ELSE ' ';
END

TABLE FILE HOLD
SUM
&PCTNUMFLD
&PCTDIVFLD
COMPUTE PCTA/&DOLLAR_FMT1 = IF (&PCTDIVFLD EQ 0) THEN 0
ELSE (&PCTNUMFLD / &PCTDIVFLD) * 100;

BY COMPANY_CODE
BY LEGAL_ENTITY_SORT
BY BUSINESS_UNIT_SUMMARY_SORT
BY BUSINESS_UNIT_SUMMARY_NAME
BY BUSINESS_UNIT_SORT
BY BUSINESS_UNIT_NAME

WHERE (FOCLIST LE 2);

ON TABLE HOLD
END
-RUN
-SET &SAYTIMEMSG = 'Create Row Totals (dummy Legal Entity created)';
-INCLUDE USAYTIME
-IF (&SAYTIMEERR NE 0) THEN GOTO NODATA;

JOIN CLEAR *
JOIN BLANK WITH BUSINESS_UNIT_NAME IN HOLD TO ALL BLANK IN TWGIF100

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


Windows Server 2003 and Windows Server 2008
May 07, 2012, 04:58 PM
j.gross
Look up "Define-based joins"
May 07, 2012, 07:25 PM
steveyosteve
does it make sense that it would work in WF 7.1.7 not work in WF 7.7.04?


Windows Server 2003 and Windows Server 2008
May 07, 2012, 10:37 PM
Dan Satchell
quote:
JOIN BLANK WITH BUSINESS_UNIT_NAME IN HOLD TO ALL BLANK IN TWGIF100

This statement indicates a field named BLANK is being DEFINEd in file HOLD and then JOINed to a similarly-named field in TWGIF100. However, your code does not show a DEFINE for field BLANK. I suppose field BLANK may already exist in file HOLD, which may explain why this code worked in an earlier release but does not in newer releases (due to code tightenening). Another bad practice I notice in your code is the repeated use of the same HOLD file name, namely "HOLD". You should at least differentiate them with names like HOLD1, HOLD2, HOLD3, etc., to avoid confusing WebFOCUS and the developers who must maintain it.


WebFOCUS 7.7.05
May 08, 2012, 07:53 AM
steveyosteve
Dan Satchell,

I don't see BLANK a field named BLANK in the hold file. Is it possible it was a reserved word in the earlier release and not in 7.7.04?

By the word about the code, It was written by People that are not senior consultants at IBI.(but I agree it is very confusing).

Thanks

Steve


Windows Server 2003 and Windows Server 2008
May 08, 2012, 08:36 AM
steveyosteve
I added BLANK to the hold file and the report works. Just have to see if the results are the same as they were with previous release.

DEFINE FILE HOLD
BLANK /A1 = ' ';
LEGAL_ENTITY_SORT/A4 = IF (FOCLIST EQ 1) THEN LEGAL_ENTITY_SORT
ELSE IF (FOCLIST EQ 2) THEN '9999'
ELSE ' ';
COMPANY_CODE/A8 = IF (FOCLIST EQ 1) THEN COMPANY_CODE
ELSE IF (FOCLIST EQ 2) THEN 'TOTAL'
ELSE ' ';
END


Windows Server 2003 and Windows Server 2008
May 08, 2012, 10:45 AM
j.gross
You should code a WITH phrase in the define, to match that in the join:
JOIN BLANK WITH BUSINESS_UNIT_NAME IN HOLD TO ALL BLANK IN TWGIF100

DEFINE FILE HOLD
  BLANK/A1 WITH BUSINESS_UNIT_NAME = ' ';
. . .


The WITH phrase, in both contexts, tells TABLE at what point in navigation to evaluate the field -- in the present example, whenever a new instance of the segment containing BUSINESS_UNIT_NAME is read in.
May 08, 2012, 10:48 AM
Tom Flynn
Looks Mcguyver'ish to me; just not using it as documented, which is fine...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe