<?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: Listing a file type for all folders and sub-folder in UNIX in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Listing-a-file-type-for-all-folders-and-sub-folder-in-UNIX/m-p/676528#M204011</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Filename filelist pipe "ls -R /temp/"; 
                                                                                   
   Data _null_;                                        
     Infile filelist truncover;
     Input filename $100.;
     Put filename=;
   Run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;ls is the equivalent to DIR from Windows:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://linuxcommand.org/lc3_man_pages/ls1.html" target="_blank"&gt;http://linuxcommand.org/lc3_man_pages/ls1.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's also a macro here that does this using pure SAS functions if you do not have PIPE or X command access.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/listing-all-files-within-a-directory-and-subdirectories/td-p/332432" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/listing-all-files-within-a-directory-and-subdirectories/td-p/332432&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/7900"&gt;@SAShole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm looking for the UNIX equivalent of this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; Filename filelist pipe "dir /b /s c:\temp\*.sas"; 
                                                                                   
   Data _null_;                                        
     Infile filelist truncover;
     Input filename $100.;
     Put filename=;
   Run; &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Aug 2020 16:08:27 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-08-13T16:08:27Z</dc:date>
    <item>
      <title>Listing a file type for all folders and sub-folder in UNIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Listing-a-file-type-for-all-folders-and-sub-folder-in-UNIX/m-p/676525#M204010</link>
      <description>&lt;P&gt;I'm looking for the UNIX equivalent of this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; Filename filelist pipe "dir /b /s c:\temp\*.sas"; 
                                                                                   
   Data _null_;                                        
     Infile filelist truncover;
     Input filename $100.;
     Put filename=;
   Run; &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 16:03:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Listing-a-file-type-for-all-folders-and-sub-folder-in-UNIX/m-p/676525#M204010</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2020-08-13T16:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Listing a file type for all folders and sub-folder in UNIX</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Listing-a-file-type-for-all-folders-and-sub-folder-in-UNIX/m-p/676528#M204011</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Filename filelist pipe "ls -R /temp/"; 
                                                                                   
   Data _null_;                                        
     Infile filelist truncover;
     Input filename $100.;
     Put filename=;
   Run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;ls is the equivalent to DIR from Windows:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://linuxcommand.org/lc3_man_pages/ls1.html" target="_blank"&gt;http://linuxcommand.org/lc3_man_pages/ls1.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's also a macro here that does this using pure SAS functions if you do not have PIPE or X command access.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/listing-all-files-within-a-directory-and-subdirectories/td-p/332432" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/listing-all-files-within-a-directory-and-subdirectories/td-p/332432&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/7900"&gt;@SAShole&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm looking for the UNIX equivalent of this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; Filename filelist pipe "dir /b /s c:\temp\*.sas"; 
                                                                                   
   Data _null_;                                        
     Infile filelist truncover;
     Input filename $100.;
     Put filename=;
   Run; &lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Aug 2020 16:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Listing-a-file-type-for-all-folders-and-sub-folder-in-UNIX/m-p/676528#M204011</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-13T16:08:27Z</dc:date>
    </item>
  </channel>
</rss>

