<?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: Converting Numeric Column into Character Column by a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60034#M12982</link>
    <description>A DATA step should satisfy your rqmt here - after inputting SAS CHARACTER variables to start with an INPUT Statement, then using various SAS functions like ANYALPHA / ANYDIGIT to test your strings, followed by the INPUT function to convert, as required, from character to numeric.  Lastly, consider the use of KEEP / DROP to only capture the SAS variables you require for the SAS output file/member/table.&lt;BR /&gt;
&lt;BR /&gt;
Below are a few examples of Google search arguments you can make use of, for searching the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website, which has much (free!) information including SAS-hosted DOC and supplemental technical / conference papers on this type of learning - topic.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
intro data step programming site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
intro input function site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
intro anyalpha anydigit function site:sas.com</description>
    <pubDate>Tue, 03 Aug 2010 14:29:29 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-08-03T14:29:29Z</dc:date>
    <item>
      <title>Converting Numeric Column into Character Column by a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60033#M12981</link>
      <description>Hi ,&lt;BR /&gt;
&lt;BR /&gt;
Please help me in coding below logic:&lt;BR /&gt;
&lt;BR /&gt;
Read the dataset and if dataset contains any numeric column then convert that column into character column. &lt;BR /&gt;
Ex:&lt;BR /&gt;
Dataset has two columns A and B. &lt;BR /&gt;
A   numeric 8 ;&lt;BR /&gt;
B   character 1 ;&lt;BR /&gt;
&lt;BR /&gt;
so here  Column A should become character column with length 256.&lt;BR /&gt;
&lt;BR /&gt;
Please note that we dont have fixed columns meaning dataset is created in a seprate program which doest have fixed columns.&lt;BR /&gt;
&lt;BR /&gt;
Many Thanks for your help.</description>
      <pubDate>Tue, 03 Aug 2010 13:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60033#M12981</guid>
      <dc:creator>SASACC</dc:creator>
      <dc:date>2010-08-03T13:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Numeric Column into Character Column by a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60034#M12982</link>
      <description>A DATA step should satisfy your rqmt here - after inputting SAS CHARACTER variables to start with an INPUT Statement, then using various SAS functions like ANYALPHA / ANYDIGIT to test your strings, followed by the INPUT function to convert, as required, from character to numeric.  Lastly, consider the use of KEEP / DROP to only capture the SAS variables you require for the SAS output file/member/table.&lt;BR /&gt;
&lt;BR /&gt;
Below are a few examples of Google search arguments you can make use of, for searching the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website, which has much (free!) information including SAS-hosted DOC and supplemental technical / conference papers on this type of learning - topic.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
intro data step programming site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
intro input function site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
intro anyalpha anydigit function site:sas.com</description>
      <pubDate>Tue, 03 Aug 2010 14:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60034#M12982</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-03T14:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Numeric Column into Character Column by a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60035#M12983</link>
      <description>Are you sure you really want to do this?  Do you really want to use a macro? &lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data class / view=class;&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   length dummy $32; /*or $256*/&lt;BR /&gt;
   retain dummy ' ';&lt;BR /&gt;
   run;&lt;BR /&gt;
proc transpose data=class out=class2(where=(_name_ ne 'dummy'));&lt;BR /&gt;
   var dummy _numeric_;&lt;BR /&gt;
   by name sex;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc transpose data=class2 out=class0(drop=_:);&lt;BR /&gt;
   var col1;&lt;BR /&gt;
   by name sex;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc contents varnum;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Tue, 03 Aug 2010 18:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60035#M12983</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-08-03T18:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Numeric Column into Character Column by a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60036#M12984</link>
      <description>If you really do want to use a more complicated macro solution take a look at Example A1.6.4 in Carpenter's Complete Guide to the SAS Macro Language, Second Edition</description>
      <pubDate>Wed, 04 Aug 2010 05:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-Numeric-Column-into-Character-Column-by-a-macro/m-p/60036#M12984</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2010-08-04T05:16:23Z</dc:date>
    </item>
  </channel>
</rss>

