How would you code a merge that will write the matches of
both to one data set, the non-matches from the left-most
data set to a second data set, and the non-matches of the
right-most data set to a third data set.
Answer Posted / vipin choudhary
Assume the common variable in both of the old datasets
is "name".
Data One two three;
merge old(in = in1) old1(in = in2);
by name;
if in1 and in2 then output one;
if in1 then output two;
if in1 = 0 and in2 = 1 then output three;
run
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to limit decimal places for the variable using proc means?
I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com
What do you know about sas and what we do? : sas-grid-administration
what r the job openings SAS for fresher graduates !
What do the mod and int function do? : Sas programming
Difference between informat and format?
Give some examples where proc report’s defaults are same as proc print’s defaults?
How do you specify the number of iterations and specific condition within a single do loop?
How is character variable converted into numeric variable and vice versa?
which date functions advances a date time or date/time value by a given interval? : Sas programming
What are the ways to do a “table lookup” in sas?
How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?
What Proc glm does?
Enlist the functions performed by sas.
Give some ways by which you can define the variables to produce the summary report (using proc report)?