<?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: A component Of...Is Not A Directory Error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430474#M106402</link>
    <description>&lt;P&gt;You cannot use a ftp:// style URI in a simple filename. Instead use the &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/a000178980.htm" target="_self"&gt;FILENAME, FTP Access Method&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;You find that in lines 541 and 542 of your log.&lt;/P&gt;
&lt;P&gt;You also have a problem with the SQL in lines 510 to 515. Mind that _n_ is a &lt;STRONG&gt;data step&lt;/STRONG&gt; variable and not present in proc sql selects, so the where condition is never true.&lt;/P&gt;
&lt;P&gt;Do this instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set Filenames_parse (obs=1);
string = trim(left(tranwrd("&amp;amp;tablename.",'_','-')||'-'||substr(put(dateinfo,8.0),1,4)||'-'||substr(put(dateinfo,8.0),5,2)||'-'||su
bstr(put(dateinfo,8.0),7,2)))||'.csv';
call symput('importfilename',string);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 24 Jan 2018 15:07:04 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-01-24T15:07:04Z</dc:date>
    <item>
      <title>A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430200#M106344</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a hard cord FTP link in my script, similar to below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ftp:\\username:password@server.com\folder\&amp;amp;importfilename&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received this error at the very end and I am not sure why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: A component of&lt;BR /&gt;C:\Users\sassupport\AppData\Local\Temp\ftp:\\username:password@server.com\folder\&amp;amp;importfilename.&lt;BR /&gt;is not a directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why do I receive this error? I have attached the bottom portion of the log in this message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your inputs.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 22:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430200#M106344</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-23T22:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430222#M106348</link>
      <description>&lt;P&gt;In your log there is also next mesage:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WARNING: Apparent symbolic reference IMPORTFILENAME not resolved.
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You use it in your FTP link:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ftp:\\username&lt;/SPAN&gt;&lt;IMG class="emoticon emoticon-smileytongue" src="https://communities.sas.com/i/smilies/16x16_smiley-tongue.png" border="0" alt="Smiley Tongue" title="Smiley Tongue" /&gt;&lt;SPAN&gt;assword@server.com\folder\&lt;STRONG&gt;&amp;amp;importfilename&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It should be predefined either by &lt;U&gt;%LET&lt;/U&gt; statement or by &lt;U&gt;%SYMPUT&lt;/U&gt; function or as a &lt;U&gt;macro argument&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 00:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430222#M106348</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-01-24T00:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430301#M106363</link>
      <description>&lt;P&gt;The statement(s) that cause(s) the error are further up in the log, part of a previous macro call.&lt;/P&gt;
&lt;P&gt;I guess you are trying to use a URI in a place where only a simple file name is expected, so the ftp:// is not recognized as what it is.&lt;/P&gt;
&lt;P&gt;Mind that SAS has a dedicated mechanism to access FTP sites, namely &lt;FONT face="courier new,courier"&gt;filename ftp&lt;/FONT&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 06:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430301#M106363</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-24T06:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430452#M106396</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached full log in this message, would you please take a look at it for me? Thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430452#M106396</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-24T14:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430453#M106397</link>
      <description>&lt;P&gt;Shmuel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My password contains&amp;nbsp;@. I am not sure if that cause the error. Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:37:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430453#M106397</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-24T14:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430474#M106402</link>
      <description>&lt;P&gt;You cannot use a ftp:// style URI in a simple filename. Instead use the &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/a000178980.htm" target="_self"&gt;FILENAME, FTP Access Method&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;You find that in lines 541 and 542 of your log.&lt;/P&gt;
&lt;P&gt;You also have a problem with the SQL in lines 510 to 515. Mind that _n_ is a &lt;STRONG&gt;data step&lt;/STRONG&gt; variable and not present in proc sql selects, so the where condition is never true.&lt;/P&gt;
&lt;P&gt;Do this instead:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set Filenames_parse (obs=1);
string = trim(left(tranwrd("&amp;amp;tablename.",'_','-')||'-'||substr(put(dateinfo,8.0),1,4)||'-'||substr(put(dateinfo,8.0),5,2)||'-'||su
bstr(put(dateinfo,8.0),7,2)))||'.csv';
call symput('importfilename',string);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jan 2018 15:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/430474#M106402</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-24T15:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431185#M106605</link>
      <description>&lt;P&gt;If you get problems with the PORT subcommand, use the PASSIVE option in the filename ftp statement.&lt;/P&gt;
&lt;P&gt;Standard FTP protocol turns the client into a server that listens (when eg the GET command is issued), and sends the port to the FTP server, which then opens the connection from its side. When firewalls are involved, that usually fails. PASSIVE means that all connections are initiated by the client to ports that the server listens on.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 06:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431185#M106605</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-26T06:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431415#M106718</link>
      <description>&lt;P&gt;Hi Kurt,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the passive option and I did not the error anymore. But I got "Statement is not valid or it is used out of proper order." error&amp;nbsp; and I think that has to do with the text in bold. I am not sure what is wrong with it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, I am very new to SAS and I just inherited this. I am trying to make this work so please be patient with me. I really appreciate of all your help so far. Thank you.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;filename c ftp 'translate_temp.csv' cd='Ampthink/' PASSIVE&lt;BR /&gt;user='ud4b2'&lt;BR /&gt;pass="M@amP"&lt;BR /&gt;host='sharefileftp.com'&lt;BR /&gt;recfm=v prompt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data WORK.retention ;&lt;BR /&gt;%let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;infile c delimiter=',' MISSOVER DSD lrecl=32767 firstobs=2;&lt;BR /&gt;&lt;STRONG&gt;&amp;amp;informatstring&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;amp;formatstring&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;input &amp;amp;typestring;&lt;/STRONG&gt;&lt;BR /&gt;if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable*/&lt;BR /&gt;run;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 19:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431415#M106718</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-26T19:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431436#M106726</link>
      <description>&lt;P&gt;I guess you need to put semicolons after each of the first two macro variables.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431436#M106726</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-26T20:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431444#M106730</link>
      <description>&lt;P&gt;Change 2nd step to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
data WORK.retention ;
infile c delimiter=',' MISSOVER DSD lrecl=32767 firstobs=2;
&amp;amp;informatstring;
&amp;amp;formatstring;
input &amp;amp;typestring;
if _ERROR_ then 
   call symputx('_EFIERR_',1); /* set ERROR detection macro variable*/
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In case of any error please post the log.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431444#M106730</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-01-26T20:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431449#M106732</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still get the same error and "Expecting a name." error. I have attached the log in this message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help again.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:43:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431449#M106732</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-26T20:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431462#M106733</link>
      <description>&lt;P&gt;You are using macro variables that have not been set. The "expecting a name" is the consequence of this.&lt;/P&gt;
&lt;P&gt;See this part of the log:&lt;/P&gt;
&lt;PRE&gt;38         input &amp;amp;typestring;
                 _
                 22
WARNING: Apparent symbolic reference TYPESTRING not resolved.
ERROR 180-322: Statement is not valid or it is used out of proper order.

ERROR 22-322: Expecting a name.  
&lt;/PRE&gt;
&lt;P&gt;&amp;amp;typestring has not been set, causing the WARNING. It's a WARNING and not an ERROR because sometimes you want to use a string that &lt;EM&gt;looks&lt;/EM&gt; like a macro variable call, but isn't.&lt;/P&gt;
&lt;P&gt;Since SAS expects a variable name as the next argument to the input statement, and the &lt;EM&gt;string&lt;/EM&gt; (now it is used as such) &amp;amp;typestring is not a valid SAS name, you get the ERROR.&lt;/P&gt;
&lt;P&gt;This also illustrates the importance of posting the &lt;EM&gt;complete&lt;/EM&gt; log of a failed step. SAS padawans often only see the last ERROR of a sequence of messages, where in fact the previous messages point to the real cause.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 07:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431462#M106733</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-29T07:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431817#M106853</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use the PASSIVE option and not I got this error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ERROR: Invalid Reply received for the PASV command.."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My syntax is as below, Is that the right place the PASSIVE option?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename a ftp '&amp;amp;importfilename.' cd='Ampthink/' PASSIVE&lt;BR /&gt;user='xxxxxx&lt;BR /&gt;pass="xxxxxx"&lt;BR /&gt;host='orlandomagic.sharefileftp.com'&lt;BR /&gt;recfm=v prompt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help again.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 15:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431817#M106853</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-29T15:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431818#M106854</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Mixer wrote:
&lt;P class="1517241176578"&gt;...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename a ftp '&amp;amp;importfilename.' cd='Ampthink/' PASSIVE&lt;BR /&gt;user='xxxxxx&lt;BR /&gt;pass="xxxxxx"&lt;BR /&gt;host='orlandomagic.sharefileftp.com'&lt;BR /&gt;recfm=v prompt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help again.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Macro variable references will not resolve inside of single quotes. So your FTP command is looking for a file whose name is literally &amp;amp;importfilename. Also make sure to match your quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename a ftp "&amp;amp;importfilename." cd='Ampthink/' PASSIVE
  user='xxxxxx'
  pass="xxxxxx"
  host='orlandomagic.sharefileftp.com'
  recfm=v prompt
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 15:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431818#M106854</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-29T15:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431853#M106867</link>
      <description>&lt;P&gt;@ Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your input. I was able to resolve the issue for some places. But I still get the error for below codes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Invalid Reply received for the PASV command.."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro get_filenames(location);
filename _dir_ "%bquote(&amp;amp;location.)";
data filenames(keep=memname);
  handle=dopen( '_dir_' );
  if handle &amp;gt; 0 then do;
    count=dnum(handle);
    do i=1 to count;
      memname=dread(handle,i);
      output filenames;
    end;
  end;
  rc=dclose(handle);
run;
filename _dir_ clear;
%mend;

*%get_filenames(\\192.168.103.2\tm\live_analytics); 
*%get_filenames(\\192.168.103.4\ftp\Ampthink);

filename ftpdir ftp 'Ampthink/' ls PASSIVE
user='xxxxxxxxxxxx'
   pass='Mxxxxxxxx'
   host='orlandomagic.sharefileftp.com'
   prompt;

%get_filenames("ftpdir"); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrap that ftpdir variable with double quotes and past it to get_locations macro but it does not work. Would you please take a look and let me know what's wrong with it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your&amp;nbsp; help again.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 16:49:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431853#M106867</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-29T16:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431862#M106875</link>
      <description>&lt;P&gt;If you have a firewall that prevents active mode, and a server that doesn't support passive mode, you're hosed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest using other ftp software to see if a connection can be made manually.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 17:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431862#M106875</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-29T17:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431970#M106909</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am keep getting the error "ERROR: Invalid Reply received for the PASV command.." for line 205 to 230, the&amp;nbsp;get_filenames marco. Would someone please take a look and let me know what wrong is in there. I tried to single and double quotes in few places but no help. I executed&amp;nbsp;that portion&amp;nbsp;in SAS EG and got no error. I am sure why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help again.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 14:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/431970#M106909</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-30T14:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/432068#M106937</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138080"&gt;@Mixer&lt;/a&gt;&amp;nbsp;- we are human, not computers. You have&amp;nbsp;attached the source - better send that &lt;STRONG&gt;part of the log&lt;/STRONG&gt; containing&lt;/P&gt;
&lt;P&gt;the &lt;STRONG&gt;step&lt;/STRONG&gt; and the &lt;STRONG&gt;error&lt;/STRONG&gt; message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a&amp;nbsp; look at the documentation in the next link:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=p0v0ijxl1k6d4bn16cshtic7u4i3.htm&amp;amp;locale=en" target="_self"&gt;http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=lestmtsglobal&amp;amp;docsetTarget=p0v0ijxl1k6d4bn16cshtic7u4i3.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can google for "sas online documentation &amp;lt;strings to search&amp;gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Beyond please describe your sas installation as sas version, client/server, OS - that might help the forum to point at the root problem.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 06:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/432068#M106937</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-01-30T06:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/432196#M107006</link>
      <description>&lt;P&gt;Hi Shmuel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen that document about FTP access and it is what I used to learn how to access file and folder on FTP server but thank you for the link and sorry for the lack of information here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attachment is the full log file which shows steps and error. The error shows at line 2156 as "ERROR: Invalid Reply received for the PASV command.."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS EG 9.4 M4 on Windows 10.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2018 14:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/432196#M107006</guid>
      <dc:creator>Mixer</dc:creator>
      <dc:date>2018-01-30T14:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: A component Of...Is Not A Directory Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/432306#M107057</link>
      <description>&lt;P&gt;Next is part from the log, including the error message and the preceeding lines:&lt;/P&gt;
&lt;PRE&gt;NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

WARNING: Apparent symbolic reference IMPORTFILENAME not resolved.
NOTE: Variable "c" was given a default length of 32767 as the result of a function call.  If you do not like this, please use a 
      LENGTH statement to declare "c".

NOTE: 220 ftp-ec2.sharefileftp.com FTP Server Ready
ERROR: Invalid Reply received for the PASV command..&lt;/PRE&gt;
&lt;P&gt;pay attention to the warning:&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Apparent symbolic reference IMPORTFILENAME not resolved&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now I have searched in your script where is this macro variable created or used and found next lines:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select trim(left(tranwrd("&amp;amp;tablename.",'_','-')||'-'||substr(put(dateinfo,8.0),1,4)||'-'||substr(put(dateinfo,8.0),5,2)||'-'||substr(put(dateinfo,8.0),7,2)))||'.csv'
      into :importfilename
      from Filenames_parse
where _n_ = 1 ;
quit ;&lt;BR /&gt;&lt;BR /&gt;......&lt;BR /&gt;filename a ftp "&amp;amp;importfilename." cd='Ampthink/' PASSIVE&lt;BR /&gt;   host="&amp;amp;sharefile_host"&lt;BR /&gt;   user="&amp;amp;sharefile_ftp_user"&lt;BR /&gt;   pass="&amp;amp;sharefile_ftp_pw"&lt;BR /&gt;   recfm=v prompt;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is _N_ a variable in the input file&amp;nbsp;&lt;CODE class=" language-sas"&gt;Filenames_parse ?&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;_N_ is a datastep automatic variable, unknown by SQL .&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;You may need convert that sql into a datastep. Try use obs=1, as in:&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select trim(left(tranwrd("&amp;amp;tablename.",'_','-')||'-'||substr(put(dateinfo,8.0),1,4)||'-'||substr(put(dateinfo,8.0),5,2)||'-'||substr(put(dateinfo,8.0),7,2)))||'.csv'
      into :importfilename
      from Filenames_parse(obs=1)
  ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jan 2018 16:11:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/A-component-Of-Is-Not-A-Directory-Error/m-p/432306#M107057</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2018-01-30T16:11:29Z</dc:date>
    </item>
  </channel>
</rss>

