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 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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?
Comments: To: master2005_sas@YAHOO.COM
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


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