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 (January 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 28 Jan 2009 11:23:46 -0500
Reply-To:     Jeri Ji <jeri_ji@FREDDIEMAC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jeri Ji <jeri_ji@FREDDIEMAC.COM>
Subject:      Re: selecting records
Comments: To: "./ ADD NAME=Data _null_;" <iebupdte@gmail.com>
In-Reply-To:  <ce1fb7450901280821u78c84350o83958129bf13d546@mail.gmail.com>
Content-Type: text/plain; charset="US-ASCII"

Good question.

A solution from Randy Herbison:

data test; input name $ month $ position $; cards; Mary Jan Officer Mary Jan Officer John Jan Manger John Jan Officer Brent Feb Director ;

proc sort data=test; by name month position; run;

data test2; set test; by name month position; if not (first.month and last.month) then do; if (first.position and last.position) then output; end; run;

Jeri

"./ ADD NAME=Data _null_;" <iebupdte@gmail.com> 01/28/2009 11:21 AM

To Jeri Ji <jeri_ji@freddiemac.com> cc SAS-L@listserv.uga.edu Subject Re: selecting records

All of your replies have assumed that 2 or more records per month indicate a position change. Is it posibility to have two or more records with same position?

On 1/28/09, Jeri Ji <jeri_ji@freddiemac.com> wrote: > Hello, > > I have four records in a dataset: with Name, month and position: > > 1 Mary Jan Officer > 2 John Jan Manger > 3 John Jan Officer > 4 Brent Feb Director > > And I want to create a dataset with record 2 and 3 in, i.e. if there is a > position change for the same person in the same month. What can I do? > > Thank you! > > > Jeri >


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