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 / altumish
A simple self Join:
data old;
input Parent $ Child $;
cards;
A B
B C
D E
F G
G H
H I
I J
J K
J L
P S
;
Proc sql;
Select Old.parent as grandfather, Old.Child as father,
new.child as grandchild from work.Old as old, work.Old as new
where old.child = new.parent;
quit;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
what has been your most common programming mistake? : Sas programming
what is metadata? : Sas-bi
what is factor analysis? : Sas-administrator
Mention the validation tools used in SAS?
What is the use of divide function?
Describe the ways in which you can create a macro variable?
what type of graphs we will create(for 2+years candidates)?
Hi,by usining ptf how we have to combine (likr merge)10 datasets at a time in the oracle database(and write a macro code also)?Like this i have a douts a lot if you dont mind may please send one text mail for me(madhusudhanap16@gmail.com)?
Explain data step in SAS
what are all the reports you generated in your recent project?
What is the basic syntax of a sas program?
what techniques and/or procs do you use for tables? : Sas programming
for report generation which one you used proc report or data_null_?
In sas admin differentiate between roles and capabilities? : sas-grid-administration
Explain how merging helps to combine data sets.