<?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: Round by 500 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959043#M374248</link>
    <description>&lt;P&gt;Exactly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input x expect;
cards;
17524.5   18000
25475.37  25000
6475.3     6000
;

data want;
  set have;
  round1000=round(x,1000);
  round500=round(x,500);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1739371918347.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104564iD43B19F35258B907/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1739371918347.png" alt="Tom_0-1739371918347.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2025 14:52:05 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-02-12T14:52:05Z</dc:date>
    <item>
      <title>Round by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959010#M374237</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to round the number by 500 (up or down)&lt;/P&gt;
&lt;P&gt;for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;17524.5&amp;nbsp;&amp;nbsp; will&amp;nbsp; be converted to&amp;nbsp;&amp;nbsp;18000&lt;/P&gt;
&lt;P&gt;25475.37 &amp;nbsp;will&amp;nbsp; be converted to&amp;nbsp; 25000&lt;/P&gt;
&lt;P&gt;6475.3 will&amp;nbsp; be converted to&amp;nbsp; 6000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;</description>
      <pubDate>Wed, 12 Feb 2025 07:01:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959010#M374237</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-02-12T07:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Round by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959012#M374239</link>
      <description>&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0tj6cmga7p8qln1ejh6ebevm0c9.htm#p0w8n7ebm8tf08n1go9n318wv1o8" target="_blank"&gt;SAS Help Center: ROUND Function&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 07:10:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959012#M374239</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2025-02-12T07:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Round by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959013#M374240</link>
      <description>&lt;P&gt;I think it is easy for you .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input have;
want=1000*round(have/1000);
cards;
17524.5  
25475.37 
6475.3 
;
proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Feb 2025 07:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959013#M374240</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-02-12T07:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Round by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959018#M374241</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;Like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* %let round_to=500; */
%let round_to=1000;

data test;
  do val=1,249.9,250,250.1,499.1,500,500.1,749.9,750,750.1,17524.5,25475.37,6475.3;
    round_val=round(val,&amp;amp;round_to);
    output;
  end;
run;

proc print data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Above updated after&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;'s remark&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 10:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959018#M374241</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-02-12T10:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Round by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959019#M374242</link>
      <description>&lt;P&gt;Given your examples, you want to round by 1000, not by 500.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to round the number by 500 (up or down)&lt;/P&gt;
&lt;P&gt;for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;17524.5&amp;nbsp;&amp;nbsp; will&amp;nbsp; be converted to&amp;nbsp;&amp;nbsp;18000&lt;/P&gt;
&lt;P&gt;25475.37 &amp;nbsp;will&amp;nbsp; be converted to&amp;nbsp; 25000&lt;/P&gt;
&lt;P&gt;6475.3 will&amp;nbsp; be converted to&amp;nbsp; 6000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 09:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959019#M374242</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-02-12T09:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Round by 500</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959043#M374248</link>
      <description>&lt;P&gt;Exactly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input x expect;
cards;
17524.5   18000
25475.37  25000
6475.3     6000
;

data want;
  set have;
  round1000=round(x,1000);
  round500=round(x,500);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1739371918347.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/104564iD43B19F35258B907/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1739371918347.png" alt="Tom_0-1739371918347.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 14:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Round-by-500/m-p/959043#M374248</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-12T14:52:05Z</dc:date>
    </item>
  </channel>
</rss>

