<?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: Can we round all the numeric variables to one length (format) at once? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785613#M250750</link>
    <description>&lt;P&gt;ALL numeric variables use the list word _numeric_.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Format _numeric_&amp;nbsp; f8.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actual round isn't much harder:&lt;/P&gt;
&lt;PRE&gt;data new;
   set old;
   array _nn (*) _numeric_;
   do i=1 to dim (_nn);
      _nn[i] = round(_nn[i], 0.1);
   end;
   drop i;
run;&lt;/PRE&gt;
&lt;P&gt;make sure to pick an array name that doesn't duplicate that of an existing variable.&lt;/P&gt;</description>
    <pubDate>Sun, 12 Dec 2021 04:01:11 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-12-12T04:01:11Z</dc:date>
    <item>
      <title>Can we round all the numeric variables to one length (format) at once?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785566#M250720</link>
      <description>&lt;P&gt;I have the different numeric variable with different number of digits after the decimal. Is it possible to&amp;nbsp; convert them to same number of digits after decimal in one attempt by ROUNDING the digits, instead of applying the format each variable separately. Thank you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data orci;
 input effect$ a b c d e f;
 cards;
 points 1.05 1.055 1.0554 1.05545 1.055454 1.055455
;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785566#M250720</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-12-11T17:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can we round all the numeric variables to one length (format) at once?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785579#M250722</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350312"&gt;@SASuserlot&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Is it possible to&amp;nbsp; convert them to same number of digits after decimal in one attempt by ROUNDING the digits, instead of applying the format each variable separately. &lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You could round the values one variable at a time, I don't see how that's any better than formatting each variable separately. And it really isn't that hard to format each variable in one line of code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format a--f 10.2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact, in my opinion, rounding the values is a poor decision, if there are additional calculations that will be performed on this data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which brings up the question ... why do you ask? What is the reason for either rounding them all or formatting them all?&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:39:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785579#M250722</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-12-11T17:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can we round all the numeric variables to one length (format) at once?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785580#M250723</link>
      <description>&lt;P&gt;Thank you so much. Yes agree with you, in case if any additional calculations. In my case, these numbers at the end of all the calculations . Thanks again.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785580#M250723</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-12-11T17:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can we round all the numeric variables to one length (format) at once?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785613#M250750</link>
      <description>&lt;P&gt;ALL numeric variables use the list word _numeric_.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Format _numeric_&amp;nbsp; f8.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actual round isn't much harder:&lt;/P&gt;
&lt;PRE&gt;data new;
   set old;
   array _nn (*) _numeric_;
   do i=1 to dim (_nn);
      _nn[i] = round(_nn[i], 0.1);
   end;
   drop i;
run;&lt;/PRE&gt;
&lt;P&gt;make sure to pick an array name that doesn't duplicate that of an existing variable.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-round-all-the-numeric-variables-to-one-length-format-at/m-p/785613#M250750</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-12T04:01:11Z</dc:date>
    </item>
  </channel>
</rss>

