<?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: Length of decimal importing excel sheet in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Length-of-decimal-importing-excel-sheet/m-p/415971#M102123</link>
    <description>&lt;P&gt;There is a limit to the number of&amp;nbsp;decimal places in SAS.&amp;nbsp; If your number is bigger than that then you can either read that in as a text string, process it that way, round it in Excel, or use a third party library like python to process it.&lt;/P&gt;
&lt;P&gt;Try the advice in this thread:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Reading-Excel-file-with-large-decimal-Places/m-p/315172/highlight/true#M21270" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Reading-Excel-file-with-large-decimal-Places/m-p/315172/highlight/true#M21270&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Nov 2017 09:50:15 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-11-24T09:50:15Z</dc:date>
    <item>
      <title>Length of decimal importing excel sheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-decimal-importing-excel-sheet/m-p/415969#M102121</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm using SAS 9.3. I met a problem while importing excel sheet included a&amp;nbsp;number of 0.0655548562875890.&lt;/P&gt;&lt;P&gt;How should I do to import the entire number into SAS?&lt;/P&gt;&lt;P&gt;If I use BEST32., this number would be read as &lt;SPAN&gt;0.06555485628758...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It the limit length of decimal place of imported number is 14? If so, how to make it round off to 0.06555485628759?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is my&amp;nbsp;code&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname xl excel "xxxxxxx.xls" access=readonly header=yes;

proc sql;
create table outfile1 as
select SUBJID, SEX, RACE, AREA
    A1 format=30.20,
from xl.'Sheet1$'n;
select * from outfile1;
quit;

libname xl clear;

data want; set outfile1; format A1 BEST32.; run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 09:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-decimal-importing-excel-sheet/m-p/415969#M102121</guid>
      <dc:creator>JohnChen_TW</dc:creator>
      <dc:date>2017-11-24T09:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Length of decimal importing excel sheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-decimal-importing-excel-sheet/m-p/415971#M102123</link>
      <description>&lt;P&gt;There is a limit to the number of&amp;nbsp;decimal places in SAS.&amp;nbsp; If your number is bigger than that then you can either read that in as a text string, process it that way, round it in Excel, or use a third party library like python to process it.&lt;/P&gt;
&lt;P&gt;Try the advice in this thread:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/Reading-Excel-file-with-large-decimal-Places/m-p/315172/highlight/true#M21270" target="_blank"&gt;https://communities.sas.com/t5/SAS-Enterprise-Guide/Reading-Excel-file-with-large-decimal-Places/m-p/315172/highlight/true#M21270&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 09:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-decimal-importing-excel-sheet/m-p/415971#M102123</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-24T09:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Length of decimal importing excel sheet</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Length-of-decimal-importing-excel-sheet/m-p/416002#M102130</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out page 10 of the following paper &lt;A title="So, Your Data are in Excel!" href="http://www2.sas.com/proceedings/sugi31/020-31.pdf" target="_blank"&gt;So, Your Data are in Excel!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To explicitly change the type of the imported column(s), you use the dbsastype=() data set option for your Excel source sheet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is another paper worth look at&amp;nbsp; &lt;A title="The Little Engine That Could: Using LIBNAME Engine Options to Enhance Data  Transfers  Between SAS  and Microsoft Excel Files" href="http://support.sas.com/resources/papers/proceedings11/076-2011.pdf" target="_blank"&gt;The Little Engine That Could: Using LIBNAME Engine Options to Enhance Data Transfers Between SAS and Microsoft Excel Files&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This way you can preserve the accuracy of your incoming numbers as characters, and perform required manipulations.&lt;/P&gt;
&lt;P&gt;&lt;A title="DBSASTYPE= Data Set Option" href="http://support.sas.com/documentation/cdl/en/acpcref/63181/HTML/default/viewer.htm#p0w9ox0g4b3yphn1deuim9yvu092.htm" target="_blank"&gt;SAS Online Documentation - DBSASTYPE= Data Set Option&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 12:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Length-of-decimal-importing-excel-sheet/m-p/416002#M102130</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2017-11-24T12:30:35Z</dc:date>
    </item>
  </channel>
</rss>

