Teradata can only "see" its own tables.
You will have to create a libname that points to the Teradata database, and use your SAS code to create the dataset there:
libname gold /* all the necessary options to connect to the Teradata database "gold" */;
proc sql;
create table gold.apple as
select distinct code
from loc1.codes
where product = 'big apples'
group by codes;
quit;
Now you can do
proc sql;
connect to teradata as tera(server=? user=? password=? mode=teradata connection=global);
execute(
create multiset volatile table ig as (
select distinct s.1,
g.code,
s.2,
s.3
from gold.apple as g left join silver.apple as s
group by code
)
with data primary index (code) on commit preserve rows
)
by tera;
quit;
as the dataset is now available as a Teradata table in the database.
... View more