<?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: PROC APPEND with new columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-APPEND-with-new-columns/m-p/379483#M91355</link>
    <description>&lt;P&gt;proc appends by name as you have different names as amount1 and amount2, they are trated as sperate variables. you have 2 options here. First one&amp;nbsp; is rename amount 2 to amount1 or&amp;nbsp; do insert as insert does not care for names and appending is done by position&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;insert into tableA&lt;/P&gt;
&lt;P&gt;select * from tableB;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2017 17:34:35 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2017-07-26T17:34:35Z</dc:date>
    <item>
      <title>PROC APPEND with new columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-APPEND-with-new-columns/m-p/379467#M91344</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table A like this:&lt;/P&gt;&lt;PRE&gt;Name Amount1
aaa       32
bbb       23&lt;/PRE&gt;&lt;P&gt;Another table B like this&lt;/P&gt;&lt;PRE&gt;Name Amount2
ccc        41
ddd       14&lt;/PRE&gt;&lt;P&gt;I try to append them in a C table like this:&lt;/P&gt;&lt;PRE&gt;Name Amount1 Amount2
aaa       32               .
bbb       23               .
ccc        .                41
ddd      .                  14&lt;/PRE&gt;&lt;P&gt;I do this&lt;/P&gt;&lt;PRE&gt;data C;
set A;
run;

PROC APPEND BASE=C DATA=B force;QUIT;&lt;/PRE&gt;&lt;P&gt;And I have this two warnings:&lt;/P&gt;&lt;PRE&gt;WARNING: Variable Amount2 was not found on BASE file. The variable will not be added to the BASE file.
WARNING: Variable Amount1 was not found on DATA file.&lt;/PRE&gt;&lt;P&gt;Finally my table C doesn't have the Amount2 column.&lt;/P&gt;&lt;P&gt;How can I manage it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for answer&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 17:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-APPEND-with-new-columns/m-p/379467#M91344</guid>
      <dc:creator>FP12</dc:creator>
      <dc:date>2017-07-26T17:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC APPEND with new columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-APPEND-with-new-columns/m-p/379483#M91355</link>
      <description>&lt;P&gt;proc appends by name as you have different names as amount1 and amount2, they are trated as sperate variables. you have 2 options here. First one&amp;nbsp; is rename amount 2 to amount1 or&amp;nbsp; do insert as insert does not care for names and appending is done by position&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;insert into tableA&lt;/P&gt;
&lt;P&gt;select * from tableB;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 17:34:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-APPEND-with-new-columns/m-p/379483#M91355</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-07-26T17:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC APPEND with new columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-APPEND-with-new-columns/m-p/379484#M91356</link>
      <description>&lt;P&gt;PROC APPEND cannot add new variables.&lt;/P&gt;
&lt;P&gt;If that's what you need use either a data step or SQL union.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;

set tableA tableB;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Jul 2017 17:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-APPEND-with-new-columns/m-p/379484#M91356</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-07-26T17:33:57Z</dc:date>
    </item>
  </channel>
</rss>

