If it's about passing a single value as a constant to an SQL statement then consider something like the following (more or less the approach you drafted):
data _null_;
set yourtable;
if then
do;
call symput('MyMacroVar',cats("'",myvar,"'"); /* pass value of myvar to macro variable &MyMacroVar */
stop; /* no further iterations through dataset */
end;
run;
proc sql;
....
where MyField=&MyMacrovar ....
....
quit;
If it's about joining (subselect,...) two tables, one in Oracle and one in SAS then let us know.
HTH
Patrick
P.S. Just in case you don't know this one already:
options sastrace=',,,d' sastraceloc=saslog;
http://support.sas.com/onlinedoc/913/getDoc/en/acreldb.hlp/a000433982.htm
Message was edited by: Patrick
... View more