<?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 Upload to FTP Using SAS Code in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203585#M37938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm generating data in SAS that I need to upload to an FTP site.&amp;nbsp; I am currently exporting the data into csv files and manually transferring them to the FTP site.&amp;nbsp; I keep searching for sample code to upload, but all I can seem to find are examples of reading data from an FTP site to use in SAS.&amp;nbsp; I want to do the opposite.&amp;nbsp; So, I have 2 question:&amp;nbsp; 1) Is it possible to export a SAS dataset into a csv file and upload it to an FTP site simultaneously, and 2) would DCREATE() work with this process to create a new folder on an FTP server?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Aug 2015 13:27:21 GMT</pubDate>
    <dc:creator>djbateman</dc:creator>
    <dc:date>2015-08-20T13:27:21Z</dc:date>
    <item>
      <title>Upload to FTP Using SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203585#M37938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm generating data in SAS that I need to upload to an FTP site.&amp;nbsp; I am currently exporting the data into csv files and manually transferring them to the FTP site.&amp;nbsp; I keep searching for sample code to upload, but all I can seem to find are examples of reading data from an FTP site to use in SAS.&amp;nbsp; I want to do the opposite.&amp;nbsp; So, I have 2 question:&amp;nbsp; 1) Is it possible to export a SAS dataset into a csv file and upload it to an FTP site simultaneously, and 2) would DCREATE() work with this process to create a new folder on an FTP server?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 13:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203585#M37938</guid>
      <dc:creator>djbateman</dc:creator>
      <dc:date>2015-08-20T13:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Upload to FTP Using SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203586#M37939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a lot of examples for sending files using FTP in the manual pages.&amp;nbsp; &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0v0ijxl1k6d4bn16cshtic7u4i3.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/63323/HTML/default/viewer.htm#p0v0ijxl1k6d4bn16cshtic7u4i3.htm"&gt;SAS(R) 9.3 Statements: Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As to making a directory look at the NEW option.&amp;nbsp; Or perhaps you could see if the FTP server on the target machine has a SITE command that will make a directory.&amp;nbsp; Look at the RCMD option in the on-line manual page linked above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 13:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203586#M37939</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-08-20T13:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Upload to FTP Using SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203587#M37940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use FILENAME FTP:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME ftpout FTP 'path_on_the_server' HOST='hostname' USER='username' PASS='password';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA _NULL_;&lt;/P&gt;&lt;P&gt;SET dataset;&lt;/P&gt;&lt;P&gt;FILE ftpout dlm=';';&lt;/P&gt;&lt;P&gt;PUT variable_list;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create a line with the column names, use a &lt;/P&gt;&lt;P&gt;IF _N_ = 1 THEN DO; PUT "variable1;variable2;...."; END;&lt;/P&gt;&lt;P&gt;block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To create a remote folder dynamically, you may need to experiment with the RCMD option of FILENAME FTP. DLCREATE() works only on the local file system (and anything that is mounted there).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 13:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203587#M37940</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-08-20T13:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Upload to FTP Using SAS Code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203588#M37941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%let user=xxxx;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%let pass=yyyy ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;%let host=zzzz;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;filename outdir ftp 'new_dir' dir new host="&amp;amp;host" user="&amp;amp;user" pass="&amp;amp;pass" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; set sashelp.class ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; file outdir('class.csv') dsd ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;&amp;nbsp; put (_all_) (:) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 12pt;"&gt;filename outdir clear ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 13:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Upload-to-FTP-Using-SAS-Code/m-p/203588#M37941</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-08-20T13:54:35Z</dc:date>
    </item>
  </channel>
</rss>

