BookmarkSubscribeRSS Feed
Tom
Super User Tom
Super User

Does anyone have successful methods for accessing files stored in SharePoint sites using SAS programs running on Unix (or other non-Windows platforms)?

The best answer I have been able to find involves using the unix command utility curl rather than native SAS capabilities.

xml - SAS PROC SOAP to update Sharepoint List - Stack Overflow

8 REPLIES 8
jakarman
Barite | Level 11

Tom, did you see: SAS(R) 9.4 Intelligence Platform: Installation and Configuration Guide ? (Overview of Deploying SAS Web Parts for Microsoft SharePoint) it is using proc soap.
SharePoint is a web-based access for some classic data (sky-drive cloud-one).  What is coming in with that is identification/authentication. Microsoft did hide that with their desktop approach (IWA).

Connecting must be possible when working on that (unix based) users evaluated the Windows only approach as more easy to do (manual actions).   

---->-- ja karman --<-----
Tom
Super User Tom
Super User

Thanks Jaap.  To me that looks more like a way to publish information in SharePoint sites that is being produced by SAS code.

I was more thinking about how to allow users of SAS to access information that is currently being stored in SharePoint, mainly in Document Libraries.  Preferably with just BASE SAS.  I can reference those files using simple URL notation on my PC (http://<server>/<site>/Shared%20Documents/example.xlsx ) but when I try to reference the file using SAS code similar to Chris H's example blog post:

http://blogs.sas.com/content/sasdummy/2012/12/18/using-sas-to-access-data-stored-on-dropbox/

I get access denied messages back instead of the file.  If I use curl instead then I can tell it how to authenticate to SharePoint and I can retrieve the file.

jakarman
Barite | Level 11

Yep webparts is for publishing SAS content into sharepoint. The interesting sentence there is that proc soap is used. You already did find that.
We are knowing SAS is too far behind with following all that fast evolving interfaces. Secure mail, procies with authentication and sites with authentication is making it all more difficult.
filemethods with url http sftp socket ,  proc http,  proc soap you have to do a lot to understand and use them.    

In socket mode you could do all the programming of building interfaces as it the most basic one.
Filename WebDAV should be the one for that interface. SAS(R) 9.4 Statements: Reference, Third Edition but other wise is would be sftp https.

As you are getting through using curl, what is that you have done there. cURL - Wikipedia, the free encyclopedia  it supports a lot.
Just see what has added to the filename sftp with 9.4 SAS(R) 9.4 Statements: Reference, Third Edition

This could you leaving to use curl by piping and the xcmd usage :smileygrin:

---->-- ja karman --<-----
Tom
Super User Tom
Super User

The -SSPI configuration option seems to be required for use with SharePoint.

3    filename in webdav &infile debug user='zzzz' pass=XXXXXXXXXXXX recfm=s ;

ERROR: The server is requesting single sign-on, but the SSPI option has not been specified.

So I restarted SAS with the -sspi command line option, but it looks like there is more that I need to do.

I think that I need to get my system administrators involved to figure out what else is required.

4    filename in webdav &infile debug user='zzzz' pass=XXXXXXXXXXXX recfm=s ;

Collection handle creation failed.

ERROR: Insufficient authorization to access http://...

naveen_srini
Quartz | Level 8

Hello Sir, We at L&T Infotech,India exactly encountered the same problem in our on going project last week and after despairing attempts, we could not still not get SAS to access sharepoint. We raised a ticket with SAS technical support in india and after their failed attempts the ticket was transferred to SAS USA, nonetheless the issue has still not been resolved and the ticket is still open. Yes, SSPI option was the recommendation they gave and bore no fruit.

However, we did a work around downloading the file with a VB script and also tried calling the VB script from batch script and that worked fine. For now, we have chosen to go with this approach.

If you need more help, i will try to get more details from my admin and see what best I can share with you that made us progress in our project. Wishing you a merry Christmas!!!!

An excerpt from my SAS Admin that I can share:

"We tried downloading sample file from sharepoint sites using sas code by making changes in the configuration files. The success rate is 1 out of 10 means the same sas code which had successfully downloaded the file was ran without making any changes to it; it fails giving multiple errors as below. We are getting 2 type of errors for same set of code, technical support  track was raised with SAS India and this was shown to them via web-ex session and they are following up with US technical support for the fix since they are not able to solve it"


And another one from SAS tech support:-

"Hi Naveen,

You need to start the SAS session that you are running Proc Http from with the "-sspi" option

Example:

sas -sspi

Let us know if that fixed that error

if you using windows You should be able to right click on the SAS 9.4 icon and select properties. There should be Short cut tabl with a target defined. You should be able to add the option there."


stomioka
Calcite | Level 5

Thanks. I was able to download xls file from Sharepoint using -sspi  option and proc http.

rsc24_in
Fluorite | Level 6

Do You know if this solution works for Sharepoint Online (Microsoft's Cloud based Sharepoint)?

stomioka
Calcite | Level 5

Capture.PNG

 

 

I don't have a way to test. Start SAS with -sspi option. Add this in your SAS short cut "target".

 

%let filepath=http://[rest of the path].xlsx;

filename out "...\abc.xlsx";

proc http

 

in=in

out=out

url="&filepath."

method="get"

webpassword="&pass."

webusername="&user.";

run;

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 10315 views
  • 1 like
  • 5 in conversation