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
explain about data integrator metadata reports? : Sas-di
Explain the special input delimiters used in sas programming.
describe the interaction table in sas di? : Sas-di
Give an example where SAS fails to convert character value to numeric value automatically?
Hi all, If Anybody has Advance SAS Certification dumps??? Please share with me. Email: pramod.kalugade03@gmail.com
What is the basic syntax style in SAS?
Name types of category in which SAS Informats are placed?
Explain bmdp procedure?
What is SAS?
How you are maintaining sas programmes in your company...any specific version control software you are using? If so, tell me the name?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
How do you convert basic cube to transaction cube and transaction cube to basic cube?
what is ae onset date n what is RDS
Explain what is the use of proc gplot?