|
Hello,
I have a data file with 3 variables - animal, event and level. I
want to create a new variable which will count the number of times
an animal participates in an event at a particular level.
The original data step looks like this :
data one; input animal $ event level; cards;
animal1 110 1
animal1 111 2
animal1 112 2
animal1 113 2
animal2 114 1
animal2 115 1
animal2 116 1
animal2 117 1
animal2 118 1
animal2 119 1
;
run;
I would like the output file to look like this :
* this counter to be created
animal1 110 1 1
animal1 111 2 1
animal1 112 2 2
animal1 113 2 3
animal2 114 1 1
animal2 115 1 2
animal2 116 1 3
animal2 117 1 4
animal2 118 1 5
animal2 119 1 6
I am using SAS for Windows Version 6.08.
Many thanks in advance.
Clare Gill
Computing Services
University College Dublin
Belfield
DUBLIN 4
Tel : +353-1-706 2007
Fax : +353-1-2837077
E-mail : CLARE.GILL@UCD.IE
|