<?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: How to pass variable  value to round function second argument in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831961#M328833</link>
    <description>&lt;P&gt;Depending the values of your second variable you may not immediately recognize that the Round worked as used though. SAS Round function doesn't complain about rounding to the nearest 6.07 for example.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Sep 2022 15:06:25 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-09-06T15:06:25Z</dc:date>
    <item>
      <title>How to pass variable  value to round function second argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831937#M328821</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to check whether possible to pass the variable value as the second argument in round function.&lt;/P&gt;&lt;P&gt;please help me how to pass the VAR2,VAR3 and VAR4 values in round function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data;&lt;/P&gt;&lt;P&gt;VAR1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VAR3&amp;nbsp; &amp;nbsp;VAR4&lt;/P&gt;&lt;P&gt;23.453472&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.01&amp;nbsp; &amp;nbsp; &amp;nbsp;0.001&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;new_var = round(VAR1,VAR2);&lt;/P&gt;&lt;P&gt;new_var1=round(VAR1,VAR3);&lt;/P&gt;&lt;P&gt;new_var2=round(VAR1,VAR4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Rajasekhar&amp;nbsp;&lt;/P&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, 06 Sep 2022 13:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831937#M328821</guid>
      <dc:creator>raja777pharma</dc:creator>
      <dc:date>2022-09-06T13:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass variable  value to round function second argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831940#M328823</link>
      <description>&lt;P&gt;There is nothing wrong with that syntax - it works just fine:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input VAR1 VAR2 VAR3 VAR4;
datalines;
23.453472  0.1  0.01 0.001
; 

data want;
	set have;
	new_var = round(VAR1,VAR2);
	new_var1=round(VAR1,VAR3);
	new_var2=round(VAR1,VAR4);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;VAR1&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;VAR2&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;VAR3&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;VAR4&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;new_var&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;new_var1&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;new_var2&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;23.4535&lt;/TD&gt;
&lt;TD class="r data"&gt;0.1&lt;/TD&gt;
&lt;TD class="r data"&gt;0.01&lt;/TD&gt;
&lt;TD class="r data"&gt;.001&lt;/TD&gt;
&lt;TD class="r data"&gt;23.5&lt;/TD&gt;
&lt;TD class="r data"&gt;23.45&lt;/TD&gt;
&lt;TD class="r data"&gt;23.453&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Sep 2022 13:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831940#M328823</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2022-09-06T13:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass variable  value to round function second argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831942#M328824</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you wonder if something is possible, just try it out.&lt;BR /&gt;In this case : there's no problem whatsoever !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
VAR1=23.453472;
VAR2=0.1;
VAR3=0.01;
VAR4=0.001;
new_var =round(VAR1,VAR2);
new_var1=round(VAR1,VAR3);
new_var2=round(VAR1,VAR4);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 13:44:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831942#M328824</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-09-06T13:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass variable  value to round function second argument</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831961#M328833</link>
      <description>&lt;P&gt;Depending the values of your second variable you may not immediately recognize that the Round worked as used though. SAS Round function doesn't complain about rounding to the nearest 6.07 for example.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 15:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-variable-value-to-round-function-second-argument/m-p/831961#M328833</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-09-06T15:06:25Z</dc:date>
    </item>
  </channel>
</rss>

