Code to read a SAS dataset from my "C" drive to SAS Enterprise Guide


Does anyone know the code to read a SAS Dataset from my "C" drive.

I am able to define a libname "statement to folders on other external drives and read a SAS dataset into my program residing on EG
I am able to use "Proc Import" and "server=my machine name"  and read an Excel file into my SAS program from my "C" drive

When I try to define a libname to my "C" drive,  it is not recognized by the server.  I have to manually "upload" the file.
moriniaAdvanced Analytics AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aloysius LowCommented:
is your SAS Enterprise Guide using a server SAS or local Base SAS?

sounds like chances are it's the former not the latter..

if it's the former, whichever path you have defined will be the path relative to theserver i.e. C:\ is the server's C:\ not your PC's C:\

if it's the latter, then we'll need to look further e.g. what do you mean by you need to manually 'upload' the dataset?
moriniaAdvanced Analytics AnalystAuthor Commented:
If I click on the dataset while I have SAS EG open, the dataset is added to the project.  However, I cannot use it until I click on "upload dataset".  This then uploads the data set and I can not use it.  It is  now available in the "Work" library in SAS.

I tried even saving the project with the "upload" step thinking it would execute when the project was run, but that did not work either.

You are correct, I do not have base SAS on my machine.  I am not certain, but the libraries that I can access SAS datasets are probably assigned to the Server, that is why they are seen by the server.  It is probably not best practices to allow everyone's "C" drive to be accessible.

I was hoping there was syntax to create a libname which uses PC Server to read a SAS dataset.

However, I find it interesting that using SAS PC Server, I can import Excel  datasets and Access tables from my "C" drive.  I
Aloysius LowCommented:
i don't think it's each individual's C drive that the SAS server is accessing.. if anything, it's been mapped from the server to the PC as a drive or access from the server using a network path (e.g. \\machine name\share name)

SAS PC Server essentially SAS server to access files on your PC with the right set up. however, it is limited to files like Excel and Access etc but excluding SAS datasets.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
moriniaAdvanced Analytics AnalystAuthor Commented:
You were correct.  When I moved the SAS dataset to an area designated for me to store my SAS datasets, I was able to assign the library and read the SAS dataset into my program with no problem.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.