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
Content-Type: text/plain; charset="iso-8859-1"
Country = Scan( Item , 1 , '-' ) ;
"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
> 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,
> 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 " - " ??