Date: Mon, 23 Jan 2006 17:23:09 -0600
Reply-To: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Subject: Re: scan?
Content-Type: text/plain; charset=US-ASCII
Mindy:
This is copied from online help:
"SCAN(string ,n<, delimiter(s)>) ...
If n is negative, SCAN selects the word in the character string
starting from the end of the string."
In your example, n=-1, hence it will return the last character string
after the last delimiter ' '.
J S Huang
1-515-557-3987
fax 1-515-557-2422
>>> Mindy <master2005_sas@YAHOO.COM> 1/23/2006 5:12:36 PM >>>
Here is the code I saw:
if scan(city, -1,' ')='CA' then city=substr(city, 1, len-2);
I understand what results I would get after run the code. But I want
to
learn more about the "-1"in scan. Any articles or any explanation are
very welcome. Thanks.
Mindy
|