|
You need to Cartesian join the two datasets together and use index() -
This joins all records of set1 and set2 and checks if set2.source contains
set1.excerpt. Since it's a Cartesian join it will grind through all
combinations of the two datasets. If you can include in the join a specific
comparison, like "where zipcode1=zipcode2" it will allow the optimizer to
significantly reduce the processing.
proc sql noprint;
create matches as
select *
from set1, set2
where index(set2.source,set1.excerpt) > 0 ;
quit;
good luck -
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: Haynes, Zac [mailto:ZHaynes@BCBSM.COM]
Sent: Monday, August 25, 2003 11:30 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Ways to code (if Var contains the value of an Obs in another SAS
dataset).
Dear SAS-l
What are some efficient ways to compute whether a variable ($char80.)
contains the value of one of the observations of another SAS dataset?
Zac Haynes, Systems and Applications Programmer, 714-404-8840.
ISPF Dialog, REXX, Assembler, SAS, Endevor, DB2, SQL, & Macro.
|