|
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
|