How do you do this in SAS guys?

Joined
7/30/10
Messages
5
Points
11
Hi,

I am experiencing a little problem I cannot resolve myself in Sas,
maybe some of the experts here can help. I don't think its too hard a
problem but I think my knowledge of some SAS functions is limited.
I have such a column:
Indicator
F
F
.
.
M
M
T
T
.
.
W
W
Th
Th
.
.
.
M
M
What I would like is to output only the leading observations. e.g

Indicator
F
F
M
M
W
W
M
M
I would be extremely grateful if someone could help me address this
problem in SAS tremendously.
Thanks
 
Sort by the 'indicator' column. Then, in a data set, do something like:

data data_set_name;
set indicator_data_set_name;
by indicator;
if first.indicator; // this will output the first observation for each sorted set
run;


But it looks like you want the first 2 observations of each sorted set? In that case use a count variable and reset it with first.indicator.
 
Back
Top Bottom