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 / nishant
Using "IN" variable option. Look at the following example.
data three;
merge one(in=x) two(in=y);
by id;
if x=1 and y=1;
run;
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / pallavi
data three;
merge one(in=x) two(in=y);
by id;
if x and y;
run;
Is This Answer Correct ? | 13 Yes | 1 No |
Answer / madhavi
proc sort data=one;
by id;
run;
proc sort data=two;
by id;
run;
data comm_rec;
merge one(in=a) two(in=b);
by id;
if a and b;
run;
proc print data=comm_rec;
run;
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / sheetal
Using joins in proc sql statement, see following example
proc sql;
select *
from a, b
where a.case_id = b.case_id;
quit;
Is This Answer Correct ? | 6 Yes | 1 No |
Answer / kamudu
here we used simple answer ia
data merge;
merge(tables------);
by (same colum);
if e1 and e2 then
output;
keep-----;
run;
Is This Answer Correct ? | 0 Yes | 5 No |
How are numeric and character missing values represented internally?
I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a different functionality. In my program I use bot these data sets. How do I specify which Age variable I want to use?
how do i read multiple spaces in datasets? eg: vijaya raghava perumal.I tried with using & but it workss if its vijaya raghava but not for raghava perumal.how to do this?
What are the different versions of sas that you have used until now? : sas-grid-administration
Difference b/n proc means and proc summary procedures?
what is star schema? : Sas-di
hi i am nipun can anybody tell me that if a clinical sas programmer write the code and after successfull execution where do they store it. how they submit tables to TL how work is assigned to programmers either both code, log, output to be submitted. can any one tell me the process
what r the job openings SAS for fresher graduates !
what does the run statement do? : Sas programming
Hi, Does anybody has lastest SAS certification(base, adv., clinical)dumps,if anybody has please email me at mailtorajani76@gmail.com. Thanks
How do you define proc in sas? : sas-grid-administration
What is the length assigned to the target variable by the scan function?