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 / reddy
data both left_only right_only;
merge dataset1(in=a) dataset2(in=b);
by variable;
if a and b then output both;
if a and not b then output left_only;
if b and not a then output right_only;
run;
i think these is the easy way of writing the code,if any
one nows other please specify.thanks!
| Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
what is the Population you used in your project, is it ITT or PP?
Mention what are the data types does SAS contain?
What is the purpose of _character_ and _numeric_?
Explain the main difference between the sas procedures and functions? : Sas-administrator
what do the sas log messages "numeric values have been converted to character" mean? : Sas programming
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
What is the use of stop statement?
Mention common programming errors committed in sas ?
How would you invoke a macro? : sas-macro
What are the difference between ceil and floor functions in sas?
Do you need to know if there are any missing values?
What is the length assigned to the target variable by the scan function?
For clinical entire study how many tables will create approx?
What is maximum storage capability of SAS?
What is the use of divide function?