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

I have 3 years of work experience at a startup and recently got certified in Data Science with SAS. I need to know how to get into the analytics industry

1699


How we can create SAS USER DEFINED CODE?

2028


What would be the value of month at the end of data step execution and how many observations would be there?

1059


What are the features of base sas system?

1016


how to do user inputs and command line arguments in sas?

2974


What are the different versions of sas that you have used until now? : sas-grid-administration

1272


what do the sas log messages "numeric values have been converted to character" mean? : Sas programming

967


what are the best practices to process the large data sets in sas programming? : Sas-administrator

959


how many types of prompts are there? : Sas-bi

1032


Explain what is the use of proc gplot?

1123


what is sas metadata repository? : Sas-bi

1051


Name and describe few sas character functions that are used for data cleaning in brief.

1055


Explain the special input delimiters used in sas programming.

955


List out some key concept of SAS

1042


why a stop statement is needed for the point= option on a set statement?

997