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 (August 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 25 Aug 2003 13:00:49 -0700
Reply-To:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject:   Re: Ways to code (if Var contains the value of an Obs in another SAS dataset).
Comments:   To: "Haynes, Zac" <ZHaynes@BCBSM.COM>
Content-Type:   text/plain

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.


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