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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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