Desktop productivity for business analysts and programmers

SAS code to upload CSV file in Drop box

Reply
New Contributor Hi1
New Contributor
Posts: 4

SAS code to upload CSV file in Drop box

Hi Team,

 

I would like to upload CSV file under the folder name Test into the Dropbox. I have been trying the below code to finish my task but it's been unsuccessful.

 

file dropbox url 'https://www.dropbox.com/'

       Email='n*******s@***.com' Pass='**********' prompt;

 

data _null_;

        infile dropbox length=len;

        input record $varying200. len;

        put record $varying200. len;

        if _n_=15 then stop;

run;

 

proc export data=merge1;

outfile = "\file.csv" replace; run;

 

Here the SAS code should login with my dropbox credentials and create a folder called TEST and upload the CSV file into it.

 

It will be helpfull if you can come up with some solution to the problem.

 

 

Super User
Super User
Posts: 7,694

Re: SAS code to upload CSV file in Drop box

Hi,

 

Personally I don't use Dropbox (having a distrust in anything online based), so how do you normally upload files?  Is it by sending an email - if not I don't see how the file statement would work.  You would need to investigate what the command line approach to uploading files to Dropbox is, here for instance:

http://www.dropboxwiki.com/tips-and-tricks/using-the-official-dropbox-command-line-interface-cli

 

I would also point out that its is unlikely that the use of third party online storage would be inline with any data storage policy you have at your company, mine would expressly forbid such a process.  Data should be transported via secure means - such as SFTP.  So do be careful about what your doing.

New Contributor Hi1
New Contributor
Posts: 4

Re: SAS code to upload CSV file in Drop box

Hi,

 

Dropbox is not my business case. I have got similar kind of business study where i need to code it in SAS. Dropbox is just an example for my requirement.

Super User
Super User
Posts: 7,694

Re: SAS code to upload CSV file in Drop box

Without knowing the actual case its hard to say as each system has its own process. 

Super User
Posts: 11,107

Re: SAS code to upload CSV file in Drop box

If you are attempting to write to a Url then use separate FILENAME statements for your source and destination that includes the url with the specific file to read and write.

 

I don't use Dropbox but I think something like

 

filename dropin url " https://www.dropbox.com/path/your source file name     Email='n*******s@***.com' Pass='**********' prompt ";

 

filename dropout url " https://www.dropbox.com/path/your output file name     Email='n*******s@***.com' Pass='**********' prompt ";

 

may be close. An entire connections string may need to be inside the quotes to send to the server. You should get a response in the log if the fileref can't be created and so can play around.

 

Use the dropout fileref instead of explicit file in the Proc export: Outfile= dropout

Ask a Question
Discussion stats
  • 4 replies
  • 326 views
  • 0 likes
  • 3 in conversation