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 (January 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 6 Jan 2011 15:44:33 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: partitioning a variable
Comments: To: hl2493@yahoo.com
In-Reply-To:  <409880.46236.qm@web114413.mail.gq1.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Country = Scan( Item , 1 , '-' ) ;

Toby Dunn

"I'm a hell bent 100% Texan til I die"

"Don't touch my Willie, I don't know you that well"

> Date: Thu, 6 Jan 2011 07:38:36 -0800 > From: hl2493@YAHOO.COM > Subject: partitioning a variable > To: SAS-L@LISTSERV.UGA.EDU > > Hi, > > I would like to extract a country name from a variable called 'Item'. > The variable 'Item' contains some other information as well as the country name. > For example, > > Item > Antigua and Barbuda - Independence Day Hello Hello > Canada - Columbus Day chair chair > Cape Verde - new years day Labor Day > ..... > > > I would normally use "substr" to partitioning a variable; but, I don't think I > can use it in this case because some country names are very very long. > Is there a way that I can capture the characters(country names) from 'Item' > which are showing before " - " ?? > > Thanks, > > KR > > >


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