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 is the basic syntax of a sas program?
You need to perform an analysis on a massive dataset by groups, but are unable to sort the data due to memory constraint. How would you accomplish the task?
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
Give e an example of..
What makes sas stand out to be the best over other data analytics tools?
How to import the Zip files into SAS? If it is possible in SAS? If it is posible write the code...
what is proc Index? and what is proc document?
i want to upload titles and footnotes to excel file?how it is possible?
how can u import .csv file in to SAS?tell Syntax?
7 Answers CitiGroup, Franklin Templeton,
What is SAS Information Map Studio and its purpose ?
Hi im new to sas. I have a file with some charecter variables and some numeric variables now i want to load charecter variables into one datastep and numeric variables into another data step pls let me know Thanks
how sas deals with business intelligence? : Sas-bi