If you specify the SQLREDUCEPUT=
system option, SAS optimizes the PUT function as much as possible
before the query is executed. If the query also contains a WHERE clause,
the evaluation of the WHERE clause is simplified. The following SELECT
statements are examples of queries that would be reduced if this option
was set to any value other than
none
:
select x, y from &lib..b where (PUT(x, abc.) in ('yes', 'no'));
select x from &lib..a where (PUT(x, udfmt.) = trim(left('small')));
If both the SQLREDUCEPUT=
system option and the SQLCONSTDATETIME system option are specified,
PROC SQL replaces the DATE, TIME, DATETIME, and TODAY functions with
their respective values to determine the PUT function value before
the query executes.
The following two SELECT
clauses show the original query and the optimized query. This is the
original query.
select x from &lib..c where (put(bday, date9.) = put(today(), date9.));
Here, the SELECT clause
is optimized.
select x from &lib..c where (x = '17Mar2011'D);
If a query does not
contain the PUT function, it is not optimized.
Note: The value that is specified
in the SQLREDUCEPUT= system option is in effect for all SQL procedure
statements, unless the PROC SQL REDUCEPUT= option is set. The value
of the REDUCEPUT= option takes precedence over the SQLREDUCEPUT= system
option. However, changing the value of the REDUCEPUT= option does
not change the value of the SQLREDUCEPUT= system option.