Usage Note 14659: Using BASE SAS® DATA step functions in the SQL procedure
Most, but not all, BASE SAS DATA step functions can be used in PROC SQL because these functions are part of BASE SAS, and PROC SQL is a BASE SAS procedure.
PROC SQL summary functions contain only one argument, and the column's statistic is calculated across the rows of the group.
Multiple arguments used in a PROC SQL summary function cause it to no longer be considered a summary function. In this case, PROC SQL searches BASE SAS for a like-named function. If it finds one, the statistic is calculated for the current row.
If there is no like-named BASE SAS function, an error occurs.
When you use certain DATA step functions in PROC SQL, you might encounter unexpected results, which could include the following:
- Differences in column lengths using the COALESCEC() function in PROC SQL versus the DATA step.
- Using multiple arguments in the SUM() function calculate the results for the current row.
- Using multiple arguments in the AVG() function produces the following error:
Error: Function AVG could not be located.
This error occurs because there is no function named AVG() in BASE SAS.
- The LAG() function cannot be used in PROC SQL.
Operating System and Release Information
SAS System | Base SAS | 64-bit Enabled AIX | 9 TS M0 | |
OpenVMS Alpha | 9 TS M0 | |
64-bit Enabled HP-UX | 9 TS M0 | |
HP-UX IPF | 9 TS M0 | |
HP-UX | 9 TS M0 | |
Linux | 9 TS M0 | |
z/OS | 9 TS M0 | |
64-bit Enabled Solaris | 9 TS M0 | |
Solaris | 9 TS M0 | |
Microsoft Windows 2000 Advanced Server | 9 TS M0 | |
Microsoft Windows 2000 Datacenter Server | 9 TS M0 | |
Microsoft Windows 2000 Professional | 9 TS M0 | |
Microsoft Windows XP Professional | 9 TS M0 | |
Microsoft Windows NT Workstation | 9 TS M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | |
Microsoft Windows Server 2003 Standard Edition | 9 TS M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9 TS M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9 TS M0 | |
Microsoft Windows 2000 Server | 9 TS M0 | |
Tru64 UNIX | 9 TS M0 | |
AIX | 9 TS M0 | |
*
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: | Usage Note |
Priority: | |
Topic: | SAS Reference ==> SQL SAS Reference ==> Procedures ==> SQL
|
Date Modified: | 2005-05-05 10:40:11 |
Date Created: | 2005-02-25 09:38:18 |