<?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: Help with import excel file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545677#M151007</link>
    <description>&lt;P&gt;The end date column is messed up due to "?5/31/2017"&lt;/P&gt;
&lt;P&gt;That's why I think about data step.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Mar 2019 02:48:11 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2019-03-25T02:48:11Z</dc:date>
    <item>
      <title>Help with import excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545669#M150999</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you help me to fix my code to import Excel file attached?&lt;/P&gt;
&lt;P&gt;I thought I listed everything here but still I cant import it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even when I put only " &lt;CODE class=" language-sas"&gt;input 	Firm :$50. ; " it still import only 1 row with weird character!&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	data ccrate ();
	infile "C:\_temp\Subs sample.xlsx" 	;
	input 	Firm :$50. user :$100. Start_Date :mmddyy10. End_date :mmddyy10.  Project:$100. Type :$30. value code :$50. &lt;BR /&gt;hire :$30.	Location:$50.  total  	 Conversion_Date :mmddyy10.;
	format Start_Date end_date Conversion_Date :mmddyy10.;run;
	;run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 01:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545669#M150999</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-03-25T01:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with import excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545672#M151002</link>
      <description>&lt;P&gt;XLSX files are ZIP files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The INPUT statement is to be used with TEXT files; ZIP files will display as "weird characters".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use PROC IMPORT to read XLSX files.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 02:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545672#M151002</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-03-25T02:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with import excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545674#M151004</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import 
   datafile="Path\To\Subs sample.xlsx"
   out=foo (where=(firm is not missing))
   dbms=xlsx
   replace;
   getnames=yes;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Stop trying to import a zipped XML file (i.e. a binary file) via an infile statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Read the doc on PROC IMPORT for more details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 02:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545674#M151004</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-03-25T02:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with import excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545676#M151006</link>
      <description>&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;I can import it with Proc import but then in the Date column, there are record like "2/02/2019!" and SAS import the whole column as text.&lt;/P&gt;
&lt;P&gt;That's why I want to try the datastep where I can clarify the format of column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: You are trying to use the numeric format MMDDYY with the character variable Start_Date in data&lt;BR /&gt;set WORK.CRATE.&lt;BR /&gt;ERROR: You are trying to&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 02:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545676#M151006</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-03-25T02:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with import excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545677#M151007</link>
      <description>&lt;P&gt;The end date column is messed up due to "?5/31/2017"&lt;/P&gt;
&lt;P&gt;That's why I think about data step.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 02:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545677#M151007</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-03-25T02:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with import excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545689#M151015</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49486"&gt;@hhchenfx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;The end date column is messed up due to "?5/31/2017"&lt;/P&gt;&lt;P&gt;That's why I think about data step.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are the values for end date (Cells D9 and D10):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;?5/31/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/30/2017!&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT uses the "GuessingRows" option to make a best guess as to the data type of the column based on the data within.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you want SAS to do with these cells?&amp;nbsp; As far as SAS is concerned, this is just text, and it has imported it as such, converting the entire column to text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to apply the mm-dd-yy date format in Excel so the columns would be formatted consistently (mm-dd-yy vs. mm/dd/yyyy).&amp;nbsp; Even Excel doesn't know what to do with these cells.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any chance you can clean up your data?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 05:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545689#M151015</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-03-25T05:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with import excel file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545707#M151026</link>
      <description>&lt;P&gt;The best advice we can give with regards to Excel files is "don't use them".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Save your data to a usable format (textual, like csv or fixed-width), and read the data with a custom written data step, where you can take care of special cases and the necessary conversions yourself.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2019 07:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-with-import-excel-file/m-p/545707#M151026</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-25T07:28:23Z</dc:date>
    </item>
  </channel>
</rss>

