There is a limit to the number of values ORACLE will accept on an IN operator (in ORACLE 10g, 1000 is the max). Consider using a join to an in-line view. Something like this might do the trick:
proc sql;
create table TEST as
select s.*
from oracle.sample as s,
(select unique id from orcl.notice) as list
where s.id=list.id
;
quit;
Another option is to make a temp table out of the results of the subquery, and use that for a join. Otherwise, you might try splitting the list results into segments of 1000 or less and using separate IN operators and logical ORs: "where ID in (1,2,3...,999) OR ID in(1000,1001,1002,...1999)" etc
... View more