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
how can you put a "trace" in your program? : Sas programming
what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi
What do you know about sas data set?
what is metadata? : Sas-bi
Mention what is PROC in SAS?
Explain the special input delimiters used in sas programming.
Explain the difference between nodup and nodupkey options?
How do you debug and test your SAS programs?
how does sas handle missing values in formats? : Sas programming
What are the functions used for character handling?
What are the differences between proc means and proc summary?
How do dates work in SAS data?
what are some differences between proc summary and proc means? : Sas programming
Are you sensitive to code walk-throughs peer review or QC review?
What is the difference between reading data from an external file and reading data from an existing data set?