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 |
The below code we are using for creating more than one macro variables in proc sql using into clause. How we can use same code to create macro variables vara, varb, varc instead of var1, var2, var3.? proc sql noprint; select count(distinct(patient)) into :var1 - :var3 from dataset1 group by trtreg1c ; quit;
Below is the table. Required to be output should be the highest number of each student_id. Example. Student_id Subject Marks 1 Hindi 86 2 Hindi 70 3 English 80 . Calculate sum and average marks for each group of student_id Example. Student_id Subject Marks Total Marks Average 1 English 40 181 60.33333 2 English 67 196 65.33333 3 English 80 160 53.33333 PLEASE PROVIDE THE CODE OF ABOVE PROBLEMS
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 are the statements that are executed only?
How to read multiple excel sheets from a single excel file at once????
7 Answers HCL, Verinon Technology Solutions,
Given an unsorted data set, how to read the last observation to a new data set?
How would you create multiple observations from a single observation?
what are input dataset and output dataset options? : Sas programming
What are the different servers in sas? : sas-grid-administration
If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro
What are types of transport files?
2 Answers PRA Health Sciences, Quintiles,
Explain how merging helps to combine data sets.