<?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: Number values ending in &amp;quot;.00&amp;quot; being rounded incorrectly when imported from Excel workb in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861826#M42407</link>
    <description>&lt;P&gt;How are you importing in EG? Via the Import Data menu or using code?&lt;/P&gt;</description>
    <pubDate>Wed, 01 Mar 2023 19:12:18 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-03-01T19:12:18Z</dc:date>
    <item>
      <title>Number values ending in ".00" being rounded incorrectly when imported from Excel workbook</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861796#M42402</link>
      <description>&lt;P&gt;SAS EG Version: 7.15 (7.100.5.5850) (64-bit)&lt;BR /&gt;&lt;BR /&gt;I am importing data from an Excel workbook. One of my data columns is "Cost" (spend in USD). The column in Excel is formatted as Number. When importing this data into SAS the are usually no issues. However, if the "Cost" has zero cents, i.e. the value ends with ".00" (e.g. 1760.00), then SAS is dividing the number by 100/shifting the decimal place over 2 points. E.g. 1760.00 becomes 17.60&lt;BR /&gt;&lt;BR /&gt;The Source Informat and Output Format/Output Informat are BEST12.&lt;BR /&gt;&lt;BR /&gt;Can anyone assist in preventing this decimal shift from happening? I would just like to keep the imported number values as "XXXX.00"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clark__0-1677693274804.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81000i8DDD88C52A5C1229/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Clark__0-1677693274804.png" alt="Clark__0-1677693274804.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 17:56:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861796#M42402</guid>
      <dc:creator>Clark_</dc:creator>
      <dc:date>2023-03-01T17:56:56Z</dc:date>
    </item>
    <item>
      <title>Re: Number values ending in ".00" being rounded incorrectly when imported from Excel workb</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861826#M42407</link>
      <description>&lt;P&gt;How are you importing in EG? Via the Import Data menu or using code?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 19:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861826#M42407</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-03-01T19:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: Number values ending in ".00" being rounded incorrectly when imported from Excel workb</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861827#M42408</link>
      <description>I am importing via Import Data menu</description>
      <pubDate>Wed, 01 Mar 2023 19:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861827#M42408</guid>
      <dc:creator>Clark_</dc:creator>
      <dc:date>2023-03-01T19:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Number values ending in ".00" being rounded incorrectly when imported from Excel workb</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861828#M42409</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/440249"&gt;@Clark_&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your screenshot says that the "Source Informat" used for variable &lt;FONT face="courier new,courier"&gt;Cost&lt;/FONT&gt; was BEST12.&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;. And this decimal specification "&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/FONT&gt;" is the issue: It instructs SAS to &lt;EM&gt;assume&lt;/EM&gt;&amp;nbsp;that the last two digits of a number being read are decimals &lt;EM&gt;if&lt;/EM&gt; there is no decimal point. So, remove that "&lt;STRONG&gt;2&lt;/STRONG&gt;" from the informat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a SAS log showing again what happened:&lt;/P&gt;
&lt;PRE&gt;143   data _null_;
144   wrong=input('1760', 12.2);
145   put wrong= 12.2;
146   right=input('1760', 12.);
147   put right= 12.2;
148   run;

wrong=17.60
right=1760.00&lt;/PRE&gt;
&lt;P&gt;I used informats 12.2 and 12. as these are identical to the corresponding "BEST..." informats. Note that the 12.2 &lt;EM&gt;format&lt;/EM&gt; in the PUT statements does use the decimal specification because the BEST12. format would not show decimals for integer values or trailing zeros as in 17.6&lt;STRONG&gt;0&amp;nbsp;&lt;/STRONG&gt;(and it would ignore any decimal specification like "BEST12.&lt;EM&gt;2&lt;/EM&gt;").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="2"&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/440249"&gt;@Clark_&lt;/a&gt;&amp;nbsp;wrote:&lt;/FONT&gt;&lt;BR /&gt;I am importing via Import Data menu&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can change the source informat in step "3 of 4&amp;nbsp; &amp;nbsp;Define Field Attributes" [or similar; I don't have Excel on my workstation, tested it with a text file instead] of the import process (double-click the informat in question).&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861828#M42409</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-03-01T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Number values ending in ".00" being rounded incorrectly when imported from Excel workb</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861848#M42414</link>
      <description>That looks to have worked, thanks!</description>
      <pubDate>Wed, 01 Mar 2023 20:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Number-values-ending-in-quot-00-quot-being-rounded-incorrectly/m-p/861848#M42414</guid>
      <dc:creator>Clark_</dc:creator>
      <dc:date>2023-03-01T20:40:42Z</dc:date>
    </item>
  </channel>
</rss>

