SAS- Connecting and Getting SAS datasets directly from oracle
Posted by Analyst in SAS, SAS-Oracle connection
You are here: Home > SAS-Oracle connection > SAS- Connecting and Getting SAS datasets directly from oracle
on Mar 19, 2010What do you need?
1. A machine which has an oracle client or the capability to connect to an oracle server.
2. Details required – User Name, Password and the host name.
3. Proper version of SAS installed having the necessary oracle drivers.Read SAS modules to check.
2. Details required – User Name, Password and the host name.
3. Proper version of SAS installed having the necessary oracle drivers.Read SAS modules to check.
SAS Code:
Say you have a table name “employee” in your oracle server which you used to connect using the user “scott”, password “tiger” and path being “emp1”. Requirement is to get all the records from the table as a local dataset.
Say you have a table name “employee” in your oracle server which you used to connect using the user “scott”, password “tiger” and path being “emp1”. Requirement is to get all the records from the table as a local dataset.
libname test “D:\Temp\”; proc sql; connect to oracle(user=scott orapw=tiger path=”@emp1″); create table test.employee as select * from connection to oracle (select * from employee); disconnect from oracle; quit;
Output:
Employee dataset will be created in the library specified. The formats of the variables in the new dataset will be same/equivalent to the one in oracle (The database from which it was created).
PEOPLE WHO READ THIS ALSO READ : SAS,
SAS-Oracle connection
This entry was posted on Mar 19, 2010 at 7:04 AM and is filed under SAS, SAS-Oracle connection. You can follow any responses to this entry through the RSS 2.0. You can leave a response.
- No comments yet.
If you liked this post, make sure you subscribe to the RSS feed!



SAS
XCELSIUS





