<?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: export dataset to ftp in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569547#M160516</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161887"&gt;@pbrookha&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mywk=%sysfunc(getoption(WORK));
%let target_folder=/###/####/; 
%let source_folder=/sas/shared/#####/;
%let source=ARRIVALS.xls; 

data _null_;
            file "&amp;amp;mywk/get_aff.cmd";
            put "user #####";
            put "cd &amp;amp;target_folder." ;
            put "lcd &amp;amp;source_folder" ;
            put "put &amp;amp;source.";
            put "ls -l";
            put "quit";

filename doftp pipe "sftp  -v  sfs.company.com  &amp;lt; &amp;amp;mywk/get_aff.cmd";
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The corresponding log if here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 230 User ###### logged in.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 ON&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 OPTS command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 OPTS: parameters are incorrect&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF-8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 OPTS: parameters are incorrect&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PASV&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 227 Entering Passive Mode (######)&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; TYPE A&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 TYPE command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; CWD /Distribution/WVR_Associate_Sites/OVI&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 250 CWD command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PWD&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 257 "/####/#####/" is current directory&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PBSZ 0&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PBSZ command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PROT P&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PROT command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; RETR /sas/shared/####/ARRIVALS.xls&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 550 RETR failed: File could not be found&lt;BR /&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;ERROR: Physical file does not exist, /sas/shared/####/ARRIVALS.xls.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That line in red is pretty much it.&lt;/P&gt;
&lt;P&gt;I would suggest that your SOURCE_FOLDER macro variable should be a fully qualified path from a disk mount point. The default starting with /sas/ probably meant the FTP program was using its default execution location and that does not have a subfolder named /sas/.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2019 17:39:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-06-27T17:39:27Z</dc:date>
    <item>
      <title>export dataset to ftp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569499#M160497</link>
      <description>&lt;P&gt;I am having a difficult time figuring out how to export a SAS dataset into a specific directory on an sfs site. I am currently attempting to use filename ftp logic but am unsuccessful.&lt;BR /&gt;&lt;BR /&gt;Does anyone have an example of successful logic?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 15:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569499#M160497</guid>
      <dc:creator>pbrookha</dc:creator>
      <dc:date>2019-06-27T15:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: export dataset to ftp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569506#M160501</link>
      <description>&lt;P&gt;Can you share the code and messages from the log for an attempt? XXXX out such sensitive things as user and password, if used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Unsuccessful"&amp;nbsp;is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to just use an X command or an operating system command to send things using your FTP program and a FILENAME has a bit more overhead involved than just sending a file.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 15:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569506#M160501</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-27T15:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: export dataset to ftp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569514#M160503</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mywk=%sysfunc(getoption(WORK));
%let target_folder=/###/####/; 
%let source_folder=/sas/shared/#####/;
%let source=ARRIVALS.xls; 

data _null_;
            file "&amp;amp;mywk/get_aff.cmd";
            put "user #####";
            put "cd &amp;amp;target_folder." ;
            put "lcd &amp;amp;source_folder" ;
            put "put &amp;amp;source.";
            put "ls -l";
            put "quit";

filename doftp pipe "sftp  -v  sfs.company.com  &amp;lt; &amp;amp;mywk/get_aff.cmd";
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The corresponding log if here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 230 User ###### logged in.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 ON&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 OPTS command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 OPTS: parameters are incorrect&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF-8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 OPTS: parameters are incorrect&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PASV&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 227 Entering Passive Mode (######)&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; TYPE A&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 TYPE command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; CWD /Distribution/WVR_Associate_Sites/OVI&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 250 CWD command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PWD&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 257 "/####/#####/" is current directory&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PBSZ 0&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PBSZ command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PROT P&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PROT command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; RETR /sas/shared/####/ARRIVALS.xls&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 550 RETR failed: File could not be found&lt;BR /&gt;ERROR: Physical file does not exist, /sas/shared/####/ARRIVALS.xls.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569514#M160503</guid>
      <dc:creator>pbrookha</dc:creator>
      <dc:date>2019-06-27T16:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: export dataset to ftp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569515#M160504</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename Table ftp '/sas/shared/#####/ARRIVALS.xls' new cd=&amp;amp;directory 
user="#####" pass="#####" host=&amp;amp;host AUTHTLS recfm=v debug passive; 

data WORK.ARRIVALS;
infile Table truncover;
input filename $char1000.;
put _infile_;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have also tried this code after reading up on some forums from SAS and this ran successful but did not produce any results or log notes.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569515#M160504</guid>
      <dc:creator>pbrookha</dc:creator>
      <dc:date>2019-06-27T16:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: export dataset to ftp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569520#M160507</link>
      <description>&lt;P&gt;This data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WORK.ARRIVALS;
infile Table truncover;
input filename $char1000.;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;tries to read data from the ftp file reference, store it in variable filename in dataset arrivals, and also writes the contents of each input line to the SAS log.&lt;/P&gt;
&lt;P&gt;Since fileref table refers to an Excel file, this won't do you any good, since Excel files are not text files.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 16:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569520#M160507</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-27T16:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: export dataset to ftp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569547#M160516</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161887"&gt;@pbrookha&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mywk=%sysfunc(getoption(WORK));
%let target_folder=/###/####/; 
%let source_folder=/sas/shared/#####/;
%let source=ARRIVALS.xls; 

data _null_;
            file "&amp;amp;mywk/get_aff.cmd";
            put "user #####";
            put "cd &amp;amp;target_folder." ;
            put "lcd &amp;amp;source_folder" ;
            put "put &amp;amp;source.";
            put "ls -l";
            put "quit";

filename doftp pipe "sftp  -v  sfs.company.com  &amp;lt; &amp;amp;mywk/get_aff.cmd";
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The corresponding log if here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 230 User ###### logged in.&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 ON&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 OPTS command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 OPTS: parameters are incorrect&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; OPTS UTF-8 NLST&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 501 OPTS: parameters are incorrect&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PASV&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 227 Entering Passive Mode (######)&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; TYPE A&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 TYPE command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; CWD /Distribution/WVR_Associate_Sites/OVI&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 250 CWD command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PWD&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 257 "/####/#####/" is current directory&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PBSZ 0&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PBSZ command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; PROT P&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 200 PROT command successful&lt;BR /&gt;NOTE: &amp;gt;&amp;gt;&amp;gt; RETR /sas/shared/####/ARRIVALS.xls&lt;BR /&gt;NOTE: &amp;lt;&amp;lt;&amp;lt; 550 RETR failed: File could not be found&lt;BR /&gt;&lt;FONT size="4"&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;ERROR: Physical file does not exist, /sas/shared/####/ARRIVALS.xls.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That line in red is pretty much it.&lt;/P&gt;
&lt;P&gt;I would suggest that your SOURCE_FOLDER macro variable should be a fully qualified path from a disk mount point. The default starting with /sas/ probably meant the FTP program was using its default execution location and that does not have a subfolder named /sas/.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 17:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/export-dataset-to-ftp/m-p/569547#M160516</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-27T17:39:27Z</dc:date>
    </item>
  </channel>
</rss>

