Focal Point
[CLOSED] Keepdefines

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

November 24, 2010, 04:27 PM
pvparuc
[CLOSED] Keepdefines
Hi All

I'm getting (FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED:
HOLD.HOLD.DEALER_COST ERROR while using SET KEEPDEFINES = ON IN 7.7 Environment,But Working fine with 7.6 Environment.
 -* File Test_keepdefines.fex
SET KEEPDEFINES = ON

TABLE FILE CAR
PRINT MODEL
   BODYTYPE
   FUEL_CAP
   MPG
BY COUNTRY
BY CAR
ON TABLE HOLD AS TOTPORT FORMAT FOCUS INDEX COUNTRY
END

TABLE FILE CAR
PRINT WHEELBASE DEALER_COST HEIGHT
BY COUNTRY
BY CAR
ON TABLE HOLD AS ALLROWS FORMAT FOCUS
END

JOIN COUNTRY IN ALLROWS TO COUNTRY IN TOTPORT AS J4

TABLE FILE ALLROWS
PRINT WHEELBASE DEALER_COST HEIGHT
BY COUNTRY
BY CAR
ON TABLE HOLD 
END

TABLE FILE CAR
PRINT SALES LENGTH WIDTH RETAIL_COST
BY COUNTRY
BY CAR
ON TABLE HOLD AS DETLPERF
END

DEFINE
FILE DETLPERF
HOLDINGPERIOD/I3 = 1;
END

MATCH
FILE HOLD
PRINT WHEELBASE DEALER_COST HEIGHT
BY COUNTRY
BY CAR
RUN

FILE DETLPERF
PRINT SALES LENGTH WIDTH RETAIL_COST
BY COUNTRY
BY CAR
AFTER MATCH HOLD OLD
END

DEFINE
FILE HOLD
BMVWO/D19.2 = DEALER_COST - RETAIL_COST;
EMVWO/D19.2 = HEIGHT - LENGTH;
CFLWO/D19.2 = DEALER_COST - SALES;
END

TABLE FILE HOLD
SUM DEALER_COST RETAIL_COST BMVWO EMVWO CFLWO
COMPUTE DIFFERENCE/D10.2 = DEALER_COST + CFLWO;
BY COUNTRY
BY CAR
BY SALES
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD FORMAT FOCUS
END

DEFINE FILE HOLD
SAL/D19.2 = BMVWO - SALES;
END

TABLE FILE HOLD
PRINT DEALER_COST RETAIL_COST BMVWO EMVWO CFLWO SAL
BY COUNTRY
BY CAR
END

-*SET KEEPDEFINES= OFF

 


Thanks,
PR

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


Release: Webfocus 7.6.11
OS/Platform: Windows
Output: HTML, EXL2K
November 25, 2010, 02:36 AM
Dave
Have you tried giving the HOLD file explicit name instead of just HOLD?

Might help.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
November 25, 2010, 04:08 AM
GamP
In this particular example, KEEPDEFINES serves no practical purpose. But it should also not result in this error message. The purpose of the command, from the manual:
quote:
The KEEPDEFINES parameter determines if a virtual field created by the DEFINE command for a host or joined structure is retained or cleared after the JOIN command is run. It applies when the DEFINE command precedes the JOIN command.
In this example there is no define before the join, so the command has no meaning.
If you want the error to be clarified, I'd advise to open a case with IB tech support.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
November 25, 2010, 06:05 AM
<JG>
The explanation is very simple and it is due to KEEPDEFINES doing exactly what it should

your code creates a binary format hold file called HOLD

This creates a hold file with filename HOLD and segment name HOLD
hence HOLD.HOLD.DEALER_COST

You then create a DEFINE on this HOLD which is kept in memory (as a fully qualified name)

You then create FOCUS format hold file
so HOLD.HOLD.DEALER_COST no longer exists in the HOLD.MAS file because for a FOCUS DB the filename is HOLD
but the segment name is SEG01 meaning the fully qualified fieldname is HOLD.SEG01.DEALER_COST

It's just simple bad prctice to reuse hold file names in that way.

The fact that it did not give the error previously is due to code tightnig. Really it should of.

quote:

SET KEEPDEFINES = ON

DEFINE FILE DETLPERF
HOLDINGPERIOD/I3 = 1;
END

MATCH
FILE HOLD
PRINT WHEELBASE DEALER_COST HEIGHT
BY COUNTRY
BY CAR
RUN
FILE DETLPERF
PRINT SALES LENGTH WIDTH RETAIL_COST
BY COUNTRY
BY CAR
AFTER MATCH HOLD OLD
END

DEFINE FILE HOLD
BMVWO/D19.2 = DEALER_COST - RETAIL_COST;
EMVWO/D19.2 = HEIGHT - LENGTH;
CFLWO/D19.2 = DEALER_COST - SALES;
END

TABLE FILE HOLD
SUM DEALER_COST RETAIL_COST BMVWO EMVWO CFLWO
COMPUTE DIFFERENCE/D10.2 = DEALER_COST + CFLWO;
BY COUNTRY
BY CAR
BY SALES
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD FORMAT FOCUS
END

DEFINE FILE HOLD
SAL/D19.2 = BMVWO - SALES;
END

TABLE FILE HOLD
PRINT DEALER_COST RETAIL_COST BMVWO EMVWO CFLWO SAL
BY COUNTRY
BY CAR
END


November 29, 2010, 10:33 AM
pvparuc
Thanks.. got an Idea of what happens when the KEEPDEFINES is ON.. and I'm not getting the error when the KEEPDEFINES taken out or if we give explicit name instead of just HOLD..
can you please give me an Idea of what happens when the KEEPDEFINES is 'OFF' and the reason why it works..

PR

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


Release: Webfocus 7.6.11
OS/Platform: Windows
Output: HTML, EXL2K
November 30, 2010, 02:19 AM
<JG>
A good place to start would be by reading the manual.

It's quite clearly documented.