<?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 Converting char to numeric in macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-char-to-numeric-in-macro/m-p/422049#M103774</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/converting-numeric-to-character-and-vice-versa/m-p/175147#M33636" target="_self"&gt;I applied the code provided in this topic&lt;/A&gt;&amp;nbsp;to convert character variable to numeric, it works quite well for individual data sets.But when I apply the code in macro, I meet problems. When I use "proc sql" to find out character variables in data sets, SAS tells me that there are no character variables in the data sets but actually there are some. I don't know why, so could you kindly help me out?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro sic2_state(i,j);
	
	data &amp;amp;j&amp;amp;i;
		set &amp;amp;j&amp;amp;i;
	run;
	proc sql;
	create table char_cur&amp;amp;j&amp;amp;i as 
		select name from dictionary.columns where libname='WORK' and MEMNAME="&amp;amp;j&amp;amp;i" and type='char'; 
quit;
%mend;
%sic2_state(1999,Connecticut)
%sic2_state(1999,Florida)
%sic2_state(1999,Indiana)
%sic2_state(1999,Tennessee)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot! Cheers, Owen&lt;/P&gt;</description>
    <pubDate>Mon, 18 Dec 2017 17:44:48 GMT</pubDate>
    <dc:creator>owenwqp1</dc:creator>
    <dc:date>2017-12-18T17:44:48Z</dc:date>
    <item>
      <title>Converting char to numeric in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-char-to-numeric-in-macro/m-p/422049#M103774</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/converting-numeric-to-character-and-vice-versa/m-p/175147#M33636" target="_self"&gt;I applied the code provided in this topic&lt;/A&gt;&amp;nbsp;to convert character variable to numeric, it works quite well for individual data sets.But when I apply the code in macro, I meet problems. When I use "proc sql" to find out character variables in data sets, SAS tells me that there are no character variables in the data sets but actually there are some. I don't know why, so could you kindly help me out?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro sic2_state(i,j);
	
	data &amp;amp;j&amp;amp;i;
		set &amp;amp;j&amp;amp;i;
	run;
	proc sql;
	create table char_cur&amp;amp;j&amp;amp;i as 
		select name from dictionary.columns where libname='WORK' and MEMNAME="&amp;amp;j&amp;amp;i" and type='char'; 
quit;
%mend;
%sic2_state(1999,Connecticut)
%sic2_state(1999,Florida)
%sic2_state(1999,Indiana)
%sic2_state(1999,Tennessee)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot! Cheers, Owen&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 17:44:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-char-to-numeric-in-macro/m-p/422049#M103774</guid>
      <dc:creator>owenwqp1</dc:creator>
      <dc:date>2017-12-18T17:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: Converting char to numeric in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-char-to-numeric-in-macro/m-p/422071#M103775</link>
      <description>&lt;P&gt;Within dictionary.columns, all the MEMNAME values are stored in uppercase.&amp;nbsp; So the initial hurdle to overcome is to change the MEMNAME criterion to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and memname = upcase("&amp;amp;j&amp;amp;i")&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 18:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-char-to-numeric-in-macro/m-p/422071#M103775</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-12-18T18:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Converting char to numeric in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-char-to-numeric-in-macro/m-p/422192#M103810</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;
Thank you so much Astounding! That's the point! 
Regards,
Owen</description>
      <pubDate>Tue, 19 Dec 2017 03:36:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-char-to-numeric-in-macro/m-p/422192#M103810</guid>
      <dc:creator>owenwqp1</dc:creator>
      <dc:date>2017-12-19T03:36:14Z</dc:date>
    </item>
  </channel>
</rss>

