BookmarkSubscribeRSS Feed
gabras
Pyrite | Level 9

Hi,

 

i need some help about the possibility of extracting SAS data from outside SAS.

I have to create three sas view that my Customer has to execute and read when he wants. Theese views will be stored in Sql server.

 

Does anyone know how it can be done?

 

Thank you

3 REPLIES 3
ChrisHemedinger
Community Manager

To be clear, you're reading non-SAS data (SQL server) from a SAS process? Yes, you can do that.

 

Assuming that you have SAS/ACCESS to ODBC or SAS/ACCESS to OLE DB, you assign a SAS library to your database connection.  Exact syntax for this may vary, but it will look something like this:

 

libname mydblib oledb 
 user=myusr1 password=mypwd1
 datasource=dept203 provider=sqloledb 
 properties=('initial catalog'=mgronly);

Then you can access the tables/views with normal LIBNAME.MEMBER syntax (ex: mydblib.mydata).

 

See documentation here for OLE DB.  And here for ODBC.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
gabras
Pyrite | Level 9

Hi @ChrisHemedinger

unfortuntely not.

 

It's the opposite. The customer has to read a sas data from outside SAS.

Pippo Company has to read the SAS view and bring it on its db.

 

Thank you

 

ChrisHemedinger
Community Manager

Okay -- for that, we have the SAS IOM Provider for OLE DB (use this to connect to a SAS workspace, similar to the way SAS Enterprise Guide works) and the SAS ODBC Driver (connects to SAS/SHARE server or SPDS server).  Either way, I think to render a SAS view you'll need the driver to connect to a running instance of SAS that can assemble the data rows, with any SAS formats you need, etc.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 3 replies
  • 1321 views
  • 2 likes
  • 2 in conversation