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


Please Help Members By Posting Answers For Below Questions

What is the difference between nodupkey and nodup options?

588


Tell e how how dealt with..

1761


Intern stastical programmer written test

276


what is PhaseIII, ODS, TLG, Macro and Proc in SAS

3891


what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

1907






how can you create zero observation dataset? : Sas programming

627


what do the pad and dim functions do? : Sas programming

557


name the scheduler for scheduling job and explain the scheduler? : Sas-di

581


How would you define the end of a macro?

691


Explain the use of proc print and proc contents?

550


What’s the difference between var b1 – b3 and var b1 — b3?

814


How we can call macros with in data step? : sas-macro

601


what do you mean by data staging area? : Sas-di

595


What are the implications?

1176


What is a method to debug and test your SAS program?

706