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 / sas job searcher
data x1y1
x1y0
x0y1;
/* x1y1, x1y0, x0y1 are output data set names */
merge left_most(in=x) right_most(in=y);
by id;
/* write all matches to x1y1: */
if x=1 and y=1 then output x1y1;
/* non-matches from the left-most data set: */
if x=1 and y=0 then output x1y0;
/* non-matches from the right-most data set: */
if x=0 and y=1 then output x0y1;
run;
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
for report generation which one you used proc report or data_null_?
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
Mention the difference between ceil and floor functions in sas?
what are the considerations when picking a SAS/STAT procedure?
What areas of SAS are you most interested in?
Define run-group processing?
why is a stop statement needed for the point=option on a set statement? : Sas programming
what is sas database server? : Sas-di
Which command is used to perform sorting in sas program?
What are the difference between ceil and floor functions in sas?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
Explain data_null_?
Where do you use proc means over proc freq?
Are you sensitive to code walk-throughs peer review or QC review?