Select Page

The SAS method PROC APPEND adds observations from one SAS data set to the end of another SAS data set. It does not handle the initial data set’s observations, but instead adds them straight to the original data set1. The BASE= parameter specifies the SAS data set to which the observations should be appended, and the DATA= argument specifies the SAS data set containing the observations to be appended.

In SAS, you may use PROC append to attach the values of one dataset to the end of another. The fundamental syntax is as follows:

 proc append base=data1 data=data2;

run;

It should be noted that this approach does not generate a new dataset. Rather, it appends the values from data2 to the end of data1.

It’s vital to remember that attempting to use PROC APPEND when the two datasets have different column names may result in an error message. You may either alter the column names to match or use the force option to force the add operation in this case. Assume the second dataset has the variable name “rebound” instead of “rebounds.” To add the two datasets and compel them to be appended, we may use the following syntax:

/*append data2 to end of data1*/

proc append base=data1 data=data2 force;

run;

/*view updated data1*/

proc print data=data1;

run;

Data2 has been attached to data1, however the values in the rebounds column for the additional dataset are empty if you do not provide force options, hence the result only shows data set 1 in the output.