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 are the scrubbing procedures in sas?
Explain the difference between informat and format with an example.
how do the in= variables improve the capability of a merge? : Sas programming
How long can a macro variable be? A token? : sas-macro
What would you change about your job?
what are sas/access and sas/connect? : Sas programming
explain what is factor analysis? : Sas-administrator
What are the prime responsibilities of data integration administrator? : Sas-di
What is the difference between nodupkey and nodup options?
What is your favorite all time computer book? Why?
What are the limitations for memory allocation for SAS variables
How do you add a number to a macro variable? : sas-macro
How to convert a numeric variable to a character variable?
which features do you use to check the data validations and errors? : Sas-administrator
explain about various caches available in data integrator? : Sas-di