SAS System Options |
Valid in: | configuration file, SAS invocation, OPTIONS statement, SAS System Options window |
Category: | Files: SAS Files |
System administration: SQL | |
PROC OPTIONS GROUP= | SASFILES |
SQL |
Syntax | |
Syntax Description | |
Details | |
See Also |
Syntax |
SQLCONSTDATETIME | NOSQLCONSTDATETIME |
specifies that the SQL procedure is to replace references to the DATE, TIME, DATETIME, and TODAY functions with their equivalent numeric constant values.
specifies that the SQL procedure is not to replace references to the DATE, TIME, DATETIME, and TODAY functions with their equivalent numeric constant values.
Details |
When the SQLCONSTDATETIME system option is set, the SQL procedure evaluates the DATE, TIME, DATETIME, and TODAY functions in a query once, and uses those values throughout the query. Computing these values once ensures consistency of results when the functions are used multiple times in a query or when the query executes the functions close to a date or time boundary.
When the NOSQLCONSTDATETIME system option is set, the SQL procedure evaluates these functions in a query each time it processes an observation.
If both the SQLREDUCEPUT system option and the SQLCONSTDATETIME system option are specified, the SQL procedure replaces the DATE, TIME, DATETIME, and TODAY functions with their respective values in order to determine the PUT function value before the query executes:
select x from &lib..c where (put(bday, date9.) = put(today(), date9.));
Note: The value that is specified in the SQLCONSTDATETIME system option is in effect for all SQL procedure statements, unless the CONSTDATETIME option in the PROC SQL statement is set. The value of the CONSTDATETIME option takes precedence over the SQLCONSTDATETIME system option. However, changing the value of the CONSTDATETIME option does not change the value of the SQLCONSTDATETIME system option.
See Also |
System option: | |||
PROC SQL statement CONSTDATETIME option in Base SAS Procedures Guide | |||
Improving Query Performance in SAS SQL Procedure User's Guide |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.