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
What is the difference between reading data from an external file and reading data from an existing data set?
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
What do the sas log messages “numeric values have been converted to character” mean? What are the implications?
In ARRAY processing, what does the DIM function do?
What is the difference between order and group variable in proc report?
What do you understand by the term Normal Distribution?
What is the length assigned to the target variable by the scan function?
List out some key concept of SAS
To what type of programms have you used scratch macros?
Do you need to rearrange the order of the data for the report?
explain about sas business intelligence? : Sas-bi
How do you convert basic cube to transaction cube and transaction cube to basic cube?
Differentiate between proc means and proc summary.
What are the difference between the sas data step and sas procs?
What is your favorite all time computer book? Why?