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 / sas@freek

data family;
input parent $ child $;
datalines;
A B
B C
C D
D E
E F
F G
G H
H I
;
run;
data family_new(drop=parent child);
set family;
parent1=lag(parent);
child1=lag(child);
grand_child=child;
if _n_ ge 2;
run;

proc print data=family_new;
var parent1 grand_child;
run;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pdv and what are its functions?

1222


What is the use of function Proc summary?

1349


How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?

2516


Mention how to limit decimal places for the variable using proc means?

1176


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

1315


How to test the debugging in sas?

1245


what are several options for creating reports in web report studio? : Sas-bi

1231


What commands are used in the case of including or excluding any specific variables in the data set?

1148


explain the main difference between the nodup and nodupkey options? : Sas-administrator

1227


What are the different servers in sas? : sas-grid-administration

1105


Hi, If anyone has base SAS certification dumps, please share.

1930


what are sas bi dashboard components? : Sas-bi

1231


Describe crosslist option in tables statement?

1272


What is slibref?

1336


how do you want missing values handled? : Sas programming

1015