Hi Experts, I need to find out great grandparent for the child using this dataset. DATA hierarchy; input parent $ child $; cards; A B B K K C ; RUN; In this dataset, Value C's parent is K and C's grandparent is B and C's great grandparent A. So i need result like this I tried with PROC SQL. I am able to find out till Grandparent but i am not able to find out Great_grandparent hierarchy. I used this code proc sql; select child,parent, (select parent from hierarchy where child=a.parent) as grandparent from hierarchy as a where child='C'; quit; but i am not able to find great grandparent... Can you guys please suggest a way to achieve this use proc sql itself Thanks in advance Regards, Syed
... View more