<?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: import data with both character and numeric type in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83055#M23818</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if 20 row is not sufficient to include both character or number, then increase it:&lt;/P&gt;&lt;P id="bookpage"&gt;&lt;/P&gt;&lt;DIV class="sgml"&gt;&lt;TABLE border="1" cellpadding="6" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR valign="top"&gt;&lt;TD align="left" valign="top" width="27%"&gt;GUESSINGROWS=&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;Haikuo &lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2012 16:47:33 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2012-06-14T16:47:33Z</dc:date>
    <item>
      <title>import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83052#M23815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;harHi community,&lt;/P&gt;&lt;P&gt;I am at the beginning stage of learning SAS and I have a problem when I import data from Excel to SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first 5 obs. of variable DS Code in Excel file 1&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="WIDTH: 54px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="54"&gt;DS Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;321767&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;982616&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: medium none;" width="54"&gt;27734K&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="35" style="border-top: medium none;" width="54"&gt;13811D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;321768&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;when I imported to SAS, problem arose and obs. mixed by number and letter are missing like below and the type of this variable is numeric with format BEST12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="54"&gt;DS Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;321767&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;982616&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: medium none;" width="54"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="35" style="border-top: medium none;" width="54"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;321768&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first 5 obs. of variable DS Code in Excel file 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="54"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="54"&gt;DS Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="35" style="border-top: medium none;" width="54"&gt;53546D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="35" style="border-top: medium none;" width="54"&gt;53677Q&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: medium none;" width="54"&gt;27501K&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;932726&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;945857&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when I imported to SAS, it seems ok and the type of this variable is character with format $6.&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="54"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="54"&gt;DS Code&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="35" style="border-top: medium none;" width="54"&gt;53546D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="35" style="border-top: medium none;" width="54"&gt;53677Q&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: medium none;" width="54"&gt;27501K&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;932726&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="35" style="border-top: medium none;" width="54"&gt;945857&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;&lt;/P&gt;&lt;P&gt;My question is that:&lt;/P&gt;&lt;P&gt;Can I avoid the missing values and unify the type (It should be character in my case) when I import data from Excel using Import Wizard no matter the first obs is only numbers or mixed with letter? I need to combine the two SAS files together so the variable type should be consistent. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 13:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83052#M23815</guid>
      <dc:creator>comeon2012</dc:creator>
      <dc:date>2012-06-14T13:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83053#M23816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use the option MIXED=YES in the import&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 13:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83053#M23816</guid>
      <dc:creator>ChrisSelley</dc:creator>
      <dc:date>2012-06-14T13:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83054#M23817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS will look at the first 20 rows of data and determine the data type by the majority of values for each column by default when importing from XLS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 14:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83054#M23817</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-06-14T14:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83055#M23818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if 20 row is not sufficient to include both character or number, then increase it:&lt;/P&gt;&lt;P id="bookpage"&gt;&lt;/P&gt;&lt;DIV class="sgml"&gt;&lt;TABLE border="1" cellpadding="6" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR valign="top"&gt;&lt;TD align="left" valign="top" width="27%"&gt;GUESSINGROWS=&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;Haikuo &lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 16:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83055#M23818</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-06-14T16:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83056#M23819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... if it's an XLS file, GUESSINGROWS is not an option ... only works with delimited files (e.g. tabs, commas)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;even if the value is changed in the SAS Registry, it has no effect if you start with an XLS file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 16:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83056#M23819</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-06-14T16:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83057#M23820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good to know that. Since it worked for CSV file for me, I took it for granted it also works for xls. Thanks, Mike.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 17:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83057#M23820</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-06-14T17:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83058#M23821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;we had this problem and changing the column format in excel from Generic to Text resolved it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 12:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83058#M23821</guid>
      <dc:creator>p12937</dc:creator>
      <dc:date>2012-06-20T12:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: import data with both character and numeric type</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83059#M23822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks p12937&lt;/P&gt;&lt;P&gt;A friend also advised me to insert a row under the variable title row in Excel/CSV. If you want to keep a variable as character, just put a character value such as "blank" in the inserted row under that variable name(i.e. the first obs.). While if you want to keep a variable as numberic, just put a&amp;nbsp; numeric value like "1234" in the inserted row under that variable name(i.e. the first obs.). The type of first obs. will decide the type in SAS. When the data is imported to SAS, you can delete the inserted row. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 00:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/import-data-with-both-character-and-numeric-type/m-p/83059#M23822</guid>
      <dc:creator>comeon2012</dc:creator>
      <dc:date>2012-06-21T00:22:26Z</dc:date>
    </item>
  </channel>
</rss>

