Hybrid Queries (from Fraktal SAS Programming)

Aus phenixxenia.org
Zur Navigation springen Zur Suche springen


  1. 1st Make SAS your SQL interpreter
proc sql;
  1. 2nd Connect to the DBMS using your credentials stored in Macro Variables
connect to oracle (user="&DB_USR." password="&DB_PWD." path="&DB_PTH.");
3rd Start your query from inside SAS with a special from clause
select * 
  from connection to oracle
4th Inside brackets use DBMS specific SQL
(
select * 
  from ops$&DB_USR..&MYTABLE.
)
5th Execute the query by issuing the SAS statement terminator ';'
;
6th Terminate connection to DBMS
disconnect to oracle;
7th Terminate SAS SQL processor status
quit;