Tips:Appending datasets efficiently

From sasCommunity

Jump to: navigation, search
 * Using the SET statement;
Data work.step1;
  Set work.step1
      work.step2;
 Run;
 
* Using the APPEND statement;
 Proc datasets;
  Append base=work.step1
         data=work.step2;
 Run;

There are a couple of methods you can use to concatenate data sets. In these examples, work.step2 is appended to work.step1.

When you use a SET statement in a data step, SAS processes all the observations in work.step1 and work.step2.

With the Datasets procedure, the APPEND statement bypasses the processing of the data in the original data set (work.step1) and adds the observations in work.step2 directly to the end of the original. As a result, using the APPEND statement can be more efficient that using a SET statement.

Submitted by Linda Adams. Contact me at my Discussion Page.

....see also

....read more

Personal tools