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 |
How do you debug macros?
Identify statements whose placement in the DATA step is critical.
what is the need of INDEX in datasets?
what is AE onset date and what is RDS?
What SAS statements would you code to read an external raw data file to a DATA step?
what is SAS ACCESS AND SAS CONNECT ? Give an example and data statements used.
in ods is there any lib's
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.
Explain what is data step?
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....?
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?
What is the use of stop statement?