<?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: Automate file transfer from SFTP server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651681#M195556</link>
    <description>&lt;P&gt;Before you even start using SAS get your SFTP command right to only select the files you're after. There will be a lot of examples when Googling the moment you take SAS out of the picture.&lt;/P&gt;
&lt;P&gt;Once you've got the SFTP command as needed you then can call it from within SAS using Filename Pipe.&lt;/P&gt;</description>
    <pubDate>Fri, 29 May 2020 10:22:42 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-05-29T10:22:42Z</dc:date>
    <item>
      <title>Automate file transfer from SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651003#M195264</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to transfer some files from SFTP server to SAS server on daily basis based on the SFTP date and time.&lt;/P&gt;&lt;P&gt;For example i need to transfer all the files for date 14th May or 17th May.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please help how i can access the SFTP date time from SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With "mget" i can pull all the file available in SFTP but i want to pull the file only for the specific day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 07:56:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651003#M195264</guid>
      <dc:creator>Shahrukhh_Khan</dc:creator>
      <dc:date>2020-05-27T07:56:10Z</dc:date>
    </item>
    <item>
      <title>Re: Automate file transfer from SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651399#M195446</link>
      <description>&lt;P&gt;You should be able to use the DIR option to get a listing of files in the folder. You could then parse that listing to determine which files have the dates you want and "get" them by name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsglobal&amp;amp;docsetTarget=p0xln1fiwsr340n1xxf4mkmfxp6f.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=lestmtsglobal&amp;amp;docsetTarget=p0xln1fiwsr340n1xxf4mkmfxp6f.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 May 2020 14:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651399#M195446</guid>
      <dc:creator>JasonDiVirgilio</dc:creator>
      <dc:date>2020-05-28T14:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Automate file transfer from SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651646#M195540</link>
      <description>Thanks Jason for your reply.&lt;BR /&gt;&lt;BR /&gt;I am not familiar with unix command.&lt;BR /&gt;&lt;BR /&gt;Could you please give sample code related to DIR command so that i can relate it to my code and fetch the file name from SFTP server based on the date.&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance.</description>
      <pubDate>Fri, 29 May 2020 07:40:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651646#M195540</guid>
      <dc:creator>Shahrukhh_Khan</dc:creator>
      <dc:date>2020-05-29T07:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Automate file transfer from SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651681#M195556</link>
      <description>&lt;P&gt;Before you even start using SAS get your SFTP command right to only select the files you're after. There will be a lot of examples when Googling the moment you take SAS out of the picture.&lt;/P&gt;
&lt;P&gt;Once you've got the SFTP command as needed you then can call it from within SAS using Filename Pipe.&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2020 10:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651681#M195556</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-05-29T10:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Automate file transfer from SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651869#M195613</link>
      <description>&lt;H3 class="xisDoc-title"&gt;Refer to the link to SAS Documentation I included. Example 4 uses the DIR option to the filename statement when using SFTP. It gives you a directory listing as output which you can then parse to figure out what files you want to include.&lt;/H3&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 id="n1pptvj9ccv4yqn17er8dm5cs7ac" class="xisDoc-title"&gt;Example 4: Reading Files from a Directory on the Remote Host&lt;/H3&gt;
&lt;P class="xisDoc-paragraph"&gt;This example reads the files&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="xisDoc-variableValue"&gt;test.dat&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="xisDoc-variableValue"&gt;test2.dat&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from a directory on the remote host.&lt;/P&gt;
&lt;DIV id="p10ikcq9z3tdlmn1ivpr12ni42hf" class="xisDoc-codeBlock"&gt;
&lt;DIV class="xisDoc-codeBlockCode"&gt;
&lt;DIV class="hc-code-block ng-isolate-scope"&gt;&lt;BUTTON class="btn btn-default btn-sm copy-btn code" title="Copy to clipboard" aria-label="Copy to clipboard"&gt;&lt;I class="fa fa-copy"&gt;&lt;/I&gt;&lt;/BUTTON&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="xis-copyToClipboardBtn"&gt;
&lt;PRE class="xisDoc-code"&gt;&lt;CODE&gt;filename infile sftp '/users/xxxx/' host="unixhost1" dir;
data _null_;
   infile infile(test.dat) truncover;
   input a $25.;
   infile infile(test2.dat) truncover;
   input b $25.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 May 2020 20:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/651869#M195613</guid>
      <dc:creator>JasonDiVirgilio</dc:creator>
      <dc:date>2020-05-29T20:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automate file transfer from SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/652152#M195768</link>
      <description>Thanks Jason,&lt;BR /&gt;&lt;BR /&gt;I will try DIR option in my code.</description>
      <pubDate>Mon, 01 Jun 2020 07:02:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/652152#M195768</guid>
      <dc:creator>Shahrukhh_Khan</dc:creator>
      <dc:date>2020-06-01T07:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Automate file transfer from SFTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/652153#M195769</link>
      <description>Thanks Patrick for your reply.</description>
      <pubDate>Mon, 01 Jun 2020 07:03:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-file-transfer-from-SFTP-server/m-p/652153#M195769</guid>
      <dc:creator>Shahrukhh_Khan</dc:creator>
      <dc:date>2020-06-01T07:03:02Z</dc:date>
    </item>
  </channel>
</rss>

