Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Keepdefines
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Keepdefines
 Login/Join
 
Silver Member
posted
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
 
Posts: 32 | Registered: October 29, 2010Reply With QuoteReport This Post
Master
posted Hide Post
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
 
Posts: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
<JG>
posted
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

 
Reply With QuoteReport This Post
Silver Member
posted Hide Post
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
 
Posts: 32 | Registered: October 29, 2010Reply With QuoteReport This Post
<JG>
posted
A good place to start would be by reading the manual.

It's quite clearly documented.
 
Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Keepdefines

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.