<?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 handle the decimals in the following the data? COuld you please help me. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598986#M16406</link>
    <description>&lt;P&gt;Code is built on a logical specification. Without a logical rule for getting from A to B, nobody can do anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no (for me) discernible pattern in the data you gave us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2019 11:56:33 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-10-24T11:56:33Z</dc:date>
    <item>
      <title>How to handle the decimals in the following the data? COuld you please help me.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598969#M16397</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
input l $10.;
cards;
111.0000
1.0
0.00
0.000
0
22.120
262.100
run;

required output
111
1.0
0.00
0.0000
0
22.120
262.1&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598969#M16397</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2019-10-24T11:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the decimals in the following the data? COuld you please help me.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598977#M16399</link>
      <description>&lt;P&gt;What is the logic here? l is a character value, correct? Do you want the desired result to be character too?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598977#M16399</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-10-24T11:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the decimals in the following the data? COuld you please help me.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598978#M16400</link>
      <description>l is a character value, desired results needs to be in character.I too don't the logic I have data like this to show as required one.</description>
      <pubDate>Thu, 24 Oct 2019 11:33:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598978#M16400</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2019-10-24T11:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the decimals in the following the data? COuld you please help me.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598981#M16402</link>
      <description>&lt;P&gt;If you don't know what problem to solve, neither do we &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:36:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598981#M16402</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-10-24T11:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the decimals in the following the data? COuld you please help me.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598986#M16406</link>
      <description>&lt;P&gt;Code is built on a logical specification. Without a logical rule for getting from A to B, nobody can do anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no (for me) discernible pattern in the data you gave us.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/598986#M16406</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-24T11:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the decimals in the following the data? COuld you please help me.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/599034#M16416</link>
      <description>&lt;P&gt;Can you go back to the person who asked you to do this work and ask them, what are the rules that change "111.0000" to "111", "1.0" to "1.0" (same), ...,&amp;nbsp; "262.100" to "262.1"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the rule change based on the input value?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the number of non-zero digits affect the rules?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then you can share the rules here and someone should be able to help if you still have problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you get the solution yourself then please share that here too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 13:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/599034#M16416</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2019-10-24T13:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to handle the decimals in the following the data? COuld you please help me.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/599049#M16420</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/174522"&gt;@rajeshalwayswel&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It appears that you want to apply a &lt;EM&gt;conditional&lt;/EM&gt; format, i.e., one that depends on certain rules. So, maybe the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p12zqzvwx4dv6kn1p9crijxswolk.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;PUTN function&lt;/A&gt;&amp;nbsp;can be applied. But, as the others have pointed out, you need to know those "certain rules."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are two examples using rather arbitrary rules &lt;EM&gt;both of which produce the desired values&lt;/EM&gt; (in a character variable W in dataset WANT) &lt;EM&gt;for your sample data&lt;/EM&gt; using the &lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=n1n7bmvs1brl23n1dj9cbzau39df.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;&lt;EM&gt;w.d&lt;/EM&gt; format&lt;/A&gt;&amp;nbsp;with a varying value of&amp;nbsp;&lt;EM&gt;d&lt;/EM&gt;&amp;nbsp;and left-justified by the -l modifier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Values of&amp;nbsp;&lt;EM&gt;d&lt;/EM&gt; are pre-specified in an array:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
array d[7] _temporary_ (0,1,2,4,0,3,1);
set a;
length w $10;
w=putn(input(l,10.),cats('10.',d[_n_],'-l'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;[Fun solution:] Values of&amp;nbsp;&lt;EM&gt;d&lt;/EM&gt;&amp;nbsp;follow a random pattern (Poisson distribution with parameter 2):&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set a;
length w $10;
w=putn(input(l,10.),cats('10.',ranpoi(1382551861,2),'-l'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need the formatted value just for output (e.g. to a text file), the &lt;A href="https://documentation.sas.com/?docsetId=leforinforref&amp;amp;docsetTarget=n0gyd5fptpa0ufn100pj7ghozy6i.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;$VARYINGw. format&lt;/A&gt;&amp;nbsp;might be useful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example (similar to no. 1 above, but now the &lt;EM&gt;lengths&lt;/EM&gt; are pre-specified and the results are written to the &lt;EM&gt;log&lt;/EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
array len[7] _temporary_ (3,3,4,6,1,6,5);
set a;
w=put(input(l,10.),10.4-l);
varlen=len[_n_];
put w $varying10. varlen;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 14:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-handle-the-decimals-in-the-following-the-data-COuld-you/m-p/599049#M16420</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-10-24T14:29:11Z</dc:date>
    </item>
  </channel>
</rss>

