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 data _null_?

685


what are validation tools that are used in sas? : Sas-administrator

585


How would you identify a macro variable? : sas-macro

523


What are the implications?

1175


how to generate the test data in sas without input data? : Sas-administrator

564






What is the maximum length of the macro variable?

662


Give some examples where proc report’s defaults are same as proc print’s defaults?

629


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

593


explain what is data set in sas? : Sas-administrator

518


How would you identify a macro variable?

637


do you need to know if there are any missing values? : Sas programming

540


what are input dataset and output dataset options? : Sas programming

551


how does sas handle missing values in procs? : Sas programming

627


How is character variable converted into numeric variable and vice versa?

582


What do you know about sas and what we do? : sas-grid-administration

591