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