SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 41114: WHERE clauses that reference functions will execute slowly in SCL code

DetailsHotfixAboutRate It

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

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS/AFz/OS9.219.2 TS2M2
Microsoft® Windows® for 64-Bit Itanium-based Systems9.219.2 TS2M2
Microsoft Windows Server 2003 Datacenter 64-bit Edition9.219.2 TS2M2
Microsoft Windows Server 2003 Enterprise 64-bit Edition9.219.2 TS2M2
Microsoft Windows XP 64-bit Edition9.219.2 TS2M2
Microsoft® Windows® for x649.219.2 TS2M2
Microsoft Windows Server 2003 Datacenter Edition9.219.2 TS2M2
Microsoft Windows Server 2003 Enterprise Edition9.219.2 TS2M2
Microsoft Windows Server 2003 Standard Edition9.219.2 TS2M2
Microsoft Windows Server 2003 for x649.219.2 TS2M2
Microsoft Windows Server 20089.219.2 TS2M2
Microsoft Windows Server 2008 for x649.219.2 TS2M2
Microsoft Windows XP Professional9.219.2 TS2M2
Windows 7 Enterprise 32 bit9.219.2 TS2M2
Windows 7 Enterprise x649.219.2 TS2M2
Windows 7 Home Premium 32 bit9.219.2 TS2M2
Windows 7 Home Premium x649.219.2 TS2M2
Windows 7 Professional 32 bit9.219.2 TS2M2
Windows 7 Professional x649.219.2 TS2M2
Windows 7 Ultimate 32 bit9.219.2 TS2M2
Windows 7 Ultimate x649.219.2 TS2M2
Windows Vista9.219.2 TS2M2
Windows Vista for x649.219.2 TS2M2
64-bit Enabled AIX9.219.2 TS2M2
64-bit Enabled HP-UX9.219.2 TS2M2
64-bit Enabled Solaris9.219.2 TS2M2
HP-UX IPF9.219.2 TS2M2
Linux9.219.2 TS2M2
Linux for x649.219.2 TS2M2
OpenVMS on HP Integrity9.219.2 TS2M2
Solaris for x649.219.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.