Date: Fri, 6 Feb 2009 16:29:10 -0600
Reply-To: Duck-Hye Yang <dyang@CHAPINHALL.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Duck-Hye Yang <dyang@CHAPINHALL.ORG>
Subject: Programming help: trigger and increase by 1 within a person
Content-Type: text/plain; charset=US-ASCII
Hello,
I wanted to created a new variable. In the following data, if type='DC' the new_variable should increase by 1. In the beginning, the variable starts with 1. Each time DC is encountered, the new_variable needs to increase. If a new person comes in, the process starts all over.
I hope that someone out there will think that this is easy to do!
Thanks,
Duckhye
----------------------------------------
person type new_variable
A KC 1
A DC 2
A KC 2
A BC 2
A KC 2
A DC 3
A KC 3
A BC 3
B
B
B
|