Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Which command is used to perform sorting in sas program?

1047


what is change analysis in sas di ? : Sas-di

1060


how many display types available in sas bi dashboard? : Sas-bi

1087


Name types of category in which SAS Informats are placed?

1147


it will become easy if uuu provide website linkssss and list of consultanciessssss

1977


what is study design in while working with SAS? what are screening variables in SAS?

2242


what is the primary data source for the wrs? : Sas-bi

1235


Are you involved in writing the inferential analysis plan? Tables specifications?

3957


why is sas considered self-documenting? : Sas programming

1144


what is proc Index? and what is proc document?

2723


Have you used macros? For what purpose you have used? : sas-macro

1041


what can you learn from the sas log when debugging? : Sas programming

1087


How to test the debugging in sas?

1179


To what type of programms have you used scratch macros?

2569


How to limit decimal places for variable using proc means?

1113