<?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 statement in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375687#M3002</link>
    <description>&lt;P&gt;The statements will NOT produce the same result.&lt;/P&gt;
&lt;P&gt;Run this and look at the result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input numvar;
charvar1 = put(numvar,6.);
charvar2 = put(numvar,best6.);
cards;
1
6000
6.5431
1534.21
1109998
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note obs 3 and 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2017 13:56:27 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-07-13T13:56:27Z</dc:date>
    <item>
      <title>Put statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375682#M3001</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I came across the following Put statements to convert from numerical to character:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;char_var = put(num_var,6.);&lt;/PRE&gt;&lt;P&gt;apple1 = put(apple, 6);&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;apple1 = put(apple, best6.);&lt;/P&gt;&lt;P&gt;Run;&lt;BR /&gt;&lt;BR /&gt;Both statements will produce the same result.&lt;BR /&gt;My question are (1) why there are different syntax which can produce the same output, (2) what is the 'best' means, and (3) how do we know what is the value to put in the w.d format?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 13:35:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375682#M3001</guid>
      <dc:creator>potiu</dc:creator>
      <dc:date>2017-07-13T13:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Put statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375687#M3002</link>
      <description>&lt;P&gt;The statements will NOT produce the same result.&lt;/P&gt;
&lt;P&gt;Run this and look at the result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input numvar;
charvar1 = put(numvar,6.);
charvar2 = put(numvar,best6.);
cards;
1
6000
6.5431
1534.21
1109998
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note obs 3 and 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 13:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375687#M3002</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-13T13:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Put statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375689#M3003</link>
      <description>&lt;P&gt;As for your question 3:&lt;/P&gt;
&lt;P&gt;Maxim 3: Know your data.&lt;/P&gt;
&lt;P&gt;Inspect your dataset, run some statistics to see maximum and minimum values, see if x-int(x) gives you fractions, and so on.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 13:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375689#M3003</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-13T13:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Put statement</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375737#M3005</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/153220"&gt;@potiu&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;(1) why there are different syntax which can produce the same output,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is A LOT of 'different' syntax that can produce the same output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI - this is a PUT() function, there is a PUT statement and they do differ.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 15:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Put-statement/m-p/375737#M3005</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-13T15:25:47Z</dc:date>
    </item>
  </channel>
</rss>

