LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 1 Mar 2002 14:02:04 -0500
Reply-To:     "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Subject:      Re: scanning
Comments: To: Shannon <swheatma@FJC.GOV>
Content-Type: text/plain; charset="iso-8859-1"

Shannon,

How about something like this?

data text ; text = "NOTICE OF APPEAL, defendant filed a motion; in court to appeal" ; output ; text = "NOTICE OF APPEAL, filed in court" ; output ; text = "NOTICE OF UNAPPEALING TASK, unfiled in court" ; output ; text = "NOTICE OF APPEAL, filed a motion in court to appeal" ; output ; text = "NOTICE OF APPEAL, defendant" ; output ; run ;

options validvarname = v7 ; %macro searcher ; %local punct search parm c ; %let punct = %str(,;) ; %let search = motion appeal defendant ;

data q ; array s (11) _temporary_ (10*0 1) ; set text ; %let c = 1 ; %do % while (%scan (&search, &c) ne ) ; %let parm = %scan (&search, &c) ; do _iorc_ = 1 by 1 until ( _n_ or s(_iorc_) ) ; _n_ = (scan ( compbl ( lowcase( compress (text,"&punct") ) ), _iorc_ ," " ) = "&parm" ) ; end ; &parm = _n_ ; %let c = %eval (&c + 1) ; %end ; run ; %mend searcher ;

%searcher

Kind regards,

Venky #****************************************# # E-mail: venky.chakravarthy@pfizer.com # # swovcc@hotmail.com # # Phone: (734) 622-1963 # #****************************************#

-----Original Message----- From: Shannon [mailto:swheatma@FJC.GOV] Sent: Friday, March 01, 2002 9:26 AM To: SAS-L@LISTSERV.UGA.EDU Subject: scanning

Hello,

Is there anyway to scan the first 10 words of the example below and flag whether certain words appear (i.e. motion, appeal, defendant - I'd want a flag variable for each):

NOTICE OF APPEAL, defendant filed a motion in court to appeal . . .

Thanks, Shannon


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