<?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: decimal points in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769051#M243972</link>
    <description>&lt;P&gt;Below some sample code for both a numerical and a character variable.&lt;/P&gt;
&lt;P&gt;If your variable is of type character then we must first convert the string to an number using an input statement and then use a put statement with a numerical format to create a string as you want it in your character variable. The character variable must have a length long enough to hold the additional 3 characters (the dot and two digits).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input @1 myvar_num @1 myvar_char $;
  datalines;
20010
20050
20070
20014
;
 
data want;
  set have;
  format myvar_num 16.2;
  myvar_char=put(input(myvar_char,best32.),16.2 -l);
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1632301253111.png" style="width: 313px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63851iA0FDDAB79BBBF4E3/image-dimensions/313x186?v=v2" width="313" height="186" role="button" title="Patrick_0-1632301253111.png" alt="Patrick_0-1632301253111.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Sep 2021 09:05:06 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2021-09-22T09:05:06Z</dc:date>
    <item>
      <title>decimal points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769028#M243958</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me to exhibit the numeric value with 2 decimal points as below&lt;/P&gt;&lt;P&gt;10010 should be represented as 10010.00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:04:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769028#M243958</guid>
      <dc:creator>r3570</dc:creator>
      <dc:date>2021-09-22T08:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: decimal points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769031#M243960</link>
      <description>&lt;P&gt;Apply an appropriate format&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   n = 10010;
   put n = 8.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:11:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769031#M243960</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-09-22T08:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: decimal points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769042#M243968</link>
      <description>&lt;P&gt;I am not able to get the required out put.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the values as below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;20010&lt;/P&gt;&lt;P&gt;20050&lt;/P&gt;&lt;P&gt;20070&lt;/P&gt;&lt;P&gt;20014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need the below output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;20010.00&lt;/P&gt;&lt;P&gt;20050.00&lt;/P&gt;&lt;P&gt;20070.00&lt;/P&gt;&lt;P&gt;20014.00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need a pgrm so that i can apply the same with minor changes.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769042#M243968</guid>
      <dc:creator>r3570</dc:creator>
      <dc:date>2021-09-22T08:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: decimal points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769044#M243970</link>
      <description>&lt;P&gt;See this for proof:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input number;
format number 8.2;
datalines;
20010
20050
20070
20014
;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;number
20010.00
20050.00
20070.00
20014.00&lt;/PRE&gt;
&lt;P&gt;If you have trouble with your application of this, please post the log.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:49:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769044#M243970</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-09-22T08:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: decimal points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769051#M243972</link>
      <description>&lt;P&gt;Below some sample code for both a numerical and a character variable.&lt;/P&gt;
&lt;P&gt;If your variable is of type character then we must first convert the string to an number using an input statement and then use a put statement with a numerical format to create a string as you want it in your character variable. The character variable must have a length long enough to hold the additional 3 characters (the dot and two digits).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input @1 myvar_num @1 myvar_char $;
  datalines;
20010
20050
20070
20014
;
 
data want;
  set have;
  format myvar_num 16.2;
  myvar_char=put(input(myvar_char,best32.),16.2 -l);
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1632301253111.png" style="width: 313px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/63851iA0FDDAB79BBBF4E3/image-dimensions/313x186?v=v2" width="313" height="186" role="button" title="Patrick_0-1632301253111.png" alt="Patrick_0-1632301253111.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 09:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/decimal-points/m-p/769051#M243972</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-09-22T09:05:06Z</dc:date>
    </item>
  </channel>
</rss>

