<?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 How can I read multiple files placed in a location to one file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265818#M52333</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to load the data from multiple text files palced in a folder&amp;nbsp;having the same structure to one file. All the text files are having the same headers.&lt;/P&gt;&lt;P&gt;Sample data in one of the file:&lt;/P&gt;&lt;P&gt;Product &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Customer &amp;nbsp; &amp;nbsp;Qtr 1 &amp;nbsp; &amp;nbsp; Qtr 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Qtr 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Qtr 4&lt;BR /&gt;Alice_Mutton &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ANTON &amp;nbsp; &amp;nbsp; 28080 &amp;nbsp; &amp;nbsp; 70200 &amp;nbsp; &amp;nbsp; &amp;nbsp;110400 &amp;nbsp; &amp;nbsp; &amp;nbsp;55125&lt;BR /&gt;Aniseed_Syrup &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BERGS &amp;nbsp; &amp;nbsp; 31200 &amp;nbsp; &amp;nbsp; 78000 &amp;nbsp; &amp;nbsp; &amp;nbsp;60000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 14700&lt;BR /&gt;Boston_Crab &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BOLID &amp;nbsp; &amp;nbsp; &amp;nbsp; 28080 &amp;nbsp; &amp;nbsp; 6000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;77280 &amp;nbsp; &amp;nbsp; &amp;nbsp;117000&lt;BR /&gt;Escargots_Bourgogne BOTTM &amp;nbsp; &amp;nbsp;117000 &amp;nbsp; &amp;nbsp;20000 &amp;nbsp; &amp;nbsp; 16560 &amp;nbsp; &amp;nbsp; &amp;nbsp; 122360&lt;BR /&gt;Filo_Mix &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ERNSH &amp;nbsp; &amp;nbsp; 112320 &amp;nbsp; 18000 &amp;nbsp; &amp;nbsp; &amp;nbsp;92000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 260715&lt;BR /&gt;Geitost &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GODOS &amp;nbsp; &amp;nbsp;6240 &amp;nbsp; &amp;nbsp; &amp;nbsp; 28080 &amp;nbsp; &amp;nbsp; &amp;nbsp;24840 &amp;nbsp; &amp;nbsp; &amp;nbsp; 41952&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also the names of the file are cust101, cust102, cust103.........Cust200...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please suggest an efficient way to read the data from all these text file in to a single file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saket&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 23 Apr 2016 12:52:35 GMT</pubDate>
    <dc:creator>Saket_90</dc:creator>
    <dc:date>2016-04-23T12:52:35Z</dc:date>
    <item>
      <title>How can I read multiple files placed in a location to one file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265818#M52333</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to load the data from multiple text files palced in a folder&amp;nbsp;having the same structure to one file. All the text files are having the same headers.&lt;/P&gt;&lt;P&gt;Sample data in one of the file:&lt;/P&gt;&lt;P&gt;Product &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Customer &amp;nbsp; &amp;nbsp;Qtr 1 &amp;nbsp; &amp;nbsp; Qtr 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Qtr 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Qtr 4&lt;BR /&gt;Alice_Mutton &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ANTON &amp;nbsp; &amp;nbsp; 28080 &amp;nbsp; &amp;nbsp; 70200 &amp;nbsp; &amp;nbsp; &amp;nbsp;110400 &amp;nbsp; &amp;nbsp; &amp;nbsp;55125&lt;BR /&gt;Aniseed_Syrup &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BERGS &amp;nbsp; &amp;nbsp; 31200 &amp;nbsp; &amp;nbsp; 78000 &amp;nbsp; &amp;nbsp; &amp;nbsp;60000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 14700&lt;BR /&gt;Boston_Crab &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BOLID &amp;nbsp; &amp;nbsp; &amp;nbsp; 28080 &amp;nbsp; &amp;nbsp; 6000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;77280 &amp;nbsp; &amp;nbsp; &amp;nbsp;117000&lt;BR /&gt;Escargots_Bourgogne BOTTM &amp;nbsp; &amp;nbsp;117000 &amp;nbsp; &amp;nbsp;20000 &amp;nbsp; &amp;nbsp; 16560 &amp;nbsp; &amp;nbsp; &amp;nbsp; 122360&lt;BR /&gt;Filo_Mix &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ERNSH &amp;nbsp; &amp;nbsp; 112320 &amp;nbsp; 18000 &amp;nbsp; &amp;nbsp; &amp;nbsp;92000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 260715&lt;BR /&gt;Geitost &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GODOS &amp;nbsp; &amp;nbsp;6240 &amp;nbsp; &amp;nbsp; &amp;nbsp; 28080 &amp;nbsp; &amp;nbsp; &amp;nbsp;24840 &amp;nbsp; &amp;nbsp; &amp;nbsp; 41952&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also the names of the file are cust101, cust102, cust103.........Cust200...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please suggest an efficient way to read the data from all these text file in to a single file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saket&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 12:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265818#M52333</guid>
      <dc:creator>Saket_90</dc:creator>
      <dc:date>2016-04-23T12:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I read multiple files placed in a location to one file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265825#M52337</link>
      <description>Hi:&lt;BR /&gt;  This Tech Support note describes one method:&lt;BR /&gt;&lt;A href="https://support.sas.com/techsup/technote/ts581.pdf" target="_blank"&gt;https://support.sas.com/techsup/technote/ts581.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Sat, 23 Apr 2016 15:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265825#M52337</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-04-23T15:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I read multiple files placed in a location to one file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265829#M52341</link>
      <description>&lt;P&gt;You can read multiple files using wildcrds. The code below is not tested but should help get you started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let data_filepath = c:\...\cust*; &amp;nbsp;* modify path as appropriate for your system;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data temp;&lt;BR /&gt;infile firstobs=2 "&amp;amp;data_filepath";&lt;BR /&gt;input product $ customer $ qtr1-qtr4;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 15:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265829#M52341</guid>
      <dc:creator>Pamela_JSRCC</dc:creator>
      <dc:date>2016-04-23T15:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I read multiple files placed in a location to one file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265830#M52342</link>
      <description>&lt;P&gt;Here's my recommended solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-do-I-write-a-macro-to-import-multiple-text-files-that-have/ta-p/223627&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. You need your input/informat/format statement for reading a single file.&lt;/P&gt;
&lt;P&gt;2. In the code in link above, change the path, and use a wildcard to reference the data.&lt;/P&gt;
&lt;P&gt;3. Make sure to use the EOV= variable to avoid reading the header in each file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Apr 2016 15:41:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-I-read-multiple-files-placed-in-a-location-to-one-file/m-p/265830#M52342</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-23T15:41:40Z</dc:date>
    </item>
  </channel>
</rss>

