BookmarkSubscribeRSS Feed
JoshuaHarris
Obsidian | Level 7
I believe there are couple of ways to read file from sharepoint using SAS. I want to know if we can point SAS to a location in sharepoint (like how we use libname) and then want to check if the sharepoint location contains some 10 excel documents in it or not.
Please let me know if its possible in SAS and if so how this can be done.
4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well you can.  Sharepoint can be mapped to a network drive just like any other network location.  You will need to ask your IT what the network address for it would be.  Then once you have the mapped network area, you just libname to it as any other network drive.  Its pretty simple, but its mainly your IT department to provide the information and to ensure that SAS install (you didn't mention if it was local, EG, or some other SAS package) would have access to SP.  For instance if your running EG which is server based, then the server needs the network mapping and the access to SP.

To get a file list there are many posts out there on this.  Again, depends what SAS software you use, but if its locally installed SAS, and you have the network map, then:

filename tmp pipe 'dir "x:/*.xlsx" /b';
data want;
  infile tmp;
  length fname $200;
  input fname $;
run;
  

Will give you a list of Excel files in that location.

Do bear in mind that sharepoint is an access controlled setup, so reading/writing can be complicated.

JoshuaHarris
Obsidian | Level 7
Thanks for your response. I believe we can by the way that you mentioned.
But want to know if i can code something like the URL of the sharepoint and
read the files from there.

Am using 'SAS for windows' in local.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Speak with your IT, as requests to and from Sharepoint are authorised via active directory and such things, and to access the area directly would require some sort of https protocol transfer.  Perhaps the http procedure:

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a003286672.htm

 

 

JoshuaHarris
Obsidian | Level 7
Thanks. I will try the http proc and will update the post

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 14151 views
  • 0 likes
  • 2 in conversation