what is Difference between PROC SQL JOINS and MERGE?

Answer Posted / rajitha macherla

The resultant dataset depends on the input datasets.
In case of one to one and one to many both work
similarly,i.e. the resultant dataset is same.
But differs in case of many to many and non matching
datasets:
many to many:
ex: (merge on x) (proc sql)
X Y X Z X Y Z X Y Z
----- ------ ------- -------
1 A 1 F 1 A F 1 A F
1 C 1 R ---> 1 C R 1 A R
2 B 2 G 2 B G 1 C F
1 C R
2 B G


NON MATCHING DATA:

ex: (merge on x) (proc sql)
X Y X Z X Y Z X Y Z
----- ------ ------- -------
1 A 1 F 1 A F 1 A F
2 B 3 T ---> 2 B . 3 C T
3 C 4 G 3 C T
4 . G

Is This Answer Correct ?    28 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a macro routine?

2104


What is data _null_?

697


In ARRAY processing, what does the DIM function do?

710


What is the difference between %local and %global? : sas-macro

668


What is the difference between proportion and average?

2756






Explain why double trailing @@ is used in input statement?

572


What are the default statistics that proc means produce?

604


How will you generate test data with no input data?

563


How long can a macro variable be? A token? : sas-macro

717


how would you create multiple observations from a single observation? : Sas programming

566


Are you involved in writing the inferential analysis plan? Tables specifications?

3479


Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro

697


Given an unsorted data set, how to read the last observation to a new data set?

837


What is run-group processing?

623


What are the differences between sum function and using “+” operator?

576