In SAS, you can perform one-to-one reading with the help of multiple SET statements. It combines observations from two or more data sets into a single observation in a new data set.
Suppose you have two very big datasets. You have IDs column in both the datasets. Each ID in the first dataset has a matching ID in the second one and they are in the same order. Your task is to merge these datasets but the usual method of data step merging doesn’t work because it uses a lot of memory. Instead you can use the MULTIPLE SET Statements for merging them.
DATA dat1;
INPUT id v1 v2;
CARDS;
1 10 100
2 15 150
3 20 200
;
DATA dat2;
INPUT id v3 v4;
CARDS;
1 1000 10000
2 1500 15000
3 2000 20000
4 800 30000
;
RUN;
DATA dat3;
set dat1;
set dat2;
RUN;
