Date: Wed, 14 May 2003 11:36:45 -0700
Reply-To: Robert Pope <eschpope99@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Robert Pope <eschpope99@NETSCAPE.NET>
Subject: Merging a large and small dataset
Content-Type: text/plain; charset=ISO-8859-1
I have a 4,000,000+ record file with policyholder information. Then I
have two 5,000 record files: one associates plancodes with the
reporting product line, the other associates treaty codes with
I want to add the appropriate reporting product line and reinsurance
company name to each record in my policyholder file, while maintaining
the existing sort (non-)order.
The obvious solution is to add an _N_ variable, followed by a
SORT/MERGE for product followed by a second SORT/MERGE for reinsurer,
followed by a SORT by _N_. But those 3 sorts add an excessive amount
of run time to the program (IIRC 1 hour per sort). Is there a way to
avoid having to SORT the main dataset, perhaps with something like
Excel's VLookup function?
I would almost be tempted to hard-code the two small files into the
main data step, except they are continually updated.