Suppose there is a SAS dataset with following values -
Parent Child
A B
B C
D E
F G
G H
H I
and so on…..
This goes onto 1000s of observations/rows.
Now how do we identify from this dataset Grandparents and
Grandchildrens ?
Answer Posted / sumit
Suppose the above dataset name is work.old.
Data new;
Set work.old (first obs = 2);
Run;
Proc sql;
Select Old.parent as grandfather, Old. Child as father,
new.child as grandchild from work.Old as old, work.new as
new
where old.child = new.parent;
quit;
Is This Answer Correct ? | 17 Yes | 0 No |
Post New Answer View All Answers
name several ways to achieve efficiency in your program? : Sas programming
what does the run statement do? : Sas programming
how does sas handle missing values in a merge? : Sas programming
What is a method to debug and test your SAS program?
What do the mod and int function do? : Sas programming
What’s the difference between var b1 – b3 and var b1 — b3?
What is the difference between nodupkey and nodup options?
What is the different between functions and PROCs that calculate the same simple descriptive statistics?
What is the differnce between SDTM 3.1.2 to 3.1.1 version
Describe the ways in which you can create macro variables?
how could you generate test data with no input data? : Sas programming
explain what is factor analysis? : Sas-administrator
How do you define proc in sas? : sas-grid-administration
what are _numeric_ and _character_ and what do they do? : Sas programming
Which command is used to perform sorting in sas program?