How would you combine 3 or more tables with different
structures?

Answers were Sorted based on User's Feedback



How would you combine 3 or more tables with different structures? ..

Answer / piyushjk

I would use Merge statement to combine theree tables (SAS
Datasets). First you have to sort the datasets by common
variable. provide the condition with in merge statement.
For e.g. Three datasets are A, B, C and common var is SSN,
then

DATA Together;
Merge A (IN=A)
B (IN=B)
C (IN=C);
By SSN; Run;

Is This Answer Correct ?    7 Yes 2 No

How would you combine 3 or more tables with different structures? ..

Answer / nandu

sort all datasets before going to merge
data abc ;
merge aa (in=a) bb (in=b) cc(in=c) ;
by empid /*by variable*/
if a or b or c;/*based on your requirement*/
run;

Is This Answer Correct ?    3 Yes 0 No

How would you combine 3 or more tables with different structures? ..

Answer / akshay surya

Yes we can use joins and Merge statements as well. But in
bothe the scenarios, a commmon variable should be there for
all tables(can have different structures). And also one
should take care when tables contains too many duplicate
values.(may be eliminating the duplicate values is probably
the best way to get the intended result, otherwise output
result will be the reuslt of a cartesian product).

Is This Answer Correct ?    5 Yes 3 No

How would you combine 3 or more tables with different structures? ..

Answer / venu

join concept use to combine 3 or more tables with different
structures

Is This Answer Correct ?    3 Yes 3 No

How would you combine 3 or more tables with different structures? ..

Answer / ameenpasha

I think sort them with common variables and use merge statement.
No matter if they are of different structures, only that the result will have missing values for nonmatching records. If you wanna avoid this use In() operator OR

use proc sql with Join clause which will just pick matching records.

Is This Answer Correct ?    0 Yes 0 No

How would you combine 3 or more tables with different structures? ..

Answer / sowjanya

2nd Answer is exactly corrrect.

Is This Answer Correct ?    0 Yes 0 No

How would you combine 3 or more tables with different structures? ..

Answer / laxman

second Answer corrrect.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

What is the difference between Proc tabulate and Proc print

4 Answers   CitiGroup,


How can you limit the variables written to output dataset in data step?

0 Answers  


how to rearrange the data as our wish by using dataset block?

4 Answers   Cognizant,


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?

3 Answers  


hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1 Answers   Pfizer,


Have you ever linked SAS code? If so, describe the link and any required statements used to either process the code or the step itself.

2 Answers   Accenture,


i have one dataset data l; input name: $ 25; cards; manoj is a good boy to krishna krishna is a god boy to malli malli is good boy to ramana ques: here i want "manoj" observations nubers

3 Answers   SAS,


Give an example where SAS fails to convert character value to numeric value automatically?

0 Answers  


How many versions came upto now in SAS?

3 Answers   CTS, TCS,


explain the main difference between the nodup and nodupkey options? : Sas-administrator

0 Answers  


What are the best sas programming practices for handling very large datasets? : sas-grid-administration

0 Answers  


Name some categories in sas 9? : sas-grid-administration

0 Answers  


Categories