BookmarkSubscribeRSS Feed
Hi1
Calcite | Level 5 Hi1
Calcite | Level 5

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.

 

 

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Hi1
Calcite | Level 5 Hi1
Calcite | Level 5

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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

ballardw
Super User

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

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1436 views
  • 0 likes
  • 3 in conversation