<?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: FIND numeric in chracter coloumn in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230353#M54482</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;
&lt;P&gt;so I have to check if there is any character in coloumn(A) FLAG as 'fail' else "pass'(i.e 'a' or 'b' .......'z')&lt;/P&gt;
&lt;P&gt;and also same if there is any number in coloumn(A)&amp;nbsp;&lt;SPAN&gt; FLAG as 'fail' else "pass'&lt;/SPAN&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like you always get "fail" as the answer based on the above explanation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Oct 2015 19:47:38 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2015-10-16T19:47:38Z</dc:date>
    <item>
      <title>FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230346#M54480</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have a character coloumn&lt;/P&gt;
&lt;P&gt;ex; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 121egghhh&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; hfghhhdjdj&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 5656566&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; tt4556hyjh&lt;/P&gt;
&lt;P&gt;so I have to check if there is any character in coloumn(A) FLAG as 'fail' else "pass'(i.e 'a' or 'b' .......'z')&lt;/P&gt;
&lt;P&gt;and also same if there is any number in coloumn(A)&amp;nbsp;&lt;SPAN&gt; FLAG as 'fail' else "pass'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;can anyone provide me the code &amp;nbsp;in proc sql&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 19:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230346#M54480</guid>
      <dc:creator>siddharthpeesary</dc:creator>
      <dc:date>2015-10-16T19:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230351#M54481</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The following code works very well in sql and SAS Data step&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  length char $ 20;
  input char;
  cards;
121egghhh
hfghhhdjdj
5656566
tt4556hyj
;
run;


data test2;
  set test;
  CourseNum = compress(char, ' ', 'A');
  if compress(char, ' ', 'A') then flg = "fail";
  else flg = "pass"; 
run;

/*SQL*/

proc sql;
  create table test2 as 
     select char,
	 		compress(char, ' ', 'A') as CourseNum,
			case when compress(char, ' ', 'A') then 
			"fail"
			else "pass"
			end as flg
	 from test;
quit;	
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Att&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 19:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230351#M54481</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-10-16T19:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230353#M54482</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;
&lt;P&gt;so I have to check if there is any character in coloumn(A) FLAG as 'fail' else "pass'(i.e 'a' or 'b' .......'z')&lt;/P&gt;
&lt;P&gt;and also same if there is any number in coloumn(A)&amp;nbsp;&lt;SPAN&gt; FLAG as 'fail' else "pass'&lt;/SPAN&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Seems like you always get "fail" as the answer based on the above explanation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 19:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230353#M54482</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-16T19:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230366#M54483</link>
      <description>&lt;P&gt;Thank you so much..&lt;/P&gt;
&lt;P&gt;so when we have chracters in coloumn we will get false&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;numbers in coloumn thenwe will get true right.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 20:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230366#M54483</guid>
      <dc:creator>siddharthpeesary</dc:creator>
      <dc:date>2015-10-16T20:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230369#M54484</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@siddharthpeesary wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much..&lt;/P&gt;
&lt;P&gt;so when we have chracters in coloumn we will get false&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;numbers in coloumn thenwe will get true right.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well I guess it doesn't matter if you have the proper solution, but I would still like to understand&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is "false" the same as "fail" and "true" the same as "pass"?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and what happens when you have both numbers and characters in this variable?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 20:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230369#M54484</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-16T20:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230370#M54485</link>
      <description>&lt;P&gt;Hi miller,&lt;/P&gt;
&lt;P&gt;sorry for the late &amp;nbsp;reply.&lt;/P&gt;
&lt;P&gt;actually i have to validate &lt;STRONG&gt;balance&lt;/STRONG&gt; coloumn so that if there is any &lt;STRONG&gt;character&lt;/STRONG&gt; in coloumn then i should show a flag as &lt;STRONG&gt;fail&lt;/STRONG&gt; else &lt;STRONG&gt;pass&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 20:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230370#M54485</guid>
      <dc:creator>siddharthpeesary</dc:creator>
      <dc:date>2015-10-16T20:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230372#M54486</link>
      <description>false is same as fail&lt;BR /&gt;true is  same as pass&lt;BR /&gt;  so I have list of balances in a coloumn . so when ever ia m encountered with character mixed with it i should get fail else pass&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Oct 2015 20:47:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230372#M54486</guid>
      <dc:creator>siddharthpeesary</dc:creator>
      <dc:date>2015-10-16T20:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230392#M54489</link>
      <description>&lt;P&gt;Hi, how about&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;FONT&gt;&lt;FONT&gt; ...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;data test2;&lt;BR /&gt;set test;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;* input only digits ... course number is numeric;&lt;BR /&gt;coursenum = input(compress(char,,'KD'),20.);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;* flag any character than is not a number or a space;&lt;BR /&gt;flg1 = ifc(findc(char,,'KDS'), 'fail', 'pass');&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;* flag any alpha character;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;flg2 = ifc(anyalpha(char), 'fail', 'pass');&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;run;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;The result appears to fit your rule ... "if there is any character in coloumn then i should show a flag as fail else pass".&amp;nbsp; The accepted correct solution gives a different result.&amp;nbsp; Also, use of ...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;if compress(char, ' ', 'A') then flg = "fail";&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;FONT&gt;in that solution will give you a note in the LOG about character-to-numeric conversion. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coursenum&amp;nbsp;&amp;nbsp;&amp;nbsp; flg1&amp;nbsp;&amp;nbsp;&amp;nbsp; flg2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 121egghhh&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 121&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fail&amp;nbsp;&amp;nbsp;&amp;nbsp; fail&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hfghhhdjdj&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fail&amp;nbsp;&amp;nbsp;&amp;nbsp; fail&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5656566&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5656566&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tt4556hyj&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4556&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fail&amp;nbsp;&amp;nbsp;&amp;nbsp; fail&lt;/STRONG&gt;&lt;/FONT&gt;&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>Sat, 17 Oct 2015 15:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230392#M54489</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-17T15:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: FIND numeric in chracter coloumn</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230577#M54502</link>
      <description>Thank you Mike...! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Oct 2015 14:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/FIND-numeric-in-chracter-coloumn/m-p/230577#M54502</guid>
      <dc:creator>siddharthpeesary</dc:creator>
      <dc:date>2015-10-19T14:09:59Z</dc:date>
    </item>
  </channel>
</rss>

