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

how can you put a "trace" in your program? : Sas programming

575


what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi

631


What do you know about sas data set?

592


what is metadata? : Sas-bi

598


Mention what is PROC in SAS?

597






Explain the special input delimiters used in sas programming.

581


Explain the difference between nodup and nodupkey options?

605


How do you debug and test your SAS programs?

1046


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

576


What are the functions used for character handling?

637


What are the differences between proc means and proc summary?

599


How do dates work in SAS data?

682


what are some differences between proc summary and proc means? : Sas programming

505


Are you sensitive to code walk-throughs peer review or QC review?

2597


What is the difference between reading data from an external file and reading data from an existing data set?

632