<?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 do I import file/folder details via FTP in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645489#M192981</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I'd like to bring in modified date&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Look at the foptnum, foptname and finfo functions.&lt;/P&gt;
&lt;P&gt;I doubt they return anything with FTP but who knows. I am curious now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;is it possible to import folder names to create literal file_paths from the directory?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Unsure what this means&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 May 2020 00:47:23 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2020-05-06T00:47:23Z</dc:date>
    <item>
      <title>How do I import file/folder details via FTP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645279#M192872</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am working through SAS EG 7, trying to bring in a list of filenames and associated details from an FTP directory. The following code brings in the filnmes (all are excel) but I'd like to bring in modified date as seen in windows explorer as well. the end goal is to produce a recurring dataset with only filenames newly added.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data all_files;&lt;/P&gt;&lt;P&gt;infile ftp_dir;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;file_name = _INFILE_;&lt;/P&gt;&lt;P&gt;file_path = strip(file_name);&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;if find(file_name,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;".xlsx"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) &amp;gt; &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; and find(file_name,&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;"~"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;) = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as a tangent question... is it possible to import folder names to create literal file_paths from the directory?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any and all suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 12:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645279#M192872</guid>
      <dc:creator>Ksmit</dc:creator>
      <dc:date>2020-05-05T12:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import file/folder details via FTP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645489#M192981</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I'd like to bring in modified date&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Look at the foptnum, foptname and finfo functions.&lt;/P&gt;
&lt;P&gt;I doubt they return anything with FTP but who knows. I am curious now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;nbsp;is it possible to import folder names to create literal file_paths from the directory?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Unsure what this means&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 00:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645489#M192981</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-06T00:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import file/folder details via FTP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645642#M193026</link>
      <description>Thanks for the suggestion. Looking into those functions now.&lt;BR /&gt;&lt;BR /&gt;Realted to the second ask. Was wondering if there was a function to write the file folder path as it appears in windows directory into sas data field. (i.e., c:\ my_folder\sub_folder\filename.xlsx would return a variable of my_folder\sub_folder\)&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 06 May 2020 15:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645642#M193026</guid>
      <dc:creator>Ksmit</dc:creator>
      <dc:date>2020-05-06T15:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import file/folder details via FTP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645743#M193057</link>
      <description>&lt;P&gt;Function finfo() with information-item=1 returns the full file path. You can parse that string any way you like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2020 22:01:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/645743#M193057</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-06T22:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import file/folder details via FTP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/646741#M193501</link>
      <description>This got me there. Thanks Chris.</description>
      <pubDate>Mon, 11 May 2020 15:00:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/646741#M193501</guid>
      <dc:creator>Ksmit</dc:creator>
      <dc:date>2020-05-11T15:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I import file/folder details via FTP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/646936#M193567</link>
      <description>&lt;P&gt;Would you mind detailing here what the FTP filename returns for the different values of&lt;EM&gt; information-item&lt;/EM&gt; ?&lt;/P&gt;
&lt;P&gt;Maybe run this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
 filename FREF ftp ... ;

%macro test;                                                                                                                            
 %let fid=%sysfunc(fopen(FREF));                                                                                                      
 %let infonum=%sysfunc(foptnum(&amp;amp;fid));                                                                                                  
  %do j=1 %to &amp;amp;infonum;                                                                                                                 
   %let name=%sysfunc(foptname(&amp;amp;fid, &amp;amp;j));                                                                                              
   %let value=%sysfunc(finfo(&amp;amp;fid, &amp;amp;name));                                                                                             
   %put File attribute &amp;amp;name equals &amp;amp;value;                                                                                             
  %end;                                                                                                                                 
 %let rc=%sysfunc(fclose(&amp;amp;fid));                                                                                                        
 %let rc=%sysfunc(filename(filrf));                                                                                                     
%mend test;                                                                                                                             
                                                                                                                                        
%test &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 02:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-import-file-folder-details-via-FTP/m-p/646936#M193567</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-05-12T02:41:00Z</dc:date>
    </item>
  </channel>
</rss>

