11-21-2016 09:17 AM
I need some help in converting a many-many merge to one-one merge logically.
I have a dataset which post-merge is of the type:
I need the maximum possible combinations of Var1 and Var2. So the output should look like:
Is there any optimum way to do it other than working on a row and checking with all the rows already worked on. The dataset would be quite big, hence need to optimize the code.
Thanks in advance.
11-21-2016 10:07 AM
If the observations are in order BY VAR1 VAR2, you can do this easily:
by var1 var2;
In fact, if the observations are in the proper order, that subsetting IF could be added to the DATA step that contains the MERGE statement.