11-11-2014 08:38 AM
I am trying to apply a user defined format through a put funtion in the where statement while setting the dataset and it it is taking 1 hour, and if i remove the put function, it takes 3 minutes.
What can be the issue , and how can we overcome it ?
Thanks in advance
11-11-2014 08:53 AM
Well, posting the code would be useful. I wouldn't recommend putting functions like that in a where clause as its called for each row then totaling up time. What are you trying to where, why not use the underlying data, e.g if date then '01JAN2014'd, if number then =1, etc.
11-11-2014 09:05 AM
Post the proc format code and the data step.
Most probably the user defined format is complex enough to eat CPU cycles.
11-11-2014 09:34 AM
Aside from the possibilty of overriding an index, POST THE CODE!
11-11-2014 09:25 AM
With that kind of difference I suspect that your column is indexed.
Putting a function in where clause effectively removes the possibility to use index (with some exceptions, like substr from pos 1).
"Note: Conditions are not optimized with an index for arithmetic operators, a variable-to-variable condition, the sounds-like operator, and any function other than the TRIM and SUBSTR function as listed above."
If your value is a constant, create is a macro variable prior to the extract step.
If it't in a transaction/look-up table, have the put function in an earlier step.