When a program concatenates
data sets, all of the observations are read from the first data set
listed in the SET statement. Then all of the observations are read
from the second data set listed, and so on, until all of the listed
data sets have been read. The new data set contains all of the variables
and observations from all of the input data sets.
data concat;
set a c;
run;
Notice that A and C
contain a common variable named Num:
-
Both instances of Num (or any common
variable) must have the same type attribute, or SAS stops processing
the DATA step and issues an error message stating that the variables
are incompatible.
-
However, if the length attribute
is different, SAS takes the length from the first data set that contains
the variable. In this case, the length of Num in A determines the
length of Num in Concat.
-
The same is true for the label,
format, and informat attributes: If any of these attributes are different,
SAS takes the attribute from the first data set that contains the
variable with that attribute.