06-14-2012 01:20 PM
I have two tables and one of them I want to copy all the data into the base table. both tables have same rows, column headers and all.
The base table called X has 5798 rows with 9 columns and the table I want to copy to this base table is table Y and has 94 rows with 9 columns. I want to take table Y and copy all the data into table X. I tried append but since the primary key is the same even using the force did not work. It comes back and says it was successful yet then says final outcome is 5798 rows. I never says 5892 rows.
proc append base = y data = x force;
06-14-2012 01:46 PM
Show the log from the following code:
proc append base=x data=y force;
create table new_selection as
(select * from x
select * from y) b;
06-15-2012 04:43 AM
Do you have a unique index on the data set X? Can you run a proc contens on the data set X and share the log with us?
If so and Y data set has observations that match the key variable values in data set X it will reject those observations in Y when appended.
create unique index Name on class ;
proc contents data=class; run;
proc append base=class data=sashelp.class;
NOTE: Appending SASHELP.CLASS to WORK.CLASS.
WARNING: Duplicate values not allowed on index Name for file CLASS, 19 observations rejected.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: 0 observations added.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: PROCEDURE APPEND used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds