hi,

can anyone tell me in what way the output of my UDF needs to be defined in order to guarantee usage of a logical file on a packed decimal ?

even if I add ZONED(UDF(), 8) around my function, my queries simply refuse to take advantage of the logical in which the packed decimal appears in the first position of the key.

thus, a query showing 'WHERE DTAV = 20041109' uses the logical and returns data within seconds. whereas 'WHERE DTAV = TODAY_8NUM()' will perform a full scan on millions of rows !

please help!
thanks,
mirko