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.
5 REPLIES 5
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
FGao
Calcite | Level 5

How did it go? Were you able to do so?

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 15617 views
  • 0 likes
  • 3 in conversation