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 (June 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 15 Jun 2006 19:28:56 -0700
Reply-To:   Paul <paulvonhippel@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Paul <paulvonhippel@YAHOO.COM>
Organization:   http://groups.google.com
Subject:   pass-through SQL: merging SAS dataset with DB2 table
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset="iso-8859-1"

I want to get some records from a DB2 table. IDs for the rows that I want are given in a SAS data set.

A simple solution, using PROC SQL, would be to join the DB2 table to the SAS data set, using the IDs as a key. But this would be very slow because the DB2 table is very large.

To speed processing of the DB2 table, I can use pass-through SQL. But then I can't join the DB2 table to the SAS data set.

I think this issue has been discussed before. A popular solution is to read the ID values from the SAS data set, then incorporate a list of ID values into the SQL query. There is a limit, however, to the number of values that can be listed in a SQL query -- so sometimes the list must be broken up across several queries.

Some of you have confessed to writing macros to do this. I would be most grateful if you would share your code.

Many thanks and best wishes, Paul


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