<?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 Decimal to Numeric conversion in SAS EG in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345545#M22862</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How will I be able to convert decimal field to a numeric field in SAS EG?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ex: I would like to convert 100.00 to 10000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any information would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2017 21:04:35 GMT</pubDate>
    <dc:creator>ramya4</dc:creator>
    <dc:date>2017-03-29T21:04:35Z</dc:date>
    <item>
      <title>Decimal to Numeric conversion in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345545#M22862</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How will I be able to convert decimal field to a numeric field in SAS EG?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For ex: I would like to convert 100.00 to 10000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any information would be much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 21:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345545#M22862</guid>
      <dc:creator>ramya4</dc:creator>
      <dc:date>2017-03-29T21:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to Numeric conversion in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345553#M22863</link>
      <description>&lt;P&gt;SAS only has two data types; numeric and character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your example is a bit confusing; you appear to be converting the number 100 to 10000.&lt;/P&gt;
&lt;P&gt;Is that what you desire?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 21:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345553#M22863</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-03-29T21:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to Numeric conversion in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345567#M22864</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/136535"&gt;@ramya4&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How will I be able to convert decimal field to a numeric field in SAS EG?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For ex: I would like to convert 100.00 to 10000.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any information would be much appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suspect you read the data incorrectly in the first place. Perhaps fix at the source instead of after?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 22:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345567#M22864</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-29T22:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to Numeric conversion in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345826#M22882</link>
      <description>&lt;P&gt;To change 100.00 to 10000 you just need to multiply by 100.&lt;/P&gt;
&lt;P&gt;SAS only has one type for storing numbers.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is it that prompted the question? &amp;nbsp;One possibilty is the miss use of INFORMATs. &amp;nbsp;With a SAS format you can specify the number of decimal places you want it to use by default when displaying your variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;attrib HEIGHT length=8 format=5.3 label='Height in meters';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When reading data using INformats you can also specify a number of decimal places, but the meaning is completely different. On an INFORMAT the meaning of a non-zero specification of number of digits to the right of the decimal place is where should SAS assume the the decimal point is when there isn't one in the data. &amp;nbsp;So if you were writng the above HEIGHT variable to a text file you could save one bytes per value by not wrting the decimal point. &amp;nbsp;So 1.567 would be written as '1567'. &amp;nbsp;You could then read that using the informat 4.3 and it would convert '1567' to the number 1.567. &amp;nbsp;Note that if there is a decimal point in the string then the implied decimal point is not added. So '13.3' would be read as 13.3 and not as 1.33 or something else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you read the string '10000' using the informat 6.2 it would generate the number 100.00 instead of the number 10,000.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 16:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345826#M22882</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-03-30T16:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to Numeric conversion in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345890#M22884</link>
      <description>&lt;P&gt;Thanks all for providing the inputs. I figured out the function for doing that. I basically wanted to remove decimal point in the number and write the number as a whole number in the output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: If I am reading the number as 100.00, I wanted to write it as 10000. We could actually do that using the COMPRESS function in SAS EG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;COMPRESS(&amp;amp;STR,10.2),'.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345890#M22884</guid>
      <dc:creator>ramya4</dc:creator>
      <dc:date>2017-03-30T18:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Decimal to Numeric conversion in SAS EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345914#M22887</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/136535"&gt;@ramya4&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks all for providing the inputs. I figured out the function for doing that. I basically wanted to remove decimal point in the number and write the number as a whole number in the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex: If I am reading the number as 100.00, I wanted to write it as 10000. We could actually do that using the COMPRESS function in SAS EG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;COMPRESS(&amp;amp;STR,10.2),'.'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's not a number then, it's a string and &lt;STRONG&gt;that's not a valid or correct use of the COMPRESS function.&lt;/STRONG&gt;&amp;nbsp;If it worked, it was entirely an accident.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 19:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Decimal-to-Numeric-conversion-in-SAS-EG/m-p/345914#M22887</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-30T19:04:08Z</dc:date>
    </item>
  </channel>
</rss>

