<?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 numeric to character in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Converting-numeric-to-character/m-p/446551#M112046</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to convert 2 numeric variables (DemAffl &amp;amp; DemAge) from an existing data set to character variables on a new data set. I tried to use the informat statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sasuser.newset; 
set sasuser.organics(obs=20000);
informat ID $10. DemAffl $10. DemAge $8. DemCluster $2. DemClusterGroup $1. DemGender $1. DemReg $10. 
DemTVReg $12. PromClass $8. PromSpend 8.2 PromTime 8. TargetAmt 8. TargetBuy 8.;
run;&lt;/CODE&gt;&lt;/PRE&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;&lt;P&gt;But it is not working &amp;amp; the log shows the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;WARNING: Variable DemAffl has already been defined as numeric.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: Variable DemAge has already been defined as numeric.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attaching the proc contents output below for reference,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Proc contents.JPG" style="width: 591px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19270i7001A30BAA0A134C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Proc contents.JPG" alt="Proc contents.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Mar 2018 09:29:30 GMT</pubDate>
    <dc:creator>maggi</dc:creator>
    <dc:date>2018-03-18T09:29:30Z</dc:date>
    <item>
      <title>Converting numeric to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-numeric-to-character/m-p/446551#M112046</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to convert 2 numeric variables (DemAffl &amp;amp; DemAge) from an existing data set to character variables on a new data set. I tried to use the informat statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sasuser.newset; 
set sasuser.organics(obs=20000);
informat ID $10. DemAffl $10. DemAge $8. DemCluster $2. DemClusterGroup $1. DemGender $1. DemReg $10. 
DemTVReg $12. PromClass $8. PromSpend 8.2 PromTime 8. TargetAmt 8. TargetBuy 8.;
run;&lt;/CODE&gt;&lt;/PRE&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;&lt;P&gt;But it is not working &amp;amp; the log shows the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;WARNING: Variable DemAffl has already been defined as numeric.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#339966"&gt;WARNING: Variable DemAge has already been defined as numeric.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attaching the proc contents output below for reference,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Proc contents.JPG" style="width: 591px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19270i7001A30BAA0A134C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Proc contents.JPG" alt="Proc contents.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Mar 2018 09:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-numeric-to-character/m-p/446551#M112046</guid>
      <dc:creator>maggi</dc:creator>
      <dc:date>2018-03-18T09:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Converting numeric to character</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Converting-numeric-to-character/m-p/446553#M112047</link>
      <description>Informat statement does not convert anything. It adds metadata to the variables listed. &lt;BR /&gt;Use the PUT function to create character variables (And INPUT function to create numerical ones).</description>
      <pubDate>Sun, 18 Mar 2018 10:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Converting-numeric-to-character/m-p/446553#M112047</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-03-18T10:13:37Z</dc:date>
    </item>
  </channel>
</rss>

