Report Top Up a Page Previous Next Up a Map TOC Page Index File Index What's New Page Bottom
Buffalo SAS Users Group Meeting : Putting the MEOW in Data Set Con-CAT-enation : SAS Programming Examples : PROC APPEND Syntax published Tue, Jul 22, 2003 - 15:05 EDT

PROC APPEND Syntax


Download this HTML file.   (Instructions for downloading)

Concatenating SAS Data Sets with the APPEND Procedure

 

Concatenating SAS data sets is the process of storing observations one after another until all the data sets and their observations have been combined into one data set.

 

Many users perform the concatenation process using a DATA step (as shown in the previous examples), but there are good reasons for using the APPEND procedure. If you use the SET statement in a DATA step to concatenate two data set, the SAS System must process all the observations in both data sets to create a new one. The APPEND procedure bypasses the processing of data in the original data set and adds new observations directly to the end of the original data set. It does this by positioning the record pointer at the end of the original data set, and starting the processing directly with the new observations.

 

The APPEND procedure uses a BASE= data set and a DATA= data set. The BASE= data set identifies the original data set. The DATA= data set identifies the data set to be concatenated to the original

 

PROC APPEND BASE= SAS-data-set <DATA=SAS-data-set> <FORCE>

 

          If PROC APPEND cannot find the BASE= data set, SAS creates it

          If a DATA= data set is not specified, SAS uses the most recently created SAS data set

          If there is a system failure or other interruption during processing, the BASE= data set may not be properly updated

          If appending a large and small data set, specify the large data set as the BASE data set, and the small data set as the DATA= data set, so that SAS only reads the smaller data set.

          If appending data sets with different variables or attributes, use the FORCE option. This option must be used to prevent a syntax error.

 

 

 


Page authored by Darcy Foit

Buffalo SAS Users Group Meeting : Putting the MEOW in Data Set Con-CAT-enation : SAS Programming Examples : PROC APPEND Syntax published Tue, Jul 22, 2003 - 15:05 EDT
Report Top Up a Page Previous Next Up a Map TOC Page Index File Index What's New Page Top