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 (December 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 22 Dec 2008 04:25:12 -0800
Reply-To:     jesper@HVIDKILDEHUSENE.DK
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         jesper@HVIDKILDEHUSENE.DK
Organization: http://groups.google.com
Subject:      Re: Splitting a large dataset
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

On 22 Dec., 12:08, dorjeta...@GOOGLEMAIL.COM (karma) wrote: > Something like this should do the trick > > data have; > input Name $ Data $; > cards; > Jens A > Jens G > Jens X > Ole D > Ole B > ;run; > > data jens ole; > set have; > if name ='Jens' then output jens; > else if name='Ole' then output ole; > run; > > 2008/12/22 <jes...@hvidkildehusene.dk>:

Yeah, I have actually made a code exactly like yours :-) and this will solve my simple example. The problem is, that in my real dataset, there is not only the two names Jens and Ole but about 40 names which is a lot longer (like 'Thomas James Smith' or 'Jens Ole Christensen'). Of course I could just make a looong code like yours, where I have 40 else-if, but there must be an easier way.

Thanks, Jesper


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