<?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: How to save an XLSX file to an FTP server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740363#M231264</link>
    <description>1. Export your data set to your XLSX file to somewhere you have access. If you don't need to keep it, the work library is a good location.&lt;BR /&gt;2. Move the file using an appropriate method, FCOPY() but you probably want to use something more similar to this&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Move-files-between-server-using-SFTP/td-p/350673" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Move-files-between-server-using-SFTP/td-p/350673&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 11 May 2021 03:54:18 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-05-11T03:54:18Z</dc:date>
    <item>
      <title>How to save an XLSX file to an FTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740338#M231250</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to use SAS to FTP an XLSX file that I create via SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a SAS code that I use to prepare a dataset that I then save and excel (XLSX) file. I need to FTP these file over every week, I want to set up an automated process that runs the data every week (this I already have set up) and in the automated process I would like to use SAS to FTP the XLSX file it prepares.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the host, user and pass. There is a folder (mailbox path) as well that I would like to use.&lt;/P&gt;&lt;P&gt;I tried using the below code that I found in the forum (the user, host, pass is censored, so is the 'mailboxpath') but the below didn't work. There was no log error either for me to troubleshoot the error.&lt;/P&gt;&lt;P&gt;Suggestions on what other code I can use (if the below code is not the way to go)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%let user=XXXX;
%let host=YYYY;
%let pass=ZZZZZ;
filename outdir ftp 'mailboxpath' dir new host="&amp;amp;host" user="&amp;amp;user" pass="&amp;amp;pass" ;

data _null_;
  set X.data ;
  file outdir('C:\Users\name\toexport.xlsx') xlsx ;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 01:32:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740338#M231250</guid>
      <dc:creator>sas_student1</dc:creator>
      <dc:date>2021-05-11T01:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to save an XLSX file to an FTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740347#M231252</link>
      <description>&lt;P&gt;I thought you want to move the XLSX file.&amp;nbsp; Your data step is reading a SAS dataset and trying to write a text file.&amp;nbsp; Note that the FILE statement does not support the XLSX engine.&amp;nbsp; The XLSX engine only works when defining a LIBNAME.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the name of the existing XLSX file on the SAS host that you want to move to the remote host using FTP protocol?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you really want to use the FTP protocol?&amp;nbsp; Most hosts now require you to use the more secure SFTP protocol instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 02:42:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740347#M231252</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-11T02:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to save an XLSX file to an FTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740350#M231254</link>
      <description>&lt;P&gt;Please check if you are able to access the site successfully via FTP.&lt;BR /&gt;You should be able to login and get the root directory with the following code.&lt;/P&gt;
&lt;P&gt;If you are using a router, don't forget to specify passive mode.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename dir ftp '' ls user="&amp;amp;user"  host="&amp;amp;host"  pass="&amp;amp;pass";
data _null_;
   infile dir;
   input;
   put _INFILE_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you simply want to upload the file to ftp, you can use command prompt or powershell script to upload and run it with x command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 02:53:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740350#M231254</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-05-11T02:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to save an XLSX file to an FTP server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740363#M231264</link>
      <description>1. Export your data set to your XLSX file to somewhere you have access. If you don't need to keep it, the work library is a good location.&lt;BR /&gt;2. Move the file using an appropriate method, FCOPY() but you probably want to use something more similar to this&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Move-files-between-server-using-SFTP/td-p/350673" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Move-files-between-server-using-SFTP/td-p/350673&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 May 2021 03:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-save-an-XLSX-file-to-an-FTP-server/m-p/740363#M231264</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-05-11T03:54:18Z</dc:date>
    </item>
  </channel>
</rss>

