<?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 Importing many txt files with differant layouts all in once in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307715#M65939</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;My requirement is to import many .txt files each with differant layout all at once.And to save them as sas datasets in work library.Can someone please help me on this.Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE:I cannot make copy of files and store them in one temp location.File sizes are huge&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2016 18:24:07 GMT</pubDate>
    <dc:creator>srdhoble</dc:creator>
    <dc:date>2016-10-27T18:24:07Z</dc:date>
    <item>
      <title>Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307715#M65939</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;My requirement is to import many .txt files each with differant layout all at once.And to save them as sas datasets in work library.Can someone please help me on this.Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE:I cannot make copy of files and store them in one temp location.File sizes are huge&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 18:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307715#M65939</guid>
      <dc:creator>srdhoble</dc:creator>
      <dc:date>2016-10-27T18:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307724#M65942</link>
      <description>&lt;P&gt;You can write a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you know where the files are? Do you have a list, all in a folder?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Victoria-User-Group/Macros-for-Beginners.pdf" target="_blank"&gt;http://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Victoria-User-Group/Macros-for-Beginners.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 18:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307724#M65942</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-27T18:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307740#M65951</link>
      <description>&lt;P&gt;Where/How is the layout of your text files described?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 19:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307740#M65951</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-10-27T19:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307764#M65960</link>
      <description>&lt;P&gt;These are pipe delimited .txt files. and all of them are distributed over 4 folder locations.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307764#M65960</guid>
      <dc:creator>srdhoble</dc:creator>
      <dc:date>2016-10-27T21:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307773#M65965</link>
      <description>&lt;P&gt;1. Can proc import work or will you need a customized data step for each file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If proc import works you can try and automate it.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 21:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307773#M65965</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-27T21:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307777#M65967</link>
      <description>&lt;P&gt;Automating Proc import would be fine with me...any idea how to go about it?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 22:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307777#M65967</guid>
      <dc:creator>srdhoble</dc:creator>
      <dc:date>2016-10-27T22:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307778#M65968</link>
      <description>&lt;P&gt;The first link I provided is a step by step instruction on how to do exactly that.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 22:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307778#M65968</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-27T22:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Importing many txt files with differant layouts all in once</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307780#M65969</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;You can use a script to determine all the files in the folder (Assuming Windows);&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/805.html" target="_blank"&gt;http://support.sas.com/kb/45/805.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once those are in a dataset you can call the import macro using call execute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro import_text_file(path, out);
proc import data=&amp;amp;out datafile="&amp;amp;path" dbms=dlm;
delimiter='|'; getnames=yes;
run;

%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 22:27:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-many-txt-files-with-differant-layouts-all-in-once/m-p/307780#M65969</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-27T22:27:53Z</dc:date>
    </item>
  </channel>
</rss>

