04-29-2016 07:55 AM
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;
infile dropbox length=len;
input record $varying200. len;
put record $varying200. len;
if _n_=15 then stop;
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.
04-29-2016 08:13 AM
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:
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.
04-29-2016 10:37 AM
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