BookmarkSubscribeRSS Feed
Petersas
Calcite | Level 5

Hi,

I'm newbie to SAS, trying to learn SAS myself. Can anyone let me know how to connect to oracle from SAS and pull data from tables to create report.

Any help will be appreciated.

8 REPLIES 8
Haikuo
Onyx | Level 15

Hi,

Please refer to this paper:

http://www.nesug.org/proceedings/nesug04/io/io04.pdf

In a nutshell, I usually use one of the following two approaches:

1. pass-through facility: It is believed that the query is done on Oracle side natively, so it could be more efficient.

2. Libname engine:

There are also other solutions such as proc dbload, which I have no experience in.

HTH,

Haikuo

Doc_Duke
Rhodochrosite | Level 12

Peter,

Note, particularly, the prerequisites at the bottom of page 1 in Haikuo's reference.  You need to have an oracle client piece on your machine and a license for SAS/Access for Oracle.

Your local IT support should be able to set you up with the Oracle client.  You should test the connection with SQL*Plus to make sure that you know that any problems you might see on the SAS side are not part of the underlying Oracle setup.

Doc Muhlbaier

Duke

Petersas
Calcite | Level 5

Oracle-client -- sqlplus- is installed on my station and i can run queries successfully from it. so how to get connected to oracle from SAS and get information from RDBMS tables into SAS for producing sas datasets.

Doc_Duke
Rhodochrosite | Level 12

Do you have SAS/Access to Oracle licensed and installed?  If so, what are the specific error message(s) that you are getting?

Did you read the documentation? it has examples.

http://support.sas.com/documentation/cdl/en/acreldb/63144/HTML/default/viewer.htm#p1ujrhdoe1p743n12a...

Please provide the log of what you tried.

Linlin
Lapis Lazuli | Level 10

using libname:

libname test oracle user="***"   password="***"   path="***" schema=****;


Petersas
Calcite | Level 5

is PROC SQL; QUIT; used ONLY to get data from dbms table like oracle,mssql  or  used to manipulate data present in SAS dataset?

Doc_Duke
Rhodochrosite | Level 12

Many of us use it extensively for all sorts of data, including SAS datasets and DBMS tables.

Petersas
Calcite | Level 5

Thanks for your replies... Issue resolved.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 8772 views
  • 0 likes
  • 4 in conversation