Date: Fri, 24 Sep 2004 14:50:29 -0400
Reply-To: "Fehd, Ronald J." <RJF2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <RJF2@CDC.GOV>
Subject: Re: name parsing
Content-Type: text/plain; charset="us-ascii"
> From: ron nixon
> I'm trying to parse names that look like this
>
> Kennedy, John F
> Nixon, Richard M
> Franklin, Ben
> Hammond, Tom
> Silver, Marty F
>
> Some have middle names and others don't. Any
> suggestions on using SAS functions to parse this into
> three fields?
that would be the scan function
NameLast = scan(Name,1);
NameFirst = scan(Name,2);
if index(NameFirst,' ') then
NameMidInitial = scan(NameFirst,2);
RTFM on default delimiters used by function scan
Ron Fehd the macro maven CDC Atlanta GA USA
SAS 9.1.3 (TS1M3)
|