Friday, August 12, 2005

How To MERGE with KEEP and IN

The following SAS code lets you MERGE two datasets whil only pulling the variables that you want from the larger dataset (in this case, crspq.msi) by the variable "date" and the "IF m=1" ensures that any merging will only occur on items on the delist1 dataset (meaning that the sample size of delist1 will remain the same):


DATA delist1;
MERGE delist1(IN=m) crspq.msi(IN=q KEEP= date ewretd);
BY date;
IF m=1;
RUN;

0 Comments:

Post a Comment

<< Home