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
what is business intelligence? : Sas-bi
How to include or exclude specific variables in a data set?
What are types of transport files?
What is the differnce between SDTM 3.1.2 to 3.1.1 version
What are the implications?
what other sas products have you used and consider yourself proficient in using? : Sas programming
what are several options for creating reports in web report studio? : Sas-bi
I have a dataset concat having a variable a b & c. How to rename a b to e & f?
How do you connect the desktop application to metadata server? : sas-grid-administration
Explain the special input delimiters used in sas programming.
Are you involved in writing the inferential analysis plan? Tables specifications?
Name some categories in sas 9? : sas-grid-administration
Give e an example of..
name some data transformation used in sas di? : Sas-di
what type of graphs we will create(for 2+years candidates)?