<?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: Bulk MS Excel Import fails with multiple files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261290#M50813</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21847"&gt;@metallon&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;KurtBremser wrote: &lt;BR /&gt;
&lt;P&gt;Edit: I also see you try to use .xls as a data transfer format. This is a BAD IDEA, Excel is NOT a suitable data transfer format.&lt;/P&gt;
&lt;P&gt;Export your data to something sensible (.CSV!) and import that.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks. I know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but its 16 clients, it is out of my power to re-negotiate data submission procedures. I just have to deal with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The IT Guy.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My feelings are with you &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2016 07:18:35 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-04-05T07:18:35Z</dc:date>
    <item>
      <title>Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261111#M50742</link>
      <description>&lt;P&gt;Hi SAS Experts,&lt;/P&gt;
&lt;P&gt;I got the following macro to import files and noticed that when I add one or more files that some columns are not properly imported anymore. It is really weird. and I cant explain it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro MultImp(dir=,out=);&lt;BR /&gt;%let rc=%str(%'dir %")&amp;amp;dir.%str(\%" /A-D/B/ON%');&lt;BR /&gt;filename myfiles pipe %unquote(&amp;amp;rc);&lt;BR /&gt;data importedfilesoverview;&lt;BR /&gt;length fname $256.;&lt;BR /&gt;infile myfiles truncover;&lt;BR /&gt;input myfiles $100.;&lt;BR /&gt;fname=quote(upcase(cats("&amp;amp;dir",'\',myfiles)));&lt;BR /&gt;&lt;BR /&gt;first2chars=quote(substr(myfiles,1,2)); /* country*/&lt;BR /&gt;next5chars=quote(substr(myfiles,7,1));&amp;nbsp; /* year*/&lt;BR /&gt;&lt;BR /&gt;out="&amp;amp;out";&lt;BR /&gt;drop myfiles;&lt;BR /&gt;call execute('&lt;BR /&gt;&amp;nbsp; proc import dbms=xls out= _temp&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datafile= '||fname||'; getnames=no; datarow=10;&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; /* new: */&lt;BR /&gt;&amp;nbsp; proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table _temp2 as&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; select '||first2chars||' as first2chars, '||next5chars||' as next5chars, *&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; from _temp;&lt;BR /&gt;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; proc append data=_temp2 base='||out||' force; run;&lt;BR /&gt;&amp;nbsp; proc delete data=_temp _temp2; run;&lt;BR /&gt;');&lt;BR /&gt;run;&lt;BR /&gt;filename myfiles clear;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%MultImp(dir=R:\myfiles\,out=Importcont_Import);&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 15:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261111#M50742</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-04-04T15:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261112#M50743</link>
      <description>&lt;P&gt;Proc Import guesses &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;CEm&lt;/P&gt;
&lt;P&gt;Is there something different in those file structures from the other files? Empty columns?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 15:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261112#M50743</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-04T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261113#M50744</link>
      <description>I got it. Its the format. One excel column in one file is date the other file has it as standard text. the content looks the same but SAS, upon import, takes the first files format and does not import the rest anymore. is there a way to force SAS to import as character...all columns?</description>
      <pubDate>Mon, 04 Apr 2016 15:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261113#M50744</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-04-04T15:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261285#M50810</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21847"&gt;@metallon&lt;/a&gt; wrote:&lt;BR /&gt;I got it. Its the format. One excel column in one file is date the other file has it as standard text. the content looks the same but SAS, upon import, takes the first files format and does not import the rest anymore. is there a way to force SAS to import as character...all columns?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. Instead of using PROC IMPORT, take the DATA step created by PROC IMPORT (it's in the log) and change the input format for the respective column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I also see you try to use .xls as a data transfer format. This is a BAD IDEA, Excel is NOT a suitable data transfer format.&lt;/P&gt;
&lt;P&gt;Export your data to something sensible (.CSV!) and import that.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 06:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261285#M50810</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-05T06:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261289#M50812</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;KurtBremser wrote: &lt;BR /&gt;
&lt;P&gt;Edit: I also see you try to use .xls as a data transfer format. This is a BAD IDEA, Excel is NOT a suitable data transfer format.&lt;/P&gt;
&lt;P&gt;Export your data to something sensible (.CSV!) and import that.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks. I know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but its 16 clients, it is out of my power to re-negotiate data submission procedures. I just have to deal with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The IT Guy.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 07:11:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261289#M50812</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-04-05T07:11:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261290#M50813</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21847"&gt;@metallon&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;KurtBremser wrote: &lt;BR /&gt;
&lt;P&gt;Edit: I also see you try to use .xls as a data transfer format. This is a BAD IDEA, Excel is NOT a suitable data transfer format.&lt;/P&gt;
&lt;P&gt;Export your data to something sensible (.CSV!) and import that.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks. I know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; but its 16 clients, it is out of my power to re-negotiate data submission procedures. I just have to deal with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The IT Guy.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My feelings are with you &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 07:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261290#M50813</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-05T07:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261295#M50816</link>
      <description>Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;BR /&gt;I got my first file that has the date column formated so I cant use $CHAR50 and the second excel file has it formatted as standard text so $CHAR50 works. Is there no way to ignore the ms excel formats?</description>
      <pubDate>Tue, 05 Apr 2016 07:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261295#M50816</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-04-05T07:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261297#M50818</link>
      <description>&lt;P&gt;You can always read any data into a temporary character variable (that is subsequently dropped) and then do the conversion using the input() function.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 07:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261297#M50818</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-05T07:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261322#M50821</link>
      <description>hmm I got one excel file with date format 2015-10-29 and one with 2015.10.29 I cant get them in the same column. If I use informat L YYYYMMDD. the 2015.10.29 wont load and if I use $CHAR100. the 2015-10-29 wont load but he 2015.10.29 works.</description>
      <pubDate>Tue, 05 Apr 2016 10:22:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261322#M50821</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-04-05T10:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261324#M50822</link>
      <description>&lt;P&gt;Hmm.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input charstring:$10.;
date_wanted = input(charstring,yymmdd10.);
format date_wanted yymmdd10.;
cards;
2015-10-29
2015.10.29
;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;gives me this result:&lt;/P&gt;
&lt;PRE&gt;                                                                            date_
                                                  Obs    charstring        wanted

                                                   1     2015-10-29    2015-10-29
                                                   2     2015.10.29    2015-10-29
&lt;/PRE&gt;
&lt;P&gt;as yymmdd10. is robust with different separator characters.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 11:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261324#M50822</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-05T11:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261361#M50847</link>
      <description>Thanks. But I have to use the proc import macro. there are too many files.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Apr 2016 12:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261361#M50847</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-04-05T12:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261371#M50851</link>
      <description>&lt;P&gt;Define "too many". You see, here we get several hundred different data file layouts out of the production database and production programs. Each has its own SAS program and job to be run by the central scheduler. Each program is handled with a versioning system and fully documented (infiles, outfiles, changes, test runs, etc.).&lt;/P&gt;
&lt;P&gt;As long as you just throw the whole heap of data at PROC IMPORT and hope for the best, you have to live with the results. Computers are dumb.&lt;/P&gt;
&lt;P&gt;Get a handle on your data structures and bring order into the whole process. This will mean much work up front, but much less hassle later on.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2016 13:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261371#M50851</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-05T13:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261620#M50951</link>
      <description>&lt;P&gt;8-16 files. OK I am convinced. I tell the guys responsible that they need to get the MS Excel formats right &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 07:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261620#M50951</guid>
      <dc:creator>metallon</dc:creator>
      <dc:date>2016-04-06T07:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bulk MS Excel Import fails with multiple files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261663#M50965</link>
      <description>&lt;P&gt;16 files is small &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 11:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bulk-MS-Excel-Import-fails-with-multiple-files/m-p/261663#M50965</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-06T11:44:31Z</dc:date>
    </item>
  </channel>
</rss>

