SASPlex SQL and Teradata

Database

SASPlex SQL and Teradata

I am creating SQL code in the SASPlex environment that has to transfer data from SASPlex to Teradata, run SQL in Teradata, and transfer data back to SASPlex. My original code runs in Teradata with no issues, but i have to create a batch process to run in SASPlex. I'm not proficient in SASPlex and needed help with this error.

PROC SQL;

CONNECT TO &rchtera;

EXECUTE (INSERT INTO user_work.table as

(SELECT a.REF_NO, b.pid, b.pid_no, a.tin, 0,1

FROM user_work.temp_table  a

INNER JOIN vmonth.pid_rb b

ON a.tin=b.tin_no

AND b.tin_typ_cd='1'

AND b.invld_tin_in IS NULL

AND b.cst_prspc_cd='CST'))BY TERADATA;

QUIT;

174

175  PROC SQL;

176  CONNECT TO &rchtera;

177  EXECUTE (INSERT INTO user_work.table as

178  (SELECT a.REF_NO, b.pid, b.pid_no, a.tin, 0,1

179  FROM user_work.temp_table  a

180  INNER JOIN vmonth.pid_rb b

181  ON a.tin=b.tin_no

182  AND b.tin_typ_cd='1'

183  AND b.invld_tin_in IS NULL

184  AND b.cst_prspc_cd='CST'))BY TERADATA;

ERROR: Teradata execute: Syntax error, expected something like a 'SELECT' keyword between the

       word 'table' and the 'as' keyword.

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.

185  QUIT;