<?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: Create a csv file in SFTP server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/444942#M111445</link>
    <description>&lt;P&gt;This is an alternate solution:&lt;/P&gt;&lt;P&gt;If you are trying to have your files in SFTP server, but in SAS if you have only access to Local then use WinSCP to drag and drop files from local machine to your SFTP.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Mar 2018 21:17:55 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-03-12T21:17:55Z</dc:date>
    <item>
      <title>Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315493#M68834</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to create one of the sas datset in SFTP server in CSV format.I tried below test code to create file in SFTP server,but i could not connect to FTP server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also tried to connect to SFTP with libname statement but even that not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILENAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; target&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SFTP&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"/xx/test.csv"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;HOST&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'xx-xx.xx.xx.com'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DEBUG&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_null_&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; target;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;do&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; i=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;to&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;put&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; i=;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;end&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;Please help me to get it done in two ways with filename and libname.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks in advance&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;regards,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;ravi&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315493#M68834</guid>
      <dc:creator>rawindar</dc:creator>
      <dc:date>2016-11-30T12:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315495#M68836</link>
      <description>&lt;P&gt;To use filename sftp, password-free authentication needs to be in place. Make sure that you have public/private key authentication set up for the userID's involved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also post the log for steps that don't work. Without the log, everything else is guesswork.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315495#M68836</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-30T12:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315496#M68837</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;
&lt;P&gt;Thans for your quick response.I did not understand this public and private keys.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But i have username and password for this SFTP server.I read that we should not use password for SFTP server so i have run only with username.&lt;/P&gt;
&lt;P&gt;Please find the below log file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;22 GOPTIONS ACCESSIBLE;&lt;/P&gt;
&lt;P&gt;23 FILENAME target1 SFTP USER='xx' HOST = 'xx.xx.xxx.com' DEBUG;&lt;/P&gt;
&lt;P&gt;24 data _null_;&lt;/P&gt;
&lt;P&gt;25 file target1;&lt;/P&gt;
&lt;P&gt;26 do i=1 to 10;&lt;/P&gt;
&lt;P&gt;27 put i=;&lt;/P&gt;
&lt;P&gt;28 end;&lt;/P&gt;
&lt;P&gt;29 run;&lt;/P&gt;
&lt;P&gt;NOTE: Connecting to xxxx-xx.xxt.xx.com...&lt;/P&gt;
&lt;P&gt;NOTE: The file TARGET1 is:&lt;/P&gt;
&lt;P&gt;Filename&lt;/P&gt;
&lt;P&gt;NOTE: ssh: connect to host xxxx.xx.xxt.com port 22: Connection timed out&lt;/P&gt;
&lt;P&gt;NOTE: 10 records were written to the file TARGET1.&lt;/P&gt;
&lt;P&gt;The minimum record length was 3.&lt;/P&gt;
&lt;P&gt;The maximum record length was 4.&lt;/P&gt;
&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;
&lt;P&gt;real time 1:03.21&lt;/P&gt;
&lt;P&gt;cpu time 0.02 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:26:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315496#M68837</guid>
      <dc:creator>rawindar</dc:creator>
      <dc:date>2016-11-30T12:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315499#M68838</link>
      <description>&lt;P&gt;You have to set up password-free authentication, or SFTP won't work from SAS.&lt;/P&gt;
&lt;P&gt;Do a google search for&lt;/P&gt;
&lt;P&gt;ssh key-based authentication&lt;/P&gt;
&lt;P&gt;and you will find all necessary information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2016 12:30:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/315499#M68838</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-30T12:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/439889#M109800</link>
      <description>&lt;P&gt;Hi I have done with key pair setup and &amp;nbsp;I have to read the data iin CSV file from sub directories. Please suggest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename my data sftp "/Dir/RPTS/qtr/&amp;amp;CSV_file"&lt;BR /&gt;host="hostname" user="username";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Directory or file doesnot exist&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 23:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/439889#M109800</guid>
      <dc:creator>SAS_PA1</dc:creator>
      <dc:date>2018-02-23T23:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/444922#M111439</link>
      <description>&lt;P&gt;Do we have any alternate method in SAS instead of USing SFTP in SAS&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;filename my data sftp "/Dir/RPTS/qtr/&amp;amp;CSV_file"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;host="hostname" user="username";&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 20:01:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/444922#M111439</guid>
      <dc:creator>SAS_PA1</dc:creator>
      <dc:date>2018-03-12T20:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/444942#M111445</link>
      <description>&lt;P&gt;This is an alternate solution:&lt;/P&gt;&lt;P&gt;If you are trying to have your files in SFTP server, but in SAS if you have only access to Local then use WinSCP to drag and drop files from local machine to your SFTP.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 21:17:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/444942#M111445</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-03-12T21:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: Create a csv file in SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/444976#M111457</link>
      <description>On Windows the value in the host= option for the sftp engine is used to lookup the profile name inside the psftp deployment. Its not the host name of the sftp server. This often trips folks up.</description>
      <pubDate>Mon, 12 Mar 2018 23:15:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-csv-file-in-SFTP-server/m-p/444976#M111457</guid>
      <dc:creator>SimonDawson</dc:creator>
      <dc:date>2018-03-12T23:15:10Z</dc:date>
    </item>
  </channel>
</rss>

