BookmarkSubscribeRSS Feed
sustagens
Pyrite | Level 9

Hi, I have a SAS dataset I would like to import into Microsoft Access.

This is the first time I am setting up a link to SAS from outside and I'm not sure how to go about doing it

sustagens_1-1605753703728.png

9 REPLIES 9
ballardw
Super User

Import or link?

Old school and robust is to Export the SAS data set to a CSV file (there is a wizard that should do this) and use the Access import on that file. If the SAS data set is static this may be the easiest for someone with little SAS experience.

 

If the SAS data will change and you want to link the question might be whether you are comfortable with ODBC to set up an ODBC link.

sustagens
Pyrite | Level 9
Hi ballardw, thanks for your reply. I am currently importing it as CSV as you described and want to optimise by skipping this step.
The SAS data set will change, yes. How can I link it via ODBC? It looks for a connection definition file.
SASKiwi
PROC Star

If you have the SAS product SAS/ACCESS to PC FILES then you can use PROC EXPORT to write a SAS dataset to an ACCESS table: https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=acpcref&docsetTarget=p1d0...

sustagens
Pyrite | Level 9
Hi SASKiwi, thanks for your reply, unfortunately my SAS is a client/server install, and the dataset will be refreshed by a stored procedure. As per my understanding, with my client/server setup I can't use proc export to export to a local destination. I am aware of the Copy Files task in EG but because I will use the code in a stored procedure I need a code solution, not point-and-click.. What I thought I might do is create a saved import in MS Access, which imports the SAS dataset directly.
Kurt_Bremser
Super User

In a client/server environment, you need to set up a SAS/SHARE server on the SAS server, and install the SAS ODBC driver on the host where MS ACCESS runs. Then define the ODBC connection to your SAS server, and use that in Access.

sustagens
Pyrite | Level 9

Hi KurtBremser, thanks for your reply, I searched how I can do that. First step, check if I have SAS/SHARE. Came across this thread, which you also answered back in 2018. I don't see SAS/SHARE, PRODNUM010 nor PRODNUM035 when I run proc setinit and proc product_status. Does it mean this route is a dead end for me?

sustagens
Pyrite | Level 9
I see, OK, thanks for your time Kurt!
SASKiwi
PROC Star

What OS does your SAS server run on? You could always get the SAS server to write the Access database to a network file share which is also accessible from your PC.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 2986 views
  • 0 likes
  • 4 in conversation