<?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 Round down by 500 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709380#M218124</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to round down by 500.&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;870 will be rounded to 500&lt;/P&gt;
&lt;P&gt;1020 will be rounded to 1000&lt;/P&gt;
&lt;P&gt;2580 will be rounded to 2500&lt;/P&gt;
&lt;P&gt;2900 will be rounded to&amp;nbsp; to 2500&lt;/P&gt;
&lt;P&gt;what is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t;
input x;
cards;
870
1020
2580
2900
;
run;
data t2;
set t;
newvalue1 = round(x,500);
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 08:23:48 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2021-01-05T08:23:48Z</dc:date>
    <item>
      <title>Round down by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709380#M218124</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to round down by 500.&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;870 will be rounded to 500&lt;/P&gt;
&lt;P&gt;1020 will be rounded to 1000&lt;/P&gt;
&lt;P&gt;2580 will be rounded to 2500&lt;/P&gt;
&lt;P&gt;2900 will be rounded to&amp;nbsp; to 2500&lt;/P&gt;
&lt;P&gt;what is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t;
input x;
cards;
870
1020
2580
2900
;
run;
data t2;
set t;
newvalue1 = round(x,500);
 run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 08:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709380#M218124</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-01-05T08:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Round down by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709381#M218125</link>
      <description>&lt;P&gt;I&amp;nbsp; know this way but maybe have better solution&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t2;
set t;
newvalue1 = round(x,500);
if newvalue1&amp;gt;x then newvalue2=newvalue1-500;else newvalue2=newvalue1;
 run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2021 08:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709381#M218125</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2021-01-05T08:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Round down by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709382#M218126</link>
      <description>&lt;P&gt;How about&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data t;
input x;
cards;
870
1020
2580
2900
;

data want;
   set t;
   y = x - mod(x, 500);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2021 08:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709382#M218126</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-01-05T08:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Round down by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709391#M218131</link>
      <description>&lt;P&gt;As you see, the ROUND function doesn't round down, it rounds to the nearest 500. The fix is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;newvalue1 = round(x-250,500);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2021 11:32:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-down-by-500/m-p/709391#M218131</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-01-05T11:32:19Z</dc:date>
    </item>
  </channel>
</rss>

