115Combining Data Sets
During the compilation phase, SAS reads the descriptor information
of the input data sets listed in the MERGE statement. SAS then creates
the PDV that contains all the variables from all the data sets along with
new variables created in the DATA step. In addition, SAS creates FIRST.
VARIABLE and LAST.VARIABLE for each variable listed in the BY
statement in the PDV.
During the execution phase, SAS examines the rst BY group in each input
data set listed in the MERGE statement to determine which BY group should
appear rst in the output data set. Then the DATA step starts to read obser-
vations from the rst BY group from each data set. When reading the rst
BY group, the DATA step reads the rst observations into the P ...