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 (September 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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)

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