<?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: SFTP server - import csv file in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/865398#M42594</link>
    <description>&lt;P&gt;Please post the complete (all code and messages) log of the code you used by copy/pasting it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Mar 2023 10:28:02 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2023-03-21T10:28:02Z</dc:date>
    <item>
      <title>SFTP server - import csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864915#M42580</link>
      <description>&lt;P&gt;Hello, how can i import csv file from table from database to sftp server? For example i have this information and need to import csv file there:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Username: Pandas&lt;/P&gt;&lt;P&gt;Host: 37.9.169.9&lt;/P&gt;&lt;P&gt;Password: XXX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 16:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864915#M42580</guid>
      <dc:creator>Pato485</dc:creator>
      <dc:date>2023-03-17T16:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP server - import csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864919#M42581</link>
      <description>&lt;P&gt;Your description seems to have left out a number of steps in the data flow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you saying you have a CSV file that can be accessed via SFTP?&amp;nbsp; Can you access the file using normal SFTP commands or tools?&lt;/P&gt;
&lt;P&gt;So the first step is get a fileref created using the SFTP engine.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename CSV sftp ..... ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can test if it is working by trying to read the file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  infile csv obs=5;
  input;
  list;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once that works then to make a dataset just write a data step that reads the file.&lt;/P&gt;
&lt;P&gt;So something like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile csv dsd firstobs=2 truncover;
  length var1 8 var2 $30 .... varlast 8 ;
  informat var10 date.;
  format var10 date9.;
  input var1 -- varliast;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to ask SAS to make a guess at how to read the file by using PROC IMPORT then you might need to first copy the file to a local file.&amp;nbsp; I am not sure if PROC IMPORT can handle reading a file that is using the SFTP engine.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 16:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864919#M42581</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-17T16:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP server - import csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864922#M42582</link>
      <description>&lt;P&gt;thanks for information, i dont have csv file, i have table in database and need to transform it to csv and send it to to sftp server.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 16:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864922#M42582</guid>
      <dc:creator>Pato485</dc:creator>
      <dc:date>2023-03-17T16:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP server - import csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864935#M42583</link>
      <description>&lt;P&gt;So the goal is to EXPORT data to the SFTP server, not IMPORT data from the SFTP server.&lt;/P&gt;
&lt;P&gt;But I am also not clear what you mean by a "table" in a "database".&amp;nbsp; Are you talking about a SAS dataset?&amp;nbsp; Or are you connecting your SAS session to some external database system (such as Oracle or Redshift) and you want to extract the data from that database and create a CSV file version of the data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example 3 in the documentation shows how to write a file to an SFTP server.&amp;nbsp;&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0xln1fiwsr340n1xxf4mkmfxp6f.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0xln1fiwsr340n1xxf4mkmfxp6f.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create a CSV from a dataset you could use a simple data step, especially simple if you don't need to write a header line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set have;
  file csv dsd ;
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could use PROC EXPORT to write a CSV file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the data is coming from an external database and you have made a libref that points to the database schema you can treat a "table" in that database as if it was a SAS dataset.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 17:16:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/864935#M42583</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-17T17:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP server - import csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/865385#M42593</link>
      <description>so how can i program it if i have a table work.DUP and need to import it as csv to sftp server with this info: Username: Pandas&lt;BR /&gt;&lt;BR /&gt;Host: 37.9.169.9&lt;BR /&gt;&lt;BR /&gt;Password: XXX&lt;BR /&gt;&lt;BR /&gt;I tried, but not working</description>
      <pubDate>Tue, 21 Mar 2023 08:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/865385#M42593</guid>
      <dc:creator>Pato485</dc:creator>
      <dc:date>2023-03-21T08:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: SFTP server - import csv file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/865398#M42594</link>
      <description>&lt;P&gt;Please post the complete (all code and messages) log of the code you used by copy/pasting it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2023 10:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SFTP-server-import-csv-file/m-p/865398#M42594</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-21T10:28:02Z</dc:date>
    </item>
  </channel>
</rss>

