LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 2006, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 4 Jun 2006 11:21:30 -0700
Reply-To:   "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Organization:   http://groups.google.com
Subject:   Re: Separating columns
Comments:   To: sas-l@uga.edu
In-Reply-To:   <BAY101-F2234112549B62C4383889BDE910@phx.gbl>
Content-Type:   text/plain; charset="iso-8859-1"

toby dunn wrote: > Ryan , > > Provided that last name always comes before first name and the two are > separated by a space:

And: No embedded spaces within names ("Jo Ann Van de Berg" etc.)

> > data one ; > Length Name $30 ; > infile cards ; > input Name $Char30. ; > cards ; > Smith John > Smith Jordan > Jefferson Thomas > ; > run ; > > data two ; > set one ; > FirstName = Scan( Name , -1 , ' ' ) ; > LastName = Scan( Name , 1 , ' ' ) ; > > Put _all_ ; > run ; > > > > Toby Dunn > > > > > > From: Ryan McNeill <RMcNeill@OKLAHOMAN.COM> > Reply-To: Ryan McNeill <RMcNeill@OKLAHOMAN.COM> > To: SAS-L@LISTSERV.UGA.EDU > Subject: Separating columns > Date: Fri, 2 Jun 2006 16:14:06 -0500 > > The data I have has one column with a last name and first name. For instance > > Name > Smith John > Smith Jordan > Jefferson Thomas > > Can anyone help me on using SAS to separate the first and last names into > two separate columns? > > > > > <http://www.newsok.com/> <http://www.newsok.com/> Now, you're > ready! > > > > Ryan McNeill > Database Editor The Oklahoma Publishing Co > > <http://maps.google.com/maps?q=9000%20Broadway%20ext%20Oklahoma%20City%2073114> > 9000 N Broadway > Oklahoma City, OK 73114 > <mailto:rmcneill@oklahoman.com> rmcneill@oklahoman.com > <http://www.newsok.com/> http://www.newsok.com > tel: 405 475-3694 > fax: 405 475-3183


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