![]() Chapter Contents |
![]() Previous |
![]() Next |
| SAS/SHARE User's Guide |
select emptitle as title, avg(empyears), freq(empnum)
from sql.employee
group by title
order by title;where SQL is the libref for a remote SAS library that is accessed through a SAS/SHARE server or a SAS/CONNECT remote host, each row in the table EMPLOYEE must be returned to your local SAS session in
order for the summary functions AVG() and FREQ() to be applied to them.
select * from connection to remote
(select emptitle as title,
avg(empyears), freq(empnum)
from sql.employee
group by title
order by title);the query is passed through the SAS/SHARE server to the SAS SQL processor, which processes each row in the table and returns only the summary rows to your local SAS
session.
You can also use RSPT to join remote data with local data. For example, if you specify
libname mylib 'c:\sales';
proc sql;
connect to remote (server=mvs.shr1 dbms=db2
dbmsarg=(ssid=db2p));
select * from mylib.sales97,
connection to remote
(select qtr, division,sales, pct
from revenue.all97
where region = 'Southeast')
where sales97.div = division;the subquery against the DB2 data is sent through the SAS/SHARE server to the DB2 server and the rows for the divisions in the Southeast region are returned to your local SAS session, where they are
joined with the corresponding rows from the local data set MYLIB.SALES97.
proc sql;
connect to remote (server=sunserv dbms=oracle);
execute (delete from parts.inventory
where part_bin_number = '093A6')
by remote;sends the SQL DELETE statement through the SAS/SHARE server to the remote ORACLE server.
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.