<?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 Using PROC IMPORT to Specify data type from excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-PROC-IMPORT-to-Specify-data-type-from-excel/m-p/357548#M83954</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an excel worksheet (xlsx) where all fields were formatted as "General". When I first imported&amp;nbsp;it into SAS, I realized that the&amp;nbsp;variable, "Result", that has numerical values for some obervations and character values for other&amp;nbsp;observations&amp;nbsp;was imported as solely numerical variable (i.e.,&amp;nbsp;for those observations that have character values in the result&amp;nbsp;field, the values become missing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried to&amp;nbsp;use the following code to specify that I want&amp;nbsp;the result field to be imported as character field. However, it does not seem like my code is working. Would y'all please let me know how to fix this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;import&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datafile&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"Z:\Positive Health Check\Data\1985-2017May Data\test2.xlsx"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=ts&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=EXCEL replace;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DBDSOPTS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"DBTYPE=(RESULT='CHAR(20)')"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2017 16:15:00 GMT</pubDate>
    <dc:creator>ynchen08</dc:creator>
    <dc:date>2017-05-10T16:15:00Z</dc:date>
    <item>
      <title>Using PROC IMPORT to Specify data type from excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-PROC-IMPORT-to-Specify-data-type-from-excel/m-p/357548#M83954</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an excel worksheet (xlsx) where all fields were formatted as "General". When I first imported&amp;nbsp;it into SAS, I realized that the&amp;nbsp;variable, "Result", that has numerical values for some obervations and character values for other&amp;nbsp;observations&amp;nbsp;was imported as solely numerical variable (i.e.,&amp;nbsp;for those observations that have character values in the result&amp;nbsp;field, the values become missing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried to&amp;nbsp;use the following code to specify that I want&amp;nbsp;the result field to be imported as character field. However, it does not seem like my code is working. Would y'all please let me know how to fix this issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;import&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datafile&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"Z:\Positive Health Check\Data\1985-2017May Data\test2.xlsx"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=ts&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=EXCEL replace;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;DBDSOPTS&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"DBTYPE=(RESULT='CHAR(20)')"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 16:15:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-PROC-IMPORT-to-Specify-data-type-from-excel/m-p/357548#M83954</guid>
      <dc:creator>ynchen08</dc:creator>
      <dc:date>2017-05-10T16:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using PROC IMPORT to Specify data type from excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-PROC-IMPORT-to-Specify-data-type-from-excel/m-p/357584#M83970</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2017 17:20:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-PROC-IMPORT-to-Specify-data-type-from-excel/m-p/357584#M83970</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-10T17:20:07Z</dc:date>
    </item>
  </channel>
</rss>

