BookmarkSubscribeRSS Feed
nazmul
Quartz | Level 8

Dear Everyone,

 

I use large data very frequently in SAS. I am wondering if I can save my files in google drive instead of saving them in a external hard drive and use them directly from google drive in SAS programming. I read the following site and tried the following code:

  

filename _inbox "%sysfunc(getoption(work))/control.sas7bdat";

proc http method="get"
url="https://drive.google.com/file/d/................................../view?usp=sharing"
out=_inbox
;
run;


filename _inbox clear;
proc contents data=work.control;
run;

 

But I got the following error messages:

 

67 filename _inbox "%sysfunc(getoption(work))/control.sas7bdat";
68
69 proc http method="get"
70 url="https://drive.google.com/file/d/1............................."
71 out=_inbox
72 /* proxyhost="http://yourproxy.company.com" */
73 ;
74 run;

NOTE: PROCEDURE HTTP used (Total process time):
real time 0.34 seconds
cpu time 0.01 seconds

NOTE: 200 OK

75
76
77
78 filename _inbox clear;
NOTE: Fileref _INBOX has been deassigned.
79
80 proc contents data=work.control;
ERROR: File WORK.CONTROL.DATA is not a SAS data set.
81 run;

NOTE: Statements not processed because of errors noted above.
NOTE: PROCEDURE CONTENTS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.

 

As a first time user, what should I do? If you can provide me a thorough process to follow, it would really be helpful.

3 REPLIES 3
SASKiwi
PROC Star

Just a word of caution. Unless you happen to have a very fast Internet download connection, reading data from Google Drive is likely to be significantly slower than an external hard drive.

FriedEgg
SAS Employee

As @Kurt_Bremser says, you aren't using the correct URL, so the response you are getting should just be HTML and not the file you actually want.

 

It is not a simple operation to do what you want and I'd recommend that you use one of the many command line tools available for downloading files from Google Drive instead of attempting an implementation yourself using PROC HTTP (though certainly not impossible).

 

https://github.com/gdrive-org/gdrive

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3610 views
  • 1 like
  • 4 in conversation