Accessing DBMS Data with the Pass-Through Facility Using a Pass-Through Query in a Subquery 269
Output 14.4 SAS Log Comparing the Two PROC SQL Queries
213
214 %let dept=’ACC%’;
215
216 select empid, lastname, firstnam
217 from samples.allemp
218 where dept like &dept and salary <
219 (select avg(salary)
220 from connection to sybase
221 (select SALARY from EMPLOYEES
222 where DEPT like &dept));
NOTE: The SQL Statement used 0:00:00.2 real 0:00:00.20 cpu.
223 %put &sqlxmsg;
224 disconnect from sybase;
NOTE: The SQL Statement used 0:00:00.0 real 0:00:00.0 cpu.
225 quit;
NOTE: The PROCEDURE SQL used 0:00:00.0 real 0:00:00.0 cpu.
226
227 %let dept=’ACC%’;
228
229 proc sql stimer;
NOTE: The SQL Statement used 0:00:00.0 real 0:00:00.0 cpu.
230 select empid, lastname, firstnam
231 from samples.allemp
232 where dept like &dept and salary <
233 (select avg(salary)
234 from samples.allemp
235 where dept like &dept);
NOTE: The SQL Statement used 0:00:06.0 real 0:00:00.20 cpu.