<?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: Excel Import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439727#M109752</link>
    <description>Guessing rows doesnt work with DBMS=XLSX&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT OUT= WORK.input_metadata DATAFILE=&lt;BR /&gt;"C:\temp\reference.xlsx"&lt;BR /&gt;DBMS=xlsx REPLACE;&lt;BR /&gt;SHEET="input_Variables";&lt;BR /&gt;GETNAMES=YES;GUESSINGROWS=40;&lt;BR /&gt;RUN;&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;12096 SHEET="input_Variables";&lt;BR /&gt;12097 GETNAMES=YES;GUESSINGROWS=40;&lt;BR /&gt;------------&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 23 Feb 2018 15:13:55 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2018-02-23T15:13:55Z</dc:date>
    <item>
      <title>Excel Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439474#M109666</link>
      <description>&lt;P&gt;&lt;BR /&gt;i'm importing data from excel and one of the columns is formatted as shown below:&lt;/P&gt;&lt;P&gt;col_length&lt;BR /&gt;8&lt;BR /&gt;$200&lt;BR /&gt;$200&lt;BR /&gt;3&lt;BR /&gt;&lt;BR /&gt;So when I read in using proc import&amp;nbsp; the col_length in dataset is displayed as below:&lt;BR /&gt;&lt;BR /&gt;Col_length&lt;BR /&gt;$8&lt;BR /&gt;$200&lt;BR /&gt;$200&lt;BR /&gt;$3&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How to read the col_length as just a text so I can see as below:&lt;/P&gt;&lt;P&gt;Col_length&lt;BR /&gt;8&lt;BR /&gt;$200&lt;BR /&gt;$200&lt;BR /&gt;3&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 21:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439474#M109666</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-02-22T21:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439541#M109692</link>
      <description>&lt;P&gt;Have you tried using the guessing rows option?&lt;/P&gt;
&lt;P&gt;Do you have non-numeric values in these columns?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, you can transform the columns back to numeric:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;VAR1N = input(VAR1, ?? 32.10);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 01:03:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439541#M109692</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-23T01:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439548#M109697</link>
      <description>&lt;P&gt;I dont want to convert to numeric. I want them to be displayed as they are. But what happens is in excel the value are 8,$200, but after importing the sas dataset displays &lt;STRONG&gt;$8&lt;/STRONG&gt;,$200.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 01:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439548#M109697</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-02-23T01:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439565#M109707</link>
      <description>&lt;P&gt;Maybe&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;format VAR comma8.0;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;then?&lt;/P&gt;
&lt;P&gt;If not, run &lt;FONT face="courier new,courier"&gt;proc contents&lt;/FONT&gt; on the table please.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 02:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439565#M109707</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-02-23T02:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439574#M109715</link>
      <description>&lt;P&gt;Sounds like you have a numeric column in Excel&amp;nbsp;where&amp;nbsp;some cells are using one display format and other cells are using a different display format.&amp;nbsp; That can work in a spreadsheet since you can treat each cell as a totally independent object.&amp;nbsp; But in a dataset one variable can have only one type and one display format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you really want a variable that can have a value that displays as 8 for one observation and another value that displays as $200 on another then you need to make sure that the variable is a CHARACTER variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can force SAS to import your column from Excel as a character variable by making at least one of the cells in the column be an actual actual character value. SAS will&amp;nbsp;convert columns that have mixed numeric and character values into character variables in the SAS dataset.&amp;nbsp; But I am not sure that SAS will then add the dollar signs to numeric cells that have display format that adds dollar signs.&amp;nbsp; I think SAS will just convert the actual number that is stored in the cell into a string of digits.&amp;nbsp; So you might need to transform your full column to contain character values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another way is to instead create another column in your Excel file that you can use to tell you which format you want to use to transform the value in the&amp;nbsp;nuneric column.&amp;nbsp;&amp;nbsp;Then you could write some SAS code to use the PUTN() function to convert your numbers into the character strings that you want to see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 03:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439574#M109715</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-02-23T03:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439727#M109752</link>
      <description>Guessing rows doesnt work with DBMS=XLSX&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT OUT= WORK.input_metadata DATAFILE=&lt;BR /&gt;"C:\temp\reference.xlsx"&lt;BR /&gt;DBMS=xlsx REPLACE;&lt;BR /&gt;SHEET="input_Variables";&lt;BR /&gt;GETNAMES=YES;GUESSINGROWS=40;&lt;BR /&gt;RUN;&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;12096 SHEET="input_Variables";&lt;BR /&gt;12097 GETNAMES=YES;GUESSINGROWS=40;&lt;BR /&gt;------------&lt;BR /&gt;180&lt;BR /&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Feb 2018 15:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439727#M109752</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-02-23T15:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Excel Import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439735#M109755</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;BR /&gt;In excel:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 15:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excel-Import/m-p/439735#M109755</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2018-02-23T15:36:37Z</dc:date>
    </item>
  </channel>
</rss>

