BookmarkSubscribeRSS Feed
StaticFX
Obsidian | Level 7

Hi! Hoping someone can get me over the last hurdle...

I need to pull a file from FTP and PLACE it in a Sharepoint directory

Got the FTP part done and the file copies to my local SAS directory.

 

Im stuck getting it out to the sharepoint. Ive tried to use Samba, and it completes (with no errors) but doesnt actually work

So I tried using PROC HTTP but its unable to find valid certification path to requested target

 

Im guessing it might be the url (i will xxx some parts out)

FILENAME req "CID.csv";
FILENAME resp "TEST.CSV";

PROC HTTP
URL="https://eng.sharepoint.xxxxx.com/Access/Access%20Mng%20%20Inv/Forms/Allitems.asp"
METHOD="POST"
IN=req
CT="application/JSON"
OUT=resp
WEUSERNAME="loginname"
WEBPASSWORD="thepassword"; RUN;

ERROR: javax.net.sslSSLHandshakeException....

So im thinking its not connecting/authorizing correctly. prob wrong URL? (I copy/pasted from the sharepoint view)

FYI I found that code somewhere

 

Thanks!!

 

PS: I just found a post about using cURL ... I will look into that as well

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

Samba should work: You are just copying to a UNC path.

Have you tried copying manually to the same path?

StaticFX
Obsidian | Level 7

Thats what i thought. I can map to it, "open with explorer", and copy to it that way... yet I try Samba and it doesnt work. Unless maybe im not getting the settings correct. I use Samba for copying to our share drives... maybe its a little different?

 

 

sample:

in windows its:

https://eng.sharepoint.company.com/Access/Access Sub folder Name/Subfolder

 

so In Samba I did:

 

X "cd /home/myname/CID; &SAMBA //eng.sharepoint.company.com MyPassWord -U MyUserName -D 'Access\ Access Sub folder\subfolder' -c 'prompt; put &FNAME'";

 

- I was just told that it may be a network issue as the Sharepoint is on a different server from SAS and does not allow some connections...

ChrisNZ
Tourmaline | Level 20

A UNC path looks like this: \\server\share\subfolders

 

If you have such a path, check that the SAS server can access it by running:

filename DIR pipe "dir ""\\server\share\subfolders"" /s ";

data T;

  infile DIR;

  input;

  put _infile_;

run;

 

Replace the dir command by your own connection command to see what the OS returns.

 

If the path is accessible, the function fcopy() should do the trick.

If the only access is http, then this method is not usable obviously.

 

StaticFX
Obsidian | Level 7

Well after hours of testing, trying, and pulling out my hair, it seems that It cannot be done this way on our systems. The Sharepoint system is locked down from any connection outside that network. Turns out we are setting up a system to be able to email the file to the folder in sharepoint... so Thanks for your help! I guess I just have to wait for now.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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