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 (March 1997, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 12 Mar 1997 11:43:44 -0600
Reply-To:     "Ronald W. Manley" <JAN7089@VM1.UCC.OKSTATE.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         "Ronald W. Manley" <JAN7089@VM1.UCC.OKSTATE.EDU>
Organization: Oklahoma State University, Stillwater OK
Subject:      Re: separate character variable
Content-Type: text/plain; charset=us-ascii

jerry mcgwin, jr. wrote: > > i am working with a dataset that contains an individual's first, middle and > last name in one variable (NAME). i would like to separate this one > variable into its individual components (FNAME, MNAME, LNAME). is there a > straigtforward way to accomplish this? thanks. > > regards.

Hi. Jerry. Use x=indexc(NAME,' ') x returns the first occurance of the char defined in this case I used blank. Then use FNAME=substr(NAME,1,x) to get the first name and use REST=substr(NAME,x) to get the rest of the name then use y=indexc(REST,' ') to get the middle name and so on. I hope this helps. Ron {JAN7089@VM1.UCC.OKSTATE.EDU)


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