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


Please Help Members By Posting Answers For Below Questions

What is the difference between reading data from an external file and reading data from an existing data set?

632


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

535


What do the sas log messages “numeric values have been converted to character” mean? What are the implications?

712


In ARRAY processing, what does the DIM function do?

707


What is the difference between order and group variable in proc report?

833






What do you understand by the term Normal Distribution?

570


What is the length assigned to the target variable by the scan function?

670


List out some key concept of SAS

617


To what type of programms have you used scratch macros?

2134


Do you need to rearrange the order of the data for the report?

1830


explain about sas business intelligence? : Sas-bi

596


How do you convert basic cube to transaction cube and transaction cube to basic cube?

1770


Differentiate between proc means and proc summary.

599


What are the difference between the sas data step and sas procs?

606


What is your favorite all time computer book? Why?

2044