<?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 Downloading zip files from US Census FTP site in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Downloading-zip-files-from-US-Census-FTP-site/m-p/337920#M76824</link>
    <description>&lt;P&gt;The US Census Bureau makes TIGER/Line shapefiles available via a series of FTP sites. &amp;nbsp;The files are freely available and no account is needed to access the FTP site.&amp;nbsp; I am attempting to write a program that downloads those files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I presumed a filename ftp statement was the way to go, but am running into problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;* Copy files from US Census website to the specified directory;
filename _bcin ftp "ftp://ftp2.census.gov/geo/tiger/TIGER2010/ZCTA5/2010/tl_2010_24_zcta510.zip";
filename _bcout "C:\Temp\tl_2010_24_zcta510.zip" recfm=n;
data _null_;
   length msg $ 384;
   rc=fcopy('_bcin', '_bcout');
   if rc=0 then
      put 'Copied _bcin to _bcout.';
   else do;
      msg=sysmsg();
      put rc= msg=;
   end;
run;

quit;&lt;/PRE&gt;
&lt;P&gt;I received the follwoing error: rc=5660215 msg=ERROR: Open failed for file _BCIN.&lt;/P&gt;
&lt;P&gt;What is the proper filenane ftp statement for the remote file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(alternative question: downloading US Census files must be a common task for mapping appications.&amp;nbsp; Are there any available macros out there that accomplishes this?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running SAS v9.4, TS1M4.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Mar 2017 17:33:01 GMT</pubDate>
    <dc:creator>KAZ</dc:creator>
    <dc:date>2017-03-03T17:33:01Z</dc:date>
    <item>
      <title>Downloading zip files from US Census FTP site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-zip-files-from-US-Census-FTP-site/m-p/337920#M76824</link>
      <description>&lt;P&gt;The US Census Bureau makes TIGER/Line shapefiles available via a series of FTP sites. &amp;nbsp;The files are freely available and no account is needed to access the FTP site.&amp;nbsp; I am attempting to write a program that downloads those files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I presumed a filename ftp statement was the way to go, but am running into problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;* Copy files from US Census website to the specified directory;
filename _bcin ftp "ftp://ftp2.census.gov/geo/tiger/TIGER2010/ZCTA5/2010/tl_2010_24_zcta510.zip";
filename _bcout "C:\Temp\tl_2010_24_zcta510.zip" recfm=n;
data _null_;
   length msg $ 384;
   rc=fcopy('_bcin', '_bcout');
   if rc=0 then
      put 'Copied _bcin to _bcout.';
   else do;
      msg=sysmsg();
      put rc= msg=;
   end;
run;

quit;&lt;/PRE&gt;
&lt;P&gt;I received the follwoing error: rc=5660215 msg=ERROR: Open failed for file _BCIN.&lt;/P&gt;
&lt;P&gt;What is the proper filenane ftp statement for the remote file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(alternative question: downloading US Census files must be a common task for mapping appications.&amp;nbsp; Are there any available macros out there that accomplishes this?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running SAS v9.4, TS1M4.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2017 17:33:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-zip-files-from-US-Census-FTP-site/m-p/337920#M76824</guid>
      <dc:creator>KAZ</dc:creator>
      <dc:date>2017-03-03T17:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Downloading zip files from US Census FTP site</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Downloading-zip-files-from-US-Census-FTP-site/m-p/337934#M76828</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename _bcin ftp 'tl_2010_24_zcta510.zip'
cd='/geo/tiger/TIGER2010/ZCTA5/2010'
host='ftp2.census.gov'
user='anonymous'
passive binary recfm=s;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and, if fcopy doesn't work you can use a very simple data step instead&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile _bcin;
file _bcout;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Mar 2017 18:01:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Downloading-zip-files-from-US-Census-FTP-site/m-p/337934#M76828</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2017-03-03T18:01:41Z</dc:date>
    </item>
  </channel>
</rss>

