<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How To Download a Google Sheet .csv through SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730297#M227384</link>
    <description>&lt;P&gt;I thought I could access it with proc http and basic authentication if I had the app password, but it seems that OAuth is required to access it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following links may be helpful.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/SAS0224-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/SAS0224-2017.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Mar 2021 04:04:09 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2021-03-31T04:04:09Z</dc:date>
    <item>
      <title>How To Download a Protected Google Sheet .csv through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730283#M227374</link>
      <description>&lt;P&gt;I'm using SAS EG, 7.15 HF9 (7.100.5.6226) (64-bit) powered by SAS 9.4. If I paste this link into my browser, a .csv file is automatically downloaded to my PC: &lt;A href="https://docs.google.com/spreadsheets/d/1Lsuw2rKoVtKml7S1oro1pAjqNxHnOxdS3qxTS2D140c/export?format=csv" target="_blank" rel="noopener"&gt;https://docs.google.com/spreadsheets/d/1xFgCLi7cr-_Z_hbhksYIv5jABk6EaBcPNWRlVzH5kxY/export?format=csv&lt;/A&gt;. This is a test document but the real data I need to download through SAS has sensitive data so I can't share that here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code below works with the test document because there are no restrictions, but when I run the same code with the document that requires me to be signed in, I get HTML output instead of the csv data (copied below).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way I can authenticate my Google credentials through SAS?&lt;/P&gt;
&lt;PRE&gt;filename in url "https://docs.google.com/spreadsheets/d/1xFgCLi7cr-_Z_hbhksYIv5jABk6EaBcPNWRlVzH5kxY/export?format=csv";
filename out "%sysfunc(pathname(work))\data.csv"; 
 
data _null_;                                                                                                                                                      
  infile in;                                                                                                                                                      
  input;                                                                                                                                                          
  if _n_&amp;gt; 1;                                                                                                                                                     
  file out;                                                                                                                                                       
  put _infile_;                                                                                                                                                   
run;                                                                                                                                                              
                                                                                                                                                                  
PROC IMPORT OUT= WORK.data                                                                                                                                        
     DATAFILE= "%sysfunc(pathname(work))\data.csv"                                                                                                 
     DBMS=CSV REPLACE;                                                                                                                                            
RUN;
&lt;/PRE&gt;
&lt;P&gt;.csv snippet from SAS in HTML&lt;/P&gt;
&lt;TABLE width="64"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;lt;html lang="en"&amp;gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; &amp;lt;head&amp;gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; &amp;lt;meta charset="utf-8"&amp;gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; &amp;lt;meta content="width=300&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; &amp;lt;meta name="description" content="Create a new spreadsheet and edit with others at the same time -- from your computer&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; &amp;lt;meta name="google-site-verification" content="LrdTUW9psUAMbh4Ia074-BPEVmcpBxF6Gwf0MSgQXZs"&amp;gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; &amp;lt;title&amp;gt;Google Sheets - create and edit spreadsheets online&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; &amp;lt;style&amp;gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; @font-face {&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; font-family: 'Open Sans';&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; font-style: normal;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; font-weight: 300;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp; src: url(//fonts.gstatic.com/s/opensans/v15/mem5YaGs126MiZpBA-UN_r8OUuhs.ttf) format('truetype');&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;}&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 02:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730283#M227374</guid>
      <dc:creator>cgates</dc:creator>
      <dc:date>2021-03-31T02:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: How To Download a Google Sheet .csv through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730285#M227375</link>
      <description>&lt;P&gt;I don't think this is a SAS problem.&lt;/P&gt;
&lt;P&gt;To test, try accessing the spreadsheet link in another browser without cache or in private mode.&lt;BR /&gt;If it doesn't download as a CSV, you will first need to change the sharing range to "Everyone who knows the link" in Google Spreadsheets.&lt;BR /&gt;Then you should be able to download it as a csv.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 01:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730285#M227375</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-31T01:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: How To Download a Google Sheet .csv through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730289#M227378</link>
      <description>&lt;P&gt;You're right. The link I provided was just an example but it does work if I remove restrictions. The issue is the production link I need this for does need to be protected. Do you know of a way I can authenticate my Google credentials through SAS? I thought it would work because I was running the SAS program while logged into my Gmail but that doesn't seem to work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 02:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730289#M227378</guid>
      <dc:creator>cgates</dc:creator>
      <dc:date>2021-03-31T02:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How To Download a Google Sheet .csv through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730297#M227384</link>
      <description>&lt;P&gt;I thought I could access it with proc http and basic authentication if I had the app password, but it seems that OAuth is required to access it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following links may be helpful.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2019/3232-2019.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/SAS0224-2017.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings17/SAS0224-2017.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 04:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730297#M227384</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-31T04:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How To Download a Google Sheet .csv through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730386#M227436</link>
      <description>&lt;P&gt;The content sharing access permissions for Google Docs can be set to not require authentication.&amp;nbsp; My memory, you can set (paraphrasing) "Share to whom ever has the link".&amp;nbsp; I don't use it often, and I have to stumble through their security access menus re-re-learning it every time.&amp;nbsp; Something to consider, HTH.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 12:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/730386#M227436</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-31T12:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: How To Download a Google Sheet .csv through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/954812#M372896</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256958"&gt;@cgates&lt;/a&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Were you ever able to solve this? I'm having the same issue - unable to set permissions on sheet for public access.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 12:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/954812#M372896</guid>
      <dc:creator>LJ_</dc:creator>
      <dc:date>2024-12-31T12:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: How To Download a Google Sheet .csv through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/954814#M372898</link>
      <description>Unfortunately nothing worked for me. I just gave up on automating the process for the protected information.</description>
      <pubDate>Tue, 31 Dec 2024 14:43:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Download-a-Protected-Google-Sheet-csv-through-SAS/m-p/954814#M372898</guid>
      <dc:creator>cgates</dc:creator>
      <dc:date>2024-12-31T14:43:01Z</dc:date>
    </item>
  </channel>
</rss>

