<?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 How to name decimal characters in SAS - Loop for data set in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238118#M55400</link>
    <description>&lt;P&gt;Good day SAS friends:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to know how to name this variable in the example, im working in categorical variables, so when the sample has no decimal characters, this means succes ("1") and when the characters have decimal characters means no succes ("0").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the data set and my programming (help me to fix it please):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data main;&lt;BR /&gt; input sample;&lt;BR /&gt; cards;&lt;BR /&gt; 23&lt;/P&gt;
&lt;P&gt;24&lt;/P&gt;
&lt;P&gt;25&lt;/P&gt;
&lt;P&gt;26.7&lt;/P&gt;
&lt;P&gt;28&lt;/P&gt;
&lt;P&gt;28.1&lt;/P&gt;
&lt;P&gt;28.2&lt;/P&gt;
&lt;P&gt;28.3&lt;BR /&gt; ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;BR /&gt; z = .;&lt;/P&gt;
&lt;P&gt;if sample = (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;number with no decimals&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;then do;&lt;/P&gt;
&lt;P&gt;z = 1;&lt;/P&gt;
&lt;P&gt;result = "Succes!";&lt;BR /&gt; end;&lt;BR /&gt; else if x = (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;number with decimals&lt;/STRONG&gt;&lt;/FONT&gt;) then do;&lt;/P&gt;
&lt;P&gt;z = 0;&lt;/P&gt;
&lt;P&gt;result = "No Succes";&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=want;&lt;BR /&gt; var sample z result;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 17:52:49 GMT</pubDate>
    <dc:creator>jonatan_velarde</dc:creator>
    <dc:date>2015-12-07T17:52:49Z</dc:date>
    <item>
      <title>How to name decimal characters in SAS - Loop for data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238118#M55400</link>
      <description>&lt;P&gt;Good day SAS friends:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to know how to name this variable in the example, im working in categorical variables, so when the sample has no decimal characters, this means succes ("1") and when the characters have decimal characters means no succes ("0").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the data set and my programming (help me to fix it please):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data main;&lt;BR /&gt; input sample;&lt;BR /&gt; cards;&lt;BR /&gt; 23&lt;/P&gt;
&lt;P&gt;24&lt;/P&gt;
&lt;P&gt;25&lt;/P&gt;
&lt;P&gt;26.7&lt;/P&gt;
&lt;P&gt;28&lt;/P&gt;
&lt;P&gt;28.1&lt;/P&gt;
&lt;P&gt;28.2&lt;/P&gt;
&lt;P&gt;28.3&lt;BR /&gt; ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;BR /&gt; z = .;&lt;/P&gt;
&lt;P&gt;if sample = (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;number with no decimals&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;/P&gt;
&lt;P&gt;then do;&lt;/P&gt;
&lt;P&gt;z = 1;&lt;/P&gt;
&lt;P&gt;result = "Succes!";&lt;BR /&gt; end;&lt;BR /&gt; else if x = (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;number with decimals&lt;/STRONG&gt;&lt;/FONT&gt;) then do;&lt;/P&gt;
&lt;P&gt;z = 0;&lt;/P&gt;
&lt;P&gt;result = "No Succes";&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=want;&lt;BR /&gt; var sample z result;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 17:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238118#M55400</guid>
      <dc:creator>jonatan_velarde</dc:creator>
      <dc:date>2015-12-07T17:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to name decimal characters in SAS - Loop for data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238122#M55401</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set main;
   z=0;
   result='No Succes';
   if index(sample,'.') then do;
     z = 1;
     result = "Succes!";
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Dec 2015 18:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238122#M55401</guid>
      <dc:creator>slchen</dc:creator>
      <dc:date>2015-12-07T18:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to name decimal characters in SAS - Loop for data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238128#M55404</link>
      <description>&lt;P&gt;If your data came in as numeric as you presented:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data main;
	input sample;
	cards;
 23
24
25
26.7
28
28.1
28.2
28.3
;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; want;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; main;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;length&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; result $ &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;10&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;z=sample=int(sample);&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; result=ifc(z=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'success'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'no success'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 18:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238128#M55404</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-12-07T18:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to name decimal characters in SAS - Loop for data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238142#M55407</link>
      <description>&lt;P&gt;Awesome&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank a lot !!!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 19:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-name-decimal-characters-in-SAS-Loop-for-data-set/m-p/238142#M55407</guid>
      <dc:creator>jonatan_velarde</dc:creator>
      <dc:date>2015-12-07T19:22:32Z</dc:date>
    </item>
  </channel>
</rss>

