<?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: How to append data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326857#M62354</link>
    <description>&lt;P&gt;I've tried PROC SQL.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2017 21:25:44 GMT</pubDate>
    <dc:creator>SKP</dc:creator>
    <dc:date>2017-01-23T21:25:44Z</dc:date>
    <item>
      <title>How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326852#M62350</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to append data from one table to the other and create new table with UNION ALL query, but got the error which seems to be due to NULL value in one of the field.&lt;/P&gt;&lt;P&gt;Can someone please let me know how I should do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I am trying to do:&lt;/P&gt;&lt;P&gt;In table 1, I have&lt;/P&gt;&lt;P&gt;Customer ID&lt;/P&gt;&lt;P&gt;Cutomer Name&lt;/P&gt;&lt;P&gt;Location&lt;/P&gt;&lt;P&gt;Product ID&lt;/P&gt;&lt;P&gt;Purchase amount in Jan&lt;/P&gt;&lt;P&gt;Purchase amount in Feb&lt;/P&gt;&lt;P&gt;Purchase amount in March&lt;/P&gt;&lt;P&gt;Purchase amount in April&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In table 2, I have&lt;/P&gt;&lt;P&gt;Cutomer Name&lt;/P&gt;&lt;P&gt;Product ID&lt;/P&gt;&lt;P&gt;Purchase amount in Jan&lt;/P&gt;&lt;P&gt;Purchase amount in Feb&lt;/P&gt;&lt;P&gt;Purchase amount in March&lt;/P&gt;&lt;P&gt;Purchase amount in April&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to append data in table 2 to table 1, and rename&amp;nbsp;it as C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;SKP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 21:19:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326852#M62350</guid>
      <dc:creator>SKP</dc:creator>
      <dc:date>2017-01-23T21:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326853#M62351</link>
      <description>&lt;P&gt;Please post the log and run a proc contents on both datasets, and post the output.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 21:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326853#M62351</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-23T21:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326854#M62352</link>
      <description>&lt;P&gt;Have you tried PROC APPEND or a data step?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set table1 table2;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 21:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326854#M62352</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-01-23T21:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326857#M62354</link>
      <description>&lt;P&gt;I've tried PROC SQL.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 21:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326857#M62354</guid>
      <dc:creator>SKP</dc:creator>
      <dc:date>2017-01-23T21:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326864#M62357</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have query as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Sql;&lt;/P&gt;&lt;P&gt;Create table C as&lt;/P&gt;&lt;P&gt;Select * from table 1&lt;/P&gt;&lt;P&gt;Union&lt;/P&gt;&lt;P&gt;Select * from table 2;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error log says:&lt;/P&gt;&lt;P&gt;Colum 1 from the first contributer of UNION is not the same type as its counterpart from the second&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;SKP&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 21:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326864#M62357</guid>
      <dc:creator>SKP</dc:creator>
      <dc:date>2017-01-23T21:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326868#M62359</link>
      <description>&lt;P&gt;PROC.CONTENTS.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 21:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326868#M62359</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-23T21:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326881#M62365</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76046"&gt;@SKP&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have query as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Sql;&lt;/P&gt;
&lt;P&gt;Create table C as&lt;/P&gt;
&lt;P&gt;Select * from table 1&lt;/P&gt;
&lt;P&gt;Union&lt;/P&gt;
&lt;P&gt;Select * from table 2;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error log says:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#ff00ff" size="3"&gt;&lt;STRONG&gt;Colum 1 from the first contributer of UNION is not the same type as its counterpart from the second&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;SKP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS requires variables to be of the same type when combining data in a column. So whatever is in the first column of TABLE 1 is not the same type as Table2. Either both character or both numeric.&lt;/P&gt;
&lt;P&gt;And your syntax won't run as you have spaces between table and&amp;nbsp;the 1 or 2.&lt;/P&gt;
&lt;P&gt;Proc contents on your data sets will tell you what variables are in each position and their data type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It helps when you have a error to COPY the code and any messages from the log and PASTE into a code box opened with the {i} forum icon. Error messages are sometimes position sensitive and the forum windows will alter the formatting from as displayed in the log window.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 22:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326881#M62365</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-23T22:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to append data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326928#M62369</link>
      <description>&lt;P&gt;ballardw&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your comment&lt;/P&gt;&lt;P&gt;I think I know what's wrong with my query now.&amp;nbsp; I'll try to fix and post another question if it's doen't work,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SKP&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 04:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-append-data/m-p/326928#M62369</guid>
      <dc:creator>SKP</dc:creator>
      <dc:date>2017-01-24T04:06:18Z</dc:date>
    </item>
  </channel>
</rss>

