<?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 All variables to Character in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63540#M18072</link>
    <description>There is a macro on tech support web site that does this...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/22/218.html" target="_blank"&gt;http://support.sas.com/kb/22/218.html&lt;/A&gt;</description>
    <pubDate>Wed, 12 Aug 2009 16:08:18 GMT</pubDate>
    <dc:creator>LAP</dc:creator>
    <dc:date>2009-08-12T16:08:18Z</dc:date>
    <item>
      <title>Converting All variables to Character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63537#M18069</link>
      <description>Hi, &lt;BR /&gt;
&lt;BR /&gt;
I have a dataset with around 600 attributes. Couple of them are numeric and others character. Is there a way I can convert all of them to character of length 20 in a single go?&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 12 Aug 2009 05:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63537#M18069</guid>
      <dc:creator>tejeshwar</dc:creator>
      <dc:date>2009-08-12T05:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Converting All variables to Character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63538#M18070</link>
      <description>I suggest that you write a macro that reads out all numeric variables in the table, create assignment statements using the put function, and drops the original numeric variables.&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 12 Aug 2009 07:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63538#M18070</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-08-12T07:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting All variables to Character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63539#M18071</link>
      <description>Do you presume that these SAS NUMERIC variables are decimal (using a SAS-default output FORMAT)?  And where there is a specific output FORMAT, you would likely want to use that format in any "generated" code used with SAS DATA step assignment statements, as mentioned by Linus H.  And, so, would the output be left-justified or right-justified in the SAS CHARACTER, length $20, converted variable values?&lt;BR /&gt;
&lt;BR /&gt;
So, you could make use of the SAS-maintained views SASHELP.VCOLUMN to interrogate your tables, which could be used to generate SAS DATA step code for assigning the CHARACTER variables.  After using SAS code to generate the SAS code out to a TEMP external (sequential) file, you would %INCLUDE that code to create the new SAS variables (possibly, hopefully in a different SAS table).&lt;BR /&gt;
&lt;BR /&gt;
Of course, questions to ask:  why do you want to do this?  what is your quest?&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 12 Aug 2009 16:01:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63539#M18071</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-08-12T16:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting All variables to Character</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63540#M18072</link>
      <description>There is a macro on tech support web site that does this...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/22/218.html" target="_blank"&gt;http://support.sas.com/kb/22/218.html&lt;/A&gt;</description>
      <pubDate>Wed, 12 Aug 2009 16:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Converting-All-variables-to-Character/m-p/63540#M18072</guid>
      <dc:creator>LAP</dc:creator>
      <dc:date>2009-08-12T16:08:18Z</dc:date>
    </item>
  </channel>
</rss>

