Focal Point
DEFINE and WHERE report limits

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

August 23, 2006, 11:01 AM
gregson06
DEFINE and WHERE report limits
I'm running webfocus version 5.3 and am trying to run a script that incrementally adds a new parameter for purposes of gathering data, it goes something like so:

DEFINE FILE CAR
MYCARID/A8= IF(MAKE = 'CHEVROLET' AND MODEL = 'CAMARO' AND COLOR = 'RED') THEN '0808909001' ELSE
IF(MAKE = 'CHEVROLET' AND MODEL = 'TRAILBLASER' AND COLOR = 'BLUE') THEN '0909090901' ELSE
...
END

TABLE FILE CAR
PRINT
MYCARID
MAKE
YEAR
WHERE (MAKE = 'CHEVROLET' AND MODEL = 'CAMARO' AND COLOR = 'RED') OR
(MAKE = 'CHEVROLET' AND MODEL = 'TRAILBLASER' AND COLOR = 'BLUE') OR
...
END

My question here is whether WebFOCUS actually has a limit on these sections. I found that after about 100 or so of these repeated find and define lines of code, the processing time almost triples. Is there an easier way to do this or is it pretty much downhill from here? I would use an external database file to reference these values but I am not sure how I can do something like that, my experiences with FILEDEF in WebFOCUS has not been all that great. Any suggestions?

Thanks!
August 23, 2006, 12:02 PM
KevinG
G,

Why wouldn't you test for the values you DEFINEd using the WHERE statement in your TABLE request as;

WHERE MYCARID EQ '0808909001' OR '0909090901'

???
See if your performance is still bad...

Kevin


WF 7.6.10 / WIN-AIX
August 23, 2006, 12:17 PM
gregson06
I think I'll try it out.

Performance-wise, does anyone know if its more efficient to write it out like this:

WHERE MYCARD ID IN ('VALUE1','VALUE2'....'VALUE100')

or

WHERE (MYCARD EQ 'VALUE1') OR (MYCARD EQ 'VALUE2') ... OR (MYCARD EQ 'VALUE100')

Thanks again!

I hadn't thought about using the DEFINE'd values, but hopefully this'll shave off some time as is.
August 23, 2006, 09:48 PM
Piipster
You should always try to do your WHERE statements against database fields as opposed to DEFINEd fields. That way you are not evaluating the DEFINE for rows you will not ultimately keep.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
August 23, 2006, 09:50 PM
Piipster
BTW... is the MYCARID broken down into sections or is each number random... I mean do some of the digits represent Chevrolet and some represent Blue, etc?


ttfn, kp


Access to most releases from R52x, on multiple platforms.
August 23, 2006, 10:58 PM
gregson06
Well, that's just the thing, the code that gets put in can be completely random. So it can say "HelloWorld" and really have no relationship with MAKE or MODEL. That's where the connundrum rolls in because I can suddenly just say instead of putting 2007JaguarXtype, it can go to 2007HelloWorld. And after about 100 of those DEFINE...ELSE statements I wonder if it's taking a toll on the processing time...