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
explain the proc in sas? : Sas-administrator
What is factor analysis?
Can you execute a macro within a macro? Describe. : sas-macro
How is character variable converted into numeric variable and vice versa?
how do you debug and test your sas programs? : Sas programming
What do the sas log messages “numeric values have been converted to character” mean? What are the implications?
What are the difference between the sas data step and sas procs?
what is hierarchy flattening? : Sas-di
what are the component of range? : Sas-bi
what are 5 ways to perform a table lookup in sas? : Sas-administrator
What is the differnce between SDTM 3.1.2 to 3.1.1 version
what is null hypothesis? why do you consider that?
Mention what are the data types does SAS contain?
How will you generate test data with no input data?
In sas admin differentiate between roles and capabilities? : sas-grid-administration