<?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 changing a variable attribute in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/changing-a-variable-attribute/m-p/418600#M67762</link>
    <description>&lt;P&gt;I am trying to merge two files into a new combined file. Both files have many of the same variables. I am getting an error message on merging that says something to the effect "variables are both character and numeric." For example, there is one variable called "extract_month." In one file it is listed as "char" and in the other "numeric".&amp;nbsp; (no idea how this happened!). I went into the attributes to change one from char to numeric but I can't change. I am only assuming this is the only problem with the merge. Any idea how to fix it? Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2017 20:58:23 GMT</pubDate>
    <dc:creator>pammers</dc:creator>
    <dc:date>2017-12-05T20:58:23Z</dc:date>
    <item>
      <title>changing a variable attribute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-a-variable-attribute/m-p/418600#M67762</link>
      <description>&lt;P&gt;I am trying to merge two files into a new combined file. Both files have many of the same variables. I am getting an error message on merging that says something to the effect "variables are both character and numeric." For example, there is one variable called "extract_month." In one file it is listed as "char" and in the other "numeric".&amp;nbsp; (no idea how this happened!). I went into the attributes to change one from char to numeric but I can't change. I am only assuming this is the only problem with the merge. Any idea how to fix it? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 20:58:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-a-variable-attribute/m-p/418600#M67762</guid>
      <dc:creator>pammers</dc:creator>
      <dc:date>2017-12-05T20:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: changing a variable attribute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-a-variable-attribute/m-p/418602#M67763</link>
      <description>&lt;P&gt;You can't change a variable type once it exists. You can drop the variable and recreate it however as a character/numeric.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it's usually easier to go back in your steps and fix that variable from the start.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should the variable be numeric or character is the first question? - that's a business use/knowledge question that we can't answer&lt;/P&gt;
&lt;P&gt;Why isn't it the correct type? - import from Excel where it assumed types, or from PROC IMPORT?&lt;/P&gt;
&lt;P&gt;Where to fix it? - Ideally in the import step but you can also fix it after the fact.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do a SQL merge you can fix it in the join directly as well.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 21:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-a-variable-attribute/m-p/418602#M67763</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-05T21:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: changing a variable attribute</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/changing-a-variable-attribute/m-p/418604#M67764</link>
      <description>&lt;P&gt;You have to convert one of the variables, so that both have the same type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://support.sas.com/kb/24/590.html" target="_blank"&gt;http://support.sas.com/kb/24/590.html&lt;/A&gt; and &lt;A href="https://blogs.sas.com/content/sgf/2017/03/28/changing-variable-type-and-variable-length-in-sas-datasets/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2017/03/28/changing-variable-type-and-variable-length-in-sas-datasets/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check the programs that created the two datasets, maybe you can already change it there.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 21:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/changing-a-variable-attribute/m-p/418604#M67764</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2017-12-05T21:06:01Z</dc:date>
    </item>
  </channel>
</rss>

