How would you combine 3 or more tables with different
structures?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / venu
join concept use to combine 3 or more tables with different
structures
Is This Answer Correct ? | 3 Yes | 3 No |
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 |
what is the need of INDEX in datasets?
calculate the sum of value using only DATA STEP. data count_; input year name $ value; cards; 2006 xxx 10 2007 yyy 12 2006 xxx 20 2008 yyy 15 2007 xxx 15 ; out put should be like this year name T_value ----------------------- 2006 xxx 30 2007 xxx 15 2007 yyy 12 2008 xxx 15
How do you add a number to a macro variable?
How does the internal authentication work in sas? : sas-grid-administration
What do you feel about hardcoding?
name few built in sas transformation in DI studio ?
What is the maximum length of the macro variable?
how to do user inputs and command line arguments in sas?
how do u identify a macro variable
What is the difference between nodupkey and nodup options?
Hi all, If Anybody has Advance SAS Certification dumps??? Please share with me. Email: pramod.kalugade03@gmail.com
what are sas bi dashboard components? : Sas-bi