*Run appending process by SQL;
data apnd1;
input Siteno $ Subid Age;
cards;
S1 101 23
S1 102 46
S1 103 56
;
run;
data apnd2;
input Siteno $ Subid Age;
cards;
S2 201 23
S2 202 46
S2 203 56
;
run;
/*Run Appending*/
proc sql;
insert into apnd1;
select * from apnd2;
quit;
Remove ";" after insert into. As in:
data apnd1;
input Siteno $ Subid Age;
cards;
S1 101 23
S1 102 46
S1 103 56
;
run;
data apnd2;
input Siteno $ Subid Age;
cards;
S2 201 23
S2 202 46
S2 203 56
;
run;
proc sql;
insert into apnd1 select * from apnd2;
quit;
proc print noobs data=apnd1;
run;
Remove ";" after insert into. As in:
data apnd1;
input Siteno $ Subid Age;
cards;
S1 101 23
S1 102 46
S1 103 56
;
run;
data apnd2;
input Siteno $ Subid Age;
cards;
S2 201 23
S2 202 46
S2 203 56
;
run;
proc sql;
insert into apnd1 select * from apnd2;
quit;
proc print noobs data=apnd1;
run;
There is no defined limit to the number of INSERT statements you can write in SQL.
But it's wrong that PROC APPEND can only append one dataset in one operation; create a data step view containing all the datasets to be appended, and use that in the DATA= option of PROC APPEND.
Why do you want to write more code than necessary? Proc append is designed for appending dataset, use it!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.