<?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 *.xls-files from a folder into SAS and make one sas dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174559#M33520</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! FORCE option did it... I forced it, that the complete data set was first &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jul 2014 14:44:25 GMT</pubDate>
    <dc:creator>SMartin</dc:creator>
    <dc:date>2014-07-10T14:44:25Z</dc:date>
    <item>
      <title>How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174550#M33511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to read all Excel-Files from a folder into SAS. This is how my data files look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;x1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;x2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;x3&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;x4&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;text 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;100,99&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1.512,36&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;text 2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;200,99&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5.216,85&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;text 3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;300,99&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;30&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8.234,25&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my first trying but it doesn't work. There is something nonsense in the first column - rest is missing. AND next challenge is: how will it function if the excel-files hasn't the same columns....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%let dirname = C:\Users\eduger\Desktop\Test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;filename &lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;DIRLIST &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;pipe&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"dir /B &amp;amp;dirname\*.xls"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;data dirlist ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; fname $&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;256&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; dirlist &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=reclen ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; fname &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;$varying256.&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; reclen ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;proc print&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; = dirlist;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; all_text (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=fname);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; myfilename $&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;100&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; x1 $&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 12pt; font-family: Courier New;"&gt;100&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; dirlist;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filepath = "&amp;amp;dirname\"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;||fname;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;dummy&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;filevar&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; = filepath &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=reclen &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=done &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;missover&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;(not done);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; x1 $ x2 x3 x4;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;proc&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;print&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;=all_text;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;run&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;I HOPE SOMEONE CAN HELP ME...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;BR, Silke &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 09:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174550#M33511</guid>
      <dc:creator>SMartin</dc:creator>
      <dc:date>2014-07-10T09:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174551#M33512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, several questions:&lt;/P&gt;&lt;P&gt;Are the files XLS or XLSX?&lt;/P&gt;&lt;P&gt;Why not convert them to CSV - simple VBA script - as file format easier to work with.&lt;/P&gt;&lt;P&gt;Do each of the sheets contains *exactly* the same data, e.g. same columns/formats.&amp;nbsp; Otherwise you will have problems setting them to one table.&lt;/P&gt;&lt;P&gt;Do you have mixed datatypes in your Excel columns, i.e. do you have columns with number and alphanumerics.&lt;/P&gt;&lt;P&gt;Do you have a structured data import documentation, i.e. what will you do with oddities - for example date column with partial dates, results with character results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have you plan on how each data element from each datafile should be handled then go about the process of grouping similar file structures and simple tools.&amp;nbsp; Create an import program for each different file where there are significant differences, or alternatively read everything in a long character and then post-process the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for all of the above is that Excel is not a database/data transfer/or anything else, and hence will cause you lots of headaches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add, I don't think you will be able to infile binary .XLS files as you have been doing, these would need proc import.&amp;nbsp; Again, another good reason to save your data as CSV (basic text file with delimiters), which you can then use as you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 09:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174551#M33512</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-10T09:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174552#M33513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have *.xls AND *.xlsx files&lt;/P&gt;&lt;P&gt;Why not convert to csv: there are more information in the files then I need - I use only a certain range&lt;/P&gt;&lt;P&gt;Format in Columns is all the same BUT there are different columns with mixed datatypes. One column is character the rest is numeric - no date column&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 09:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174552#M33513</guid>
      <dc:creator>SMartin</dc:creator>
      <dc:date>2014-07-10T09:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174553#M33514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, as I added I don't think binary XLS files will work with infile.&amp;nbsp; I would still recommend converting to CSV and then algorithmically removing records/columns you don't need. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try proc import each one and then proc append the result, and if your very likely you may end up with what you want.&amp;nbsp; I would still look at the process I have given, as there are many trip ups - number stored a character, data hidden behind Excel formats, special characters, multi-line fields etc. any of which could give you an invalid end result.&amp;nbsp; Try it and see:&lt;/P&gt;&lt;P&gt;%macro imp (fname=);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc import datafile="...\&amp;amp;fname." out=tmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet="...";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; range="...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc append base=base data=tmp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%mend imp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Do first one so we have base */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc import datafile="...\..." out=base;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet="...";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; range="...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;/* Do others */&lt;/P&gt;&lt;P&gt;%imp (fname=...);&lt;/P&gt;&lt;P&gt;%imp (fname=...);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 10:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174553#M33514</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-10T10:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174554#M33515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a similar problem once. If you modify this code (Excel Version!!) you might get a reasonable result. The aggregated file is called: XL_All.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%Let Directory=C:\Users\xxxx;&lt;BR /&gt;%Let XL_vers=ExcelCS;&lt;/P&gt;&lt;P&gt;Filename Dir_Pipe PIPE "DIR &amp;amp;Directory. /B" LRecL=32767;&lt;/P&gt;&lt;P&gt;Data Dir_List;&lt;BR /&gt;&amp;nbsp; Infile Dir_Pipe&amp;nbsp; Truncover;&lt;BR /&gt;&amp;nbsp; Input Text $200.;&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Data XL_List;&lt;BR /&gt;&amp;nbsp; Set Dir_List ;&lt;BR /&gt;&amp;nbsp; Where UpCase(Substr(Text,Index(Text,'.')+1,4)) in ("XLSX" "XLS");&lt;BR /&gt;Run;&lt;/P&gt;&lt;P&gt;Proc SQL NoPrint;&lt;BR /&gt;&amp;nbsp; Select Text Into :XL_List Separated By '#' From XL_List;&lt;BR /&gt;Quit;&lt;BR /&gt;%Put **&amp;amp;XL_List.**;&lt;/P&gt;&lt;P&gt;%Macro Import_XL(XL_List=);&lt;BR /&gt;%Global i;&lt;BR /&gt;%Let i=1;&lt;BR /&gt;%Let Element=%Scan(&amp;amp;XL_List.,&amp;amp;i.,'#');&lt;BR /&gt;%Do %While ("&amp;amp;Element."^="");&lt;BR /&gt;&amp;nbsp; %Put **&amp;amp;i.**&amp;amp;Element.**;&lt;BR /&gt;&amp;nbsp; Proc Import Out=XL_&amp;amp;i&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datafile="&amp;amp;Directory.\&amp;amp;Element."&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=&amp;amp;XL_vers&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *Sheet="";&lt;BR /&gt;&amp;nbsp; Run;&lt;BR /&gt;&amp;nbsp; %Let i=%Eval(&amp;amp;i.+1);&lt;BR /&gt;&amp;nbsp; %Let Element=%Scan(&amp;amp;XL_List.,&amp;amp;i.,'#');&lt;BR /&gt;%End;&lt;BR /&gt;%Mend;&lt;BR /&gt;%Import_XL(XL_List=&amp;amp;XL_List.);&lt;/P&gt;&lt;P&gt;%Let i=%Eval(&amp;amp;i.-1);&lt;BR /&gt;%Put **&amp;amp;i.**;&lt;/P&gt;&lt;P&gt;%Macro Append_XL;&lt;BR /&gt;Data XL_ALL;&lt;BR /&gt;&amp;nbsp; Set XL_1;&lt;BR /&gt;Run;&lt;BR /&gt;%If &amp;amp;i.=2 %Then %Do;&lt;BR /&gt;Proc Append Base=XL_All Data=XL_2;&lt;BR /&gt;Run;&lt;BR /&gt;%End;&lt;BR /&gt;%Else %Do;&lt;BR /&gt;&amp;nbsp; %Do a=2 %To &amp;amp;i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Proc Append Base=XL_All Data=XL_&amp;amp;a.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Run;&lt;BR /&gt;&amp;nbsp; %End;&lt;BR /&gt;%End;&lt;BR /&gt;%Mend;&lt;BR /&gt;%Append_XL;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 10:40:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174554#M33515</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-07-10T10:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174555#M33516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks! It works...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 11:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174555#M33516</guid>
      <dc:creator>SMartin</dc:creator>
      <dc:date>2014-07-10T11:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174556#M33517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try for example: Range="Sheet1$A2:E12".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/5/444.html" title="http://support.sas.com/kb/5/444.html"&gt;5444 - How to read an Excel range into SAS using PROC IMPORT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 11:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174556#M33517</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-07-10T11:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174557#M33518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes! Range was a fault of mine...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT the files has different columns and the macro uses only the columns which are in all files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I fix it, that I have also the other columns i.e. with missing as value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 13:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174557#M33518</guid>
      <dc:creator>SMartin</dc:creator>
      <dc:date>2014-07-10T13:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174558#M33519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could try the force option (Proc Append Base=XL_All Data=XL_&amp;amp;a. FORCE;) - but this will only work if the first data set is complete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the files aren't too large "set" will do.&lt;/P&gt;&lt;P&gt;Replace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Append Base=XL_All Data=XL_&amp;amp;a.;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data XL_All;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set XL_All XL_&amp;amp;a;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 14:13:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174558#M33519</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-07-10T14:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174559#M33520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! FORCE option did it... I forced it, that the complete data set was first &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 14:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174559#M33520</guid>
      <dc:creator>SMartin</dc:creator>
      <dc:date>2014-07-10T14:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174560#M33521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When creating XL_List, consider replacing&lt;/P&gt;&lt;P&gt;Where UpCase(Substr(Text,Index(Text,'.')+1,4)) in ("XLSX" "XLS");&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;Test=Reverse(Trim(LowCase(Text)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; If "xslx." =: Test&lt;/P&gt;&lt;P&gt;&amp;nbsp; or&amp;nbsp; "slx." =: Test;&lt;/P&gt;&lt;P&gt;Though it may not be so elegant, this code will include files with more complex names, such as blah.blah.xls, whereas the original will ignore such files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 17:29:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174560#M33521</guid>
      <dc:creator>ChrisVoris</dc:creator>
      <dc:date>2014-07-10T17:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to read all *.xls-files from a folder into SAS and make one sas dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174561#M33522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.. I like that a lot. But I think I would have to use Reverse('.xlsx') to avoid typos. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 06:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-read-all-xls-files-from-a-folder-into-SAS-and-make-one/m-p/174561#M33522</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2014-07-11T06:24:07Z</dc:date>
    </item>
  </channel>
</rss>

