I have a scenario where I need to select data from a Teradata table in a database A. Use that result set to populate a SQL server temp table. This temp table needs to join with base SQL server table . The result set of this needs to be exported to another database table. Need to do it in SAS enterprise guide
This is my approach so far, First create a SAS data set
STEP 1
proc sql;
connect to teradata(user="abc" pw="def" database=cust fast load=yes mode=Teradata);
create table tmp_result as
select from connection to teradata
(
SELECT
Cust_id,
Name,
Product
FROM Teradata table where ProductId=10
)DISCONNECT FROM TERADATA;
QUIT;
STEP 2
proc sql;
connect to odbc(dsn=temp user="abc" pw="def" connection=shared);
create table ##tmp
(
Cust_id int
Name varchar(100),
Product varchar(50);
)disconnect from ODBC;
QUIT;
STEP 3--insert data into temp table from first SAS data set
step 4 -create a base sql server table out of the below select query
SELECT *
FROM base sql server table join temp table (above temp table)
step 5 again create a sas data set out of above step 4 result set and then in final step
step 6 insert step 5 result set into a teradata table database B.
I need help with my approach..I am still working on this solution but need your input if my approach is correct
Thanks in advance..