DATA Step, Macro, Functions and more

How to append a table if it has more columns than base table used to append.

Accepted Solution Solved
Reply
Regular Contributor
Posts: 152
Accepted Solution

How to append a table if it has more columns than base table used to append.

Hi expert, 

i have a base table contain 5 columns and I have appending table has 8 columns.

the 5 columns are included within the 8 column.

when I use proc append with force option. The 3 columns not included are disappearing.

how do I append them using proc append and I can accept missing value

after appending.

 

thanks


Accepted Solutions
Solution
‎05-09-2017 06:16 AM
Super User
Super User
Posts: 7,942

Re: How to append a table if it has more columns than base table used to append.

Alwyas a good idea to post test data in the form of a datastep.  At a guess a simple set can do this:

data work.test1;
  a=1;
  b=4;
  c="1";
run;

data work.test2;
  a=.;
  c="RTY";
run;

data work.test3;
  c="";
run;

data want;
  set test:;
run;

View solution in original post


All Replies
Solution
‎05-09-2017 06:16 AM
Super User
Super User
Posts: 7,942

Re: How to append a table if it has more columns than base table used to append.

Alwyas a good idea to post test data in the form of a datastep.  At a guess a simple set can do this:

data work.test1;
  a=1;
  b=4;
  c="1";
run;

data work.test2;
  a=.;
  c="RTY";
run;

data work.test3;
  c="";
run;

data want;
  set test:;
run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 121 views
  • 1 like
  • 2 in conversation