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
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
|