<?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: Importing multiple txt files - using a Macro? Help in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115680#M31984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need a macro, you can use a wildcard to import the files. Import once and get your file structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://listserv.uga.edu/cgi-bin/wa?A2=ind1210a&amp;amp;L=sas-l&amp;amp;H=1&amp;amp;F=&amp;amp;S=&amp;amp;P=1046" title="http://listserv.uga.edu/cgi-bin/wa?A2=ind1210a&amp;amp;L=sas-l&amp;amp;H=1&amp;amp;F=&amp;amp;S=&amp;amp;P=1046"&gt;http://listserv.uga.edu/cgi-bin/wa?A2=ind1210a&amp;amp;L=sas-l&amp;amp;H=1&amp;amp;F=&amp;amp;S=&amp;amp;P=1046&lt;/A&gt;&lt;/P&gt;&lt;P id=":1ct"&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Apr 2013 16:35:01 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-04-22T16:35:01Z</dc:date>
    <item>
      <title>Importing multiple txt files - using a Macro? Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115679#M31983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Due to my lack / limited use of macro's, I'm hoping someone would be kind enough to help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a number of files saved in a folder:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Folder: &lt;/P&gt;&lt;P&gt;Beacon_Data\data\sas\&lt;/P&gt;&lt;P&gt;Files:&lt;/P&gt;&lt;P&gt;ERCH_1.txt&lt;/P&gt;&lt;P&gt;ERCH_2.txt&lt;/P&gt;&lt;P&gt;:::::::::::::::::&lt;/P&gt;&lt;P&gt;:::::::::::::::::&lt;/P&gt;&lt;P&gt;ERCH_50.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used a basic proc input to bring in one file (I can format after) but I've searched the web on how to read all the files in &amp;amp; I fail when I get to reading the what files are in the directory..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.All_ERCH&lt;/P&gt;&lt;P&gt;DATAFILE= "\data\sas\ERCH_1.txt" dbms=dlm&amp;nbsp;&amp;nbsp;&amp;nbsp; replace; delimiter= ';'&lt;/P&gt;&lt;P&gt;getnames=yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of confusing matters with the code I have copied from various sites, I hope this is a easy program to help with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thaanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 16:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115679#M31983</guid>
      <dc:creator>jammy</dc:creator>
      <dc:date>2013-04-22T16:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple txt files - using a Macro? Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115680#M31984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't need a macro, you can use a wildcard to import the files. Import once and get your file structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://listserv.uga.edu/cgi-bin/wa?A2=ind1210a&amp;amp;L=sas-l&amp;amp;H=1&amp;amp;F=&amp;amp;S=&amp;amp;P=1046" title="http://listserv.uga.edu/cgi-bin/wa?A2=ind1210a&amp;amp;L=sas-l&amp;amp;H=1&amp;amp;F=&amp;amp;S=&amp;amp;P=1046"&gt;http://listserv.uga.edu/cgi-bin/wa?A2=ind1210a&amp;amp;L=sas-l&amp;amp;H=1&amp;amp;F=&amp;amp;S=&amp;amp;P=1046&lt;/A&gt;&lt;/P&gt;&lt;P id=":1ct"&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 16:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115680#M31984</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-22T16:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple txt files - using a Macro? Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115681#M31985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried using the wildcard, if you mean:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.All_ERCH&lt;/P&gt;&lt;P&gt;DATAFILE= "\beacon_data\sas\*.txt" dbms=dlm&amp;nbsp;&amp;nbsp;&amp;nbsp; replace; delimiter= ';'&lt;/P&gt;&lt;P&gt;getnames=yes;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This does import all the tables, it includes all the headers from each table.&amp;nbsp; I can clean the data, but I'd like a more efficient way to do the import.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 08:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115681#M31985</guid>
      <dc:creator>jammy</dc:creator>
      <dc:date>2013-04-23T08:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple txt files - using a Macro? Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115682#M31986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this. Or you can use it to write a macro. they are the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
 input file : $20.;
cards;
ERCH_1.txt
ERCH_2.txt
;
run;
data _null_;
 set have;
 call execute('proc import datafile="c:\temp\'||strip(file)||'" out='||strip(scan(file,1,'.'))||' dbms=dlm replace; delimiter=";" ;
getnames=yes;run;');
run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 08:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115682#M31986</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-04-23T08:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple txt files - using a Macro? Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115683#M31987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/707.html" title="http://support.sas.com/kb/24/707.html"&gt;24707 - Reading multiple files with PROC IMPORT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Click on the full code tab to get the code.&lt;/P&gt;&lt;P&gt;There is also a second option (linked from the first page) that shows how to import it all into one dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 14:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115683#M31987</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-04-23T14:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multiple txt files - using a Macro? Help</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115684#M31988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a link to read multiple raw data files with the same structure in one data step. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/multi_file_read.htm"&gt;http://www.ats.ucla.edu/stat/sas/faq/multi_file_read.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 17:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multiple-txt-files-using-a-Macro-Help/m-p/115684#M31988</guid>
      <dc:creator>sas4ml</dc:creator>
      <dc:date>2013-04-23T17:36:23Z</dc:date>
    </item>
  </channel>
</rss>

