<?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: PUT function question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154564#M30309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does x resolve in your code? You've used comma between the values so I'm not sure how it calculates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px; font-family: 'Courier New'; color: #000000; background-color: #ffffff;"&gt;x = &lt;/SPAN&gt;&lt;STRONG style="font-size: 15px; font-family: 'Courier New'; color: #008080; background-color: #ffffff;"&gt;.33&lt;/STRONG&gt;&lt;SPAN style="font-size: 15px; font-family: 'Courier New'; color: #000000; background-color: #ffffff;"&gt;+&lt;/SPAN&gt;&lt;STRONG style="font-size: 15px; font-family: 'Courier New'; color: #008080; background-color: #ffffff;"&gt;.2199999999999995&lt;/STRONG&gt;&lt;SPAN style="font-size: 15px; font-family: 'Courier New'; color: #000000; background-color: #ffffff;"&gt;,-&lt;/SPAN&gt;&lt;STRONG style="font-size: 15px; font-family: 'Courier New'; color: #008080; background-color: #ffffff;"&gt;1e-16&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 15px; background-color: #ffffff;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Sep 2014 06:53:24 GMT</pubDate>
    <dc:creator>RamKumar</dc:creator>
    <dc:date>2014-09-23T06:53:24Z</dc:date>
    <item>
      <title>PUT function question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154560#M30305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the logic behind the PUT function to convert a numeric variable to character variiable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;consider two examples;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;value = 0.5500;&lt;/P&gt;&lt;P&gt;value1 = put(value, 16.1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above code correctly prints the value of value1 as 0.6 in the output dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in some scenarios, the value1 in the output dataset is being printed as 0.5(gets truncated instead of rounding). I couldnt identify where the issue is. could someone please help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 16:26:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154560#M30305</guid>
      <dc:creator>AKNagarajan</dc:creator>
      <dc:date>2014-09-22T16:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154561#M30306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will take a guess: numeric precision.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see: &lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#numvar.htm" title="http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#numvar.htm"&gt;SAS(R) 9.2 Companion for Windows, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 16:52:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154561#M30306</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-09-22T16:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154562#M30307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you Arthur. How we can resolve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 17:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154562#M30307</guid>
      <dc:creator>AKNagarajan</dc:creator>
      <dc:date>2014-09-22T17:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154563#M30308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The W.D format does not always round correctly.&amp;nbsp; The "classic" example to me is -0.0 below.&amp;nbsp; To solve it, round the value to the desired precision before using PUT function.&lt;/P&gt;&lt;DIV style="font-family: Courier New; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;data&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;_null_&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; a=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;.55&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; a=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;hex16.&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; x = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;.33&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;+&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;.2199999999999995&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;,-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1e-16&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = put(x,&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;16.1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = put(round(x,&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;.1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;),&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;16.1&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; x=&lt;/SPAN&gt;&lt;SPAN style="color: #008080; background-color: #ffffff;"&gt;hex16.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; x= y= z=;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;end&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;run&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;a=3FE199999999999A&lt;BR /&gt;x=3FE1999999999995 x=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0.55&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; y=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0.5&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; z=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0.6&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;x=BC9CD2B297D889BC x=-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;1E-16&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; y=-&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0.0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; z=&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0.0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 17:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154563#M30308</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-09-22T17:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154564#M30309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does x resolve in your code? You've used comma between the values so I'm not sure how it calculates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px; font-family: 'Courier New'; color: #000000; background-color: #ffffff;"&gt;x = &lt;/SPAN&gt;&lt;STRONG style="font-size: 15px; font-family: 'Courier New'; color: #008080; background-color: #ffffff;"&gt;.33&lt;/STRONG&gt;&lt;SPAN style="font-size: 15px; font-family: 'Courier New'; color: #000000; background-color: #ffffff;"&gt;+&lt;/SPAN&gt;&lt;STRONG style="font-size: 15px; font-family: 'Courier New'; color: #008080; background-color: #ffffff;"&gt;.2199999999999995&lt;/STRONG&gt;&lt;SPAN style="font-size: 15px; font-family: 'Courier New'; color: #000000; background-color: #ffffff;"&gt;,-&lt;/SPAN&gt;&lt;STRONG style="font-size: 15px; font-family: 'Courier New'; color: #008080; background-color: #ffffff;"&gt;1e-16&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; font-size: 15px; background-color: #ffffff;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 06:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154564#M30309</guid>
      <dc:creator>RamKumar</dc:creator>
      <dc:date>2014-09-23T06:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: PUT function question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154565#M30310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is iterative DO specifications connected by COMMA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4 class="xis-argument" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #353535; background-color: #ffffff;"&gt;&lt;SPAN class="xis-userSuppliedValue" style="font-style: italic;"&gt;specification&lt;/SPAN&gt;&lt;/H4&gt;&lt;P class="xis-argumentDescription" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; margin-left: 2em; color: #353535; background-color: #ffffff;"&gt;denotes an expression or a series of expressions in this form&lt;/P&gt;&lt;DIV class="xis-paraSimple" style="margin-top: 0.7em;"&gt;&lt;A id="n0b2g7b6p3xadrn10qmseocv2p5p" style="font-family: inherit;"&gt;&lt;/A&gt;&lt;SPAN class="xis-userSuppliedValue" style="font-style: italic;"&gt;start&lt;/SPAN&gt; &amp;lt;TO &lt;SPAN class="xis-userSuppliedValue" style="font-style: italic;"&gt;stop&lt;/SPAN&gt;&amp;gt; &amp;lt;BY &lt;SPAN class="xis-userSuppliedValue" style="font-style: italic;"&gt;increment&lt;/SPAN&gt;&amp;gt; &amp;lt;WHILE(&lt;SPAN class="xis-userSuppliedValue" style="font-style: italic;"&gt;expression&lt;/SPAN&gt;) | UNTIL(&lt;SPAN class="xis-userSuppliedValue" style="font-style: italic;"&gt;expression&lt;/SPAN&gt;)&amp;gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;in this case with only the START values specified similar to DO I=1,10,20; each comma specifies a separate specification.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;START STOP and BY can all be expressions as in this case add two numeric constants .33+.219999 comma then another expression (a numeric constant) -1E-16&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The DO iterates 2 times.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Sep 2014 10:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-function-question/m-p/154565#M30310</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-09-23T10:43:15Z</dc:date>
    </item>
  </channel>
</rss>

