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

How do you debug macros?

3 Answers   Accenture,


Identify statements whose placement in the DATA step is critical.

6 Answers   Accenture, Labasol,


what is the need of INDEX in datasets?

6 Answers   CitiGroup,


what is AE onset date and what is RDS?

4 Answers   Accenture,


What SAS statements would you code to read an external raw data file to a DATA step?

6 Answers   Accenture,






what is SAS ACCESS AND SAS CONNECT ? Give an example and data statements used.

1 Answers   TCS,


in ods is there any lib's

2 Answers   SAS,


data task; input id date date9. visit; cards; 101 01jan2015 1 101 02jan2015 2 101 06jan2015 3 102 04jan2015 1 102 07jan2015 2 102 12jan2015 3 103 06jan2015 1 103 13jan2015 2 ; run; write a program to find out missing dates between visits by each subject.

1 Answers  


Explain what is data step?

0 Answers  


Hi... this is chandu, did MSc Microbiology, trying to get job in SAS tool, PLZ Tell me whether IT industries will give consider my education to gain a job....?

2 Answers  


I am having a stored process.it needs to route my report to both hthml and Xls.By default SP routes to html.I used the PRINTTO to route the html to Xls.BUt it createsthe file not but no content was written to file(0KB)?how can i do it?

1 Answers  


What is the use of stop statement?

0 Answers  


Categories