Date: Fri, 7 Jul 2006 12:44:01 -0400
Reply-To: Jen Sabatier <plessthanpointohfive@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jen Sabatier <plessthanpointohfive@GMAIL.COM>
Subject: finding minimum value in most efficient manner
Hello, all,
I have a dataset of individual's work histories. So, there is are columns
for id, jobtitle, months.
data hx;
input id jobtitle $ months;
datalines;
1 Floater 3
1 Operator 1
1 Crew 8
1 Manager 30
2 Operator 5
2 Crew 2
3 Helper 1
4 Helper 10
4 Operator 56
4 Supervisor 22
4 Manager 10
.
.
.
;
So, we have unequal lengths to the actual work history. Some people held
several jobs, some just a few, and some only one.
What I need to do is locate the shortest job held for each person for people
who held more than one job, flag it and the jobs before and/or after it. I
will need to examine the previous and/or prior job along with the shortest
job. If a person held only one job then I need to flag them seperately.
I've tried to do this with an array but I can't make it work. I know it
must be simple.
Hope someone can help!
|