From: Yaw on 30 Jun 2010 14:24 Dear all: I want to categorize a year variable I have into decade. The visit/ treatment spans from 1970 to 2008. Does anybody know an efficient way of going around this task? Data I have: ID visityr 1 1975 1 1981 2 1999 2 2001; I want something like Id visitdecade; 1 70 1 80 2 90 2 100, etc. or any workable format. Thanks, Yaw
From: Arthur Tabachneck on 30 Jun 2010 17:19 Yaw, You could use something like: data have; input ID visityr; cards; 1 1975 1 1981 2 1999 2 2001 ; data want; set have; decade=10*FLOOR((visityr-1900)/10); run; HTH, Art ------------ On Jun 30, 2:24 pm, Yaw <link...(a)gmail.com> wrote: > Dear all: > > I want to categorize a year variable I have into decade. The visit/ > treatment spans from 1970 to 2008. > > Does anybody know an efficient way of going around this task? > > Data I have: > > ID visityr > 1 1975 > 1 1981 > 2 1999 > 2 2001; > > I want something like > > Id visitdecade; > > 1 70 > 1 80 > 2 90 > 2 100, > > etc. or any workable format. > > Thanks, > Yaw
|
Pages: 1 Prev: Macros-- Help Next: Siebel CRM On Demand -- 10+ Months Contract |