Create a new data set from multiple data sets based upon sorted order
Use the SET and BY statements to interleave data sets.
Note: Interleaving uses a SET statement and a BY statement to create a new, sorted data set from multiple data sets. The number of observations in the new data set is the sum of the number of observations in the original data sets. The observations in the new data set are arranged by the values of the BY variable(s) and, within each BY-Group, the order of the data sets in which they occur, including duplicates.
To interleave, data sets need to be in sorted order or indexed on the BY variables.
Use the SET and BY statements to interleave data sets.
Note: Interleaving uses a SET statement and a BY statement to create a new, sorted data set from multiple data sets. The number of observations in the new data set is the sum of the number of observations in the original data sets. The observations in the new data set are arranged by the values of the BY variable(s) and, within each BY-Group, the order of the data sets in which they occur, including duplicates.
To interleave, data sets need to be in sorted order or indexed on the BY variables.
Output:
source: support.sas.com