How would you code a merge that will keep only the
observations that have matches from both sets?
Answers were Sorted based on User's Feedback
Answer / vijay
Dear Guest,
Merge won't accept NODUPKEY option. it is for PROC SORT.
the following code will get only matched observations in
both datasets
data three;merge one (in=a) two (in=b);by **;if a and b;run;
Is This Answer Correct ? | 12 Yes | 0 No |
Answer / murray
Both answers #2 and #3 will work fine, however the '= 1'
part is superfluous, and will work fine without.
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / san
data c;
merge data a(in=a)
dat b(in=b);
if a=1 and b=1;
by<common column>;
run;
Is This Answer Correct ? | 0 Yes | 5 No |
What statement do you code to write the record to the file?
How to convert HTML file into SAS dataset?
What is the good sas programming practices for processing large data sets?
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
how do you read binary data in sas?
What is the difference between nodupkey and nodup options?
How necessary is it to be creative in your work?
If you have a data set that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variable?
If a variable contains only numbers, can it be a character data type?
Name statements that function at both compile and execution time.
data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 67 D 2 4 3 3 39 R 4 4 4 4 19 D 2 1 2 1 75 D 3 3 2 3 57 R 4 3 4 4 ; Idont understand what the (Ques1-Ques4)($1. + 1) means. I have seen (Ques1-Ques4)(4*$1.), but what is (Ques1-Ques4)($1. + 1)? Appreciate all help Thanks
What does the RUN statement do?