<?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: Create a new variable for rounding in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480176#M71533</link>
    <description>&lt;P&gt;Although you can create a new variable that is the rounded value, perhaps you really want a format to show the rounded value rather than a new variable? There's good reasons to do things your way, and there's good reasons to NOT do things your way. It depends.&lt;/P&gt;</description>
    <pubDate>Sat, 21 Jul 2018 18:54:43 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2018-07-21T18:54:43Z</dc:date>
    <item>
      <title>Create a new variable for rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480173#M71530</link>
      <description>&lt;P&gt;I have the following dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subject&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Score&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.432&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4.83455&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6.8333&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14.834&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i want:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subject&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Score&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Score_round&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.432&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4.83455&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 6.8333&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14.234&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I've only found (but only as an output):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; new&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;format&lt;/SPAN&gt; score &lt;SPAN class="token number"&gt;9.0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; old&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I ultimately want a new variable created in the dataset called score_round (from the score variable)&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 18:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480173#M71530</guid>
      <dc:creator>starz4ever2007</dc:creator>
      <dc:date>2018-07-21T18:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable for rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480174#M71531</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Subject       Score  ;              
cards;
1                  3.432
2                  4.83455
3                  6.8333
4                  14.834
5                  14.234 
;
data want;
set have;
score_round=round(score);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;did you try the round function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;score_round=round(score);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 18:49:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480174#M71531</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-21T18:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable for rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480175#M71532</link>
      <description>&lt;P&gt;thank you!! thought it was gonna be something more complicated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 18:52:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480175#M71532</guid>
      <dc:creator>starz4ever2007</dc:creator>
      <dc:date>2018-07-21T18:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable for rounding</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480176#M71533</link>
      <description>&lt;P&gt;Although you can create a new variable that is the rounded value, perhaps you really want a format to show the rounded value rather than a new variable? There's good reasons to do things your way, and there's good reasons to NOT do things your way. It depends.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jul 2018 18:54:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-a-new-variable-for-rounding/m-p/480176#M71533</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-21T18:54:43Z</dc:date>
    </item>
  </channel>
</rss>

