what is the difference between SET and MERGE?
Answer Posted / kithsiri
Data C;
Set A B;
run;
Concaternate A and B data sets and make c Data set. Then data of B data set is placed after data of A data set. If A has n1 number of observation and B set has n2 number of observation. Then C(new set has n1+n2 number of data)
Data C;
set A B;
By var1;
run;
If var1 variable is exist in both A and B data sets, in C data set rows are arrenged according to var1 variable(ascending order).
Data C;
merge A B;
By var1;
run;
Data are arrenged side by side if there are var1 in both data sets and match rows of both sets. If A data set is not matched with B then display records of A in left side and right side data is missing values. If B data is not matched with A then display records of B in right side and left side data is missing values. If there is same variable in both tables, observation of that variable of first table is replaced by observation of the same variable of second table when match observation of var1 in both tables.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
what is the purpose of _error_? : Sas programming
If a variable contains letters or special characters, can it be numeric data type?
What is the use of the %include statement?
what are the benefits of data integration? : Sas-di
What are the limitations for memory allocation for SAS variables
How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?
how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming
Differentiate between proc means and proc summary.
What does PROC print, and PROC contents do?
how can you create zero observation dataset? : Sas programming
What do you know about symput and symget?
What are the differences between sum function and using “+” operator?
How to read an input file in sas?
what are validation tools that are used in sas? : Sas-administrator
name several ways to achieve efficiency in your program? : Sas programming