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 / jayant

data tet;
input par $ child $;
datalines;
A B
B C
C D
E F
;
run;




data tet1;
set tet;
grand=lag(par);
drop par;
run;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of _character_ and _numeric_?

589


Explain data_null_?

609


for whom is sas data integration studio designed? : Sas-di

556


How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro

583


What are the data types does SAS contain?

655






What is run-group processing?

624


List down the reasons for choosing sas over other data analytics tools.

807


Enlist the syntax rules followed in sas statements.

617


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

555


what are sas bi dashboard components? : Sas-bi

663


what versions of sas have you used (on which platforms)? : Sas programming

585


explain what is factor analysis? : Sas-administrator

602


what is the use of proc contents and proc print in sas? : Sas-administrator

604


What is the use of PROC gplot?

641


How will you generate test data with no input data?

563