Problem Note 41114: WHERE clauses that reference functions will execute slowly in SCL code
When writing SCL code in SAS/AF® 9.2, any WHERE clauses that reference functions will execute slowly. In fact, the more functions that you reference in a WHERE clause, the worse the performance will be.
Here are some examples that show how functions might be used in a WHERE clause:
The use of the CATS function in this statement causes problems:
rc = where(dsid,"name=cats('11','22','33')");
|
For this particular function, there are a couple of workarounds:
-
The following workaround executes the CATS function in a separate step from the WHERE clause.
whc = cats('11','22','33');
rc = where(dsid,"name='"||whc||"'");
|
-
The following workaround replaces the CATS function with the concatenation operator "||".
rc = where(dsid,"name='11'||'22'||'33'");
|
Other situations have no workaround. In the following example, the WHERE clause references a column to which functions are applied:
rc = where(dsid,"name = upcase(firstname)");
|
In this example, NAME and FIRSTNAME are columns in the table referenced by DSID. If this WHERE clause is executed many times in a single SAS/AF session, then performance is likely to suffer.
Note that only execution of the WHERE clauses is slow. The rest of the SAS/AF application will perform normally.
Operating System and Release Information
SAS System | SAS/AF | z/OS | 9.21 | | 9.2 TS2M2 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows XP 64-bit Edition | 9.21 | | 9.2 TS2M2 | |
Microsoft® Windows® for x64 | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2003 Standard Edition | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2003 for x64 | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2008 | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows Server 2008 for x64 | 9.21 | | 9.2 TS2M2 | |
Microsoft Windows XP Professional | 9.21 | | 9.2 TS2M2 | |
Windows 7 Enterprise 32 bit | 9.21 | | 9.2 TS2M2 | |
Windows 7 Enterprise x64 | 9.21 | | 9.2 TS2M2 | |
Windows 7 Home Premium 32 bit | 9.21 | | 9.2 TS2M2 | |
Windows 7 Home Premium x64 | 9.21 | | 9.2 TS2M2 | |
Windows 7 Professional 32 bit | 9.21 | | 9.2 TS2M2 | |
Windows 7 Professional x64 | 9.21 | | 9.2 TS2M2 | |
Windows 7 Ultimate 32 bit | 9.21 | | 9.2 TS2M2 | |
Windows 7 Ultimate x64 | 9.21 | | 9.2 TS2M2 | |
Windows Vista | 9.21 | | 9.2 TS2M2 | |
Windows Vista for x64 | 9.21 | | 9.2 TS2M2 | |
64-bit Enabled AIX | 9.21 | | 9.2 TS2M2 | |
64-bit Enabled HP-UX | 9.21 | | 9.2 TS2M2 | |
64-bit Enabled Solaris | 9.21 | | 9.2 TS2M2 | |
HP-UX IPF | 9.21 | | 9.2 TS2M2 | |
Linux | 9.21 | | 9.2 TS2M2 | |
Linux for x64 | 9.21 | | 9.2 TS2M2 | |
OpenVMS on HP Integrity | 9.21 | | 9.2 TS2M2 | |
Solaris for x64 | 9.21 | | 9.2 TS2M2 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> SCL (SAS Component Language) SAS Reference ==> Functions ==> Functions System Administration ==> Performance
|
Date Modified: | 2010-10-13 11:24:19 |
Date Created: | 2010-10-01 14:44:14 |