<?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: Append datasets with type mismatch in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607800#M176757</link>
    <description>I convert all the numeric fields in each table to string and then union them together.</description>
    <pubDate>Wed, 27 Nov 2019 18:29:25 GMT</pubDate>
    <dc:creator>tomrvincent</dc:creator>
    <dc:date>2019-11-27T18:29:25Z</dc:date>
    <item>
      <title>Append datasets with type mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607775#M176747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a number of datasets (ds1, ds2, ds3, etc) that I want to append. However, several variables have different types (i.e. character or numeric) in different datasets, so when I use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data new;&lt;/P&gt;
&lt;P&gt;set ds:;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get the error message "Variable var1 has been defined as both character and numeric" etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to append the datasets and have all the variables without manually changing their types? They could all be stored as character&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607775#M176747</guid>
      <dc:creator>chris2377</dc:creator>
      <dc:date>2019-11-27T16:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Append datasets with type mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607785#M176749</link>
      <description>&lt;PRE&gt;Is there a way to append the datasets without changing types? &lt;/PRE&gt;
&lt;P&gt;NO, same variable cannot have different types.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Decide which type is proffered and change the type on the appropriate datasets or rename them to have different names.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 16:52:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607785#M176749</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-11-27T16:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Append datasets with type mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607799#M176756</link>
      <description>&lt;P&gt;One of the most common causes of this is use of Proc Import to read data. That means that you have no control over the variable types or lengths. If these data sets are supposed to be of the same structure you will be better off the long run by reading the data as needed, likely with a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also have issues with variables of the same type with different lengths. So if you are seeing notes related to that then you should also fix the length issues before combining the data.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 18:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607799#M176756</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-27T18:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Append datasets with type mismatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607800#M176757</link>
      <description>I convert all the numeric fields in each table to string and then union them together.</description>
      <pubDate>Wed, 27 Nov 2019 18:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Append-datasets-with-type-mismatch/m-p/607800#M176757</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2019-11-27T18:29:25Z</dc:date>
    </item>
  </channel>
</rss>

