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

Explain what Proc glm does?

0 Answers  


how can you import .csv file in to sas? : Sas programming

0 Answers  


/* To determine the maximum and minimum of V1 */ data before3; input v1 v2 v3; cards; 3 2 1 4 6 5 2 1 3 6 5 4 1 3 2 5 4 6 ; run;

5 Answers  


Code a PROC MEANS that shows both summed and averaged output of the data.

5 Answers  


In which case u go for libname and in which case u go for proc sql pass thru facilit diff?

1 Answers  






what is the difference between infile and input? : Sas-administrator

0 Answers  


how to display duplicated observations in a data using base sas.

13 Answers   HCL, TCS,


explain the difference between proc means and proc summary?

0 Answers  


what is sas metadata repository? : Sas-bi

0 Answers  


where to use sas business intelligence? : Sas-bi

0 Answers  


Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya

0 Answers  


Describe how you would pass data to macro.

3 Answers  


Categories