<?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 read all .txt.gz filenames from a folder in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580464#M164899</link>
    <description>&lt;P&gt;Thank you Tom! You are genius!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2019 06:24:00 GMT</pubDate>
    <dc:creator>KinjalPatel</dc:creator>
    <dc:date>2019-08-12T06:24:00Z</dc:date>
    <item>
      <title>How to read all .txt.gz filenames from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580406#M164870</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have multiple text files in zipped format in a folder. I want to get all filenames in one SAS dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;H:\SAS\Project\ABC_20190811.txt.gz&lt;/P&gt;
&lt;P&gt;H:\SAS\Project\PQR_20190811.txt.gz&lt;/P&gt;
&lt;P&gt;H:\SAS\Project\XYZ_20190811.txt.gz&lt;/P&gt;
&lt;P&gt;H:\SAS\Project\JKL_20190811.txt.gz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;ABC_20190811&lt;/P&gt;
&lt;P&gt;PQR_20190811&lt;/P&gt;
&lt;P&gt;XYZ_20190811&lt;/P&gt;
&lt;P&gt;JKL_20190811&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Kinjal&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 15:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580406#M164870</guid>
      <dc:creator>KinjalPatel</dc:creator>
      <dc:date>2019-08-11T15:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all .txt.gz filenames from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580418#M164877</link>
      <description>&lt;P&gt;1) Do you know to import one zipped file ?&lt;/P&gt;
&lt;P&gt;2) Read the article in this link:&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/155-31.pdf" target="_self"&gt;https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/155-31.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;3) Read each file and append it to a desired sas dataset name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post your code and log in case of issues using the {i} icon above.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Aug 2019 17:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580418#M164877</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-08-11T17:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all .txt.gz filenames from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580446#M164892</link>
      <description>&lt;P&gt;Read the names. Then parse the names to extract the part you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data filenames ;
  infile 'dir H:\SAS\Project\*.txt.gz /b' pipe truncover;
  input filename $256. ;
  membername = scan(scan(filename,-1,'\'),1,'.');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Aug 2019 02:15:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580446#M164892</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-08-12T02:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all .txt.gz filenames from a folder</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580464#M164899</link>
      <description>&lt;P&gt;Thank you Tom! You are genius!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 06:24:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-txt-gz-filenames-from-a-folder/m-p/580464#M164899</guid>
      <dc:creator>KinjalPatel</dc:creator>
      <dc:date>2019-08-12T06:24:00Z</dc:date>
    </item>
  </channel>
</rss>

