LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 1996, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 20 Mar 1996 17:08:39 +0000
Reply-To:   Clare.Gill@ucd.ie
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Clare Gill <Clare.Gill@UCD.IE>
Organization:   University College Dublin
Subject:   counting events in SAS for Windows Version 6.08

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


Back to: Top of message | Previous page | Main SAS-L page