<?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: Downloading CSV - Methods from file on PC orweb in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Downloading-Importing-CSV-Methods-from-file-on-PC-or-web/m-p/765395#M242443</link>
    <description>&lt;P&gt;URL method is pretty close, you need to import it as well as download it though. PROC HTTP downloads the file, PROC IMPORT will then read the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2017/05/07/download-convert-csv-files/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2017/05/07/download-convert-csv-files/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename probly temp;
proc http url="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv"
 method="GET"
 out=probly;
run;

proc import out=bird_baths datafile=probly dbms=csv replace; guessingrows = max; run;

proc print data=bird_baths (obs=10);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392714"&gt;@Indescribled&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I usually mess with this Tidy Tuesday data in R, but I want to try it in SAS this week as practice. I am having some trouble importing it into SAS Studio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data page - &lt;A href="https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md" target="_blank" rel="noopener"&gt;https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md&lt;/A&gt;&lt;BR /&gt;Direct link to csv - &lt;A href="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv;" target="_blank" rel="noopener"&gt;https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a few questions. Below is my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 - Why am I getting an error trying to import the data directly from my PC after downloading the file?&lt;/P&gt;
&lt;P&gt;2 - I uploaded the file directly to SAS Studio and was able to interact with it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3 - I tried to import the data directly from the web CSV and I do not get an error, but when I try to print it to see if it exists I do get an error. How do I know if it correctly downloaded and what do I need to change in the code to be able to print the data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;* 1 &lt;BR /&gt;  ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/C:/Users/Jason/Documents/R/Tidy Tuesday/BirdBaths/birdbaths.csv. 
  ERROR: Import unsuccessful.  See SAS Log for details.;
proc import file="C:/Users/Jason/Documents/R/Tidy Tuesday/BirdBaths/birdbaths.csv"
    out=birdbathsPC
    dbms=csv;
run;
&lt;BR /&gt;* 2
* THIS WORKS
* Need to figure out how to do it without uploading to SAS;
proc import file="/home/u59127222/SP4R/birdbaths.csv"
    out=birdbaths
    dbms=csv;
run;

proc print data=birdbaths (obs=6);
run;

* 3
* Testing downloading directly from the web
* https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md
* https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv;

* https://blogs.sas.com/content/sasdummy/2017/05/07/download-convert-csv-files/;
filename probly temp;
proc http
 url="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv"
 method="GET"
 out=probly;
run;

* ERROR: File WORK.PROBLY.DATA does not exist;
proc print data=WORK.probly (obs=6);
run;&lt;BR /&gt;&lt;BR /&gt;* &lt;SPAN&gt;ERROR: File WORK.PROBLY.DATA does not exist;&lt;BR /&gt;proc print data=probly (obs=6);&lt;BR /&gt;run;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 15:23:22 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-09-01T15:23:22Z</dc:date>
    <item>
      <title>Downloading/Importing CSV - Methods from file on PC or web</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-Importing-CSV-Methods-from-file-on-PC-or-web/m-p/765383#M242433</link>
      <description>&lt;P&gt;I usually mess with this Tidy Tuesday data in R, but I want to try it in SAS this week as practice. I am having some trouble importing it into SAS Studio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data page - &lt;A href="https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md" target="_blank" rel="noopener"&gt;https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md&lt;/A&gt;&lt;BR /&gt;Direct link to csv - &lt;A href="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv" target="_blank" rel="noopener"&gt;https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a few questions. Below is my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 - Why am I getting an error trying to import the data directly from my PC after downloading the file?&lt;/P&gt;&lt;P&gt;2 - I uploaded the file directly to SAS Studio and was able to interact with it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;3 - I tried to import the data directly from the web CSV and I do not get an error, but when I try to print it to see if it exists I do get an error. How do I know if it correctly downloaded and what do I need to change in the code to be able to print the data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;* 1 &lt;BR /&gt;  ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/C:/Users/Jason/Documents/R/Tidy Tuesday/BirdBaths/birdbaths.csv. 
  ERROR: Import unsuccessful.  See SAS Log for details.;
proc import file="C:/Users/Jason/Documents/R/Tidy Tuesday/BirdBaths/birdbaths.csv"
    out=birdbathsPC
    dbms=csv;
run;
&lt;BR /&gt;* 2
* THIS WORKS
* Need to figure out how to do it without uploading to SAS;
proc import file="/home/u59127222/SP4R/birdbaths.csv"
    out=birdbaths
    dbms=csv;
run;

proc print data=birdbaths (obs=6);
run;

* 3
* Testing downloading directly from the web
* https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md
* https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv;

* https://blogs.sas.com/content/sasdummy/2017/05/07/download-convert-csv-files/;
filename probly temp;
proc http
 url="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv"
 method="GET"
 out=probly;
run;

* ERROR: File WORK.PROBLY.DATA does not exist;
proc print data=WORK.probly (obs=6);
run;&lt;BR /&gt;&lt;BR /&gt;* &lt;SPAN&gt;ERROR: File WORK.PROBLY.DATA does not exist;&lt;BR /&gt;proc print data=probly (obs=6);&lt;BR /&gt;run;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 15:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-Importing-CSV-Methods-from-file-on-PC-or-web/m-p/765383#M242433</guid>
      <dc:creator>Indescribled</dc:creator>
      <dc:date>2021-09-01T15:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading CSV - Methods from file on PC orweb</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-Importing-CSV-Methods-from-file-on-PC-or-web/m-p/765395#M242443</link>
      <description>&lt;P&gt;URL method is pretty close, you need to import it as well as download it though. PROC HTTP downloads the file, PROC IMPORT will then read the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2017/05/07/download-convert-csv-files/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2017/05/07/download-convert-csv-files/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
filename probly temp;
proc http url="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv"
 method="GET"
 out=probly;
run;

proc import out=bird_baths datafile=probly dbms=csv replace; guessingrows = max; run;

proc print data=bird_baths (obs=10);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392714"&gt;@Indescribled&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I usually mess with this Tidy Tuesday data in R, but I want to try it in SAS this week as practice. I am having some trouble importing it into SAS Studio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data page - &lt;A href="https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md" target="_blank" rel="noopener"&gt;https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md&lt;/A&gt;&lt;BR /&gt;Direct link to csv - &lt;A href="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv;" target="_blank" rel="noopener"&gt;https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a few questions. Below is my code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 - Why am I getting an error trying to import the data directly from my PC after downloading the file?&lt;/P&gt;
&lt;P&gt;2 - I uploaded the file directly to SAS Studio and was able to interact with it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3 - I tried to import the data directly from the web CSV and I do not get an error, but when I try to print it to see if it exists I do get an error. How do I know if it correctly downloaded and what do I need to change in the code to be able to print the data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;* 1 &lt;BR /&gt;  ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/C:/Users/Jason/Documents/R/Tidy Tuesday/BirdBaths/birdbaths.csv. 
  ERROR: Import unsuccessful.  See SAS Log for details.;
proc import file="C:/Users/Jason/Documents/R/Tidy Tuesday/BirdBaths/birdbaths.csv"
    out=birdbathsPC
    dbms=csv;
run;
&lt;BR /&gt;* 2
* THIS WORKS
* Need to figure out how to do it without uploading to SAS;
proc import file="/home/u59127222/SP4R/birdbaths.csv"
    out=birdbaths
    dbms=csv;
run;

proc print data=birdbaths (obs=6);
run;

* 3
* Testing downloading directly from the web
* https://github.com/rfordatascience/tidytuesday/blob/master/data/2021/2021-08-31/readme.md
* https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv;

* https://blogs.sas.com/content/sasdummy/2017/05/07/download-convert-csv-files/;
filename probly temp;
proc http
 url="https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-08-31/bird_baths.csv"
 method="GET"
 out=probly;
run;

* ERROR: File WORK.PROBLY.DATA does not exist;
proc print data=WORK.probly (obs=6);
run;&lt;BR /&gt;&lt;BR /&gt;* &lt;SPAN&gt;ERROR: File WORK.PROBLY.DATA does not exist;&lt;BR /&gt;proc print data=probly (obs=6);&lt;BR /&gt;run;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 15:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-Importing-CSV-Methods-from-file-on-PC-or-web/m-p/765395#M242443</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-01T15:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading/Importing CSV - Methods from file on PC or web</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-Importing-CSV-Methods-from-file-on-PC-or-web/m-p/765401#M242448</link>
      <description>&lt;P&gt;Large economy sized hint: Do not place punctuation immediately after a URL in message window as link. The semicolon you added at the end of the URL becomes part of it and the link shows a 404 File not found error because of it. (Not the code, the "direct link" in the thread text)&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 15:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-Importing-CSV-Methods-from-file-on-PC-or-web/m-p/765401#M242448</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-09-01T15:31:19Z</dc:date>
    </item>
  </channel>
</rss>

