BookmarkSubscribeRSS Feed
HeidiDT
Quartz | Level 8

Hi All!

I am running a very simple PROC HTTP to download an Excel spreadsheet from Google docs, and then a subsequent import step to load the data into SAS. I get a "401 Unauthorized" note in my log for the PROC HTTP, and the imported file contains the following:

 

Allow Google Sheets access to your necessary cookies
You won't be able to access this content if necessary cookies are turned off
Learn moreAllow cookies

Sign in to your Google Account
You must sign in to access this content
Sign in

Can't access your Google Account
We can't sign you in when the necessary cookies are turned off
Learn more

 

So I am obviously able to reach the site, but then need to sign in. I have searched and searched on the web for information on how to handle this, but have just been going down rabbit holes. Here is my code:

 

filename _httpin temp;
 
proc http 
method="get" 
out=_httpin
WEBUSERNAME="my email"
WEBPASSWORD='my google password';
debug level=3;
run;
 
proc import file=_httpin out=test dbms=csv replace;
getnames=no;
datarow=1;
run;

 

I am able to access the file via my browser, and when I submit the GET method in Postman I get the same output. Please can someone who has successfully downloaded Google docs files provide some assistance?

 

Thanks!

1 REPLY 1

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1257 views
  • 0 likes
  • 2 in conversation