I have been looking at this code syntax for hours, the Teradata code runs in a different environment, but bringing it through Enterprise Guide is giving me issues. The error I am getting is: ERROR: Teradata execute: Syntax error: expected something between ')' and ';'. I can't seem to figure out what the issue is. I appreciate any help or insight on this.
PROC SQL NOERRORSTOP;
CONNECT TO TERADATA (AUTHDOMAIN=xx server="xxx" connection=global mode=teradata);
execute (drop table TestServer.Test3) BY Teradata;
execute (create table TestServer.Test3 as
(
select *
from TestServer.Test1
UNION ALL
select *
from TestServer.Test2
))BY Teradata;
quit;
In Teradata syntax there are two key things you have left out.
1) At the end of the CREATE TABLE statement you need some like WITH DATA (look up the syntax I don't remember it exactly) if you actually want the data to be saved.
2) Teradata is a highly parallel setup. It does this by partitioning the data with a PRIMARY INDEX. You want a primary index that does not skew the data so that only some of the "nodes" have all of the data. If you do not specify the PRIMARY INDEX then it will pick the first variable. Which might be a very poor choice.
Try it without the extra brackets:
PROC SQL NOERRORSTOP;
CONNECT TO TERADATA (AUTHDOMAIN=xx server="xxx" connection=global mode=teradata);
execute (drop table TestServer.Test3) BY Teradata;
execute (create table TestServer.Test3 as
select *
from TestServer.Test1
UNION ALL
select *
from TestServer.Test2
) BY Teradata;
quit;
In Teradata syntax there are two key things you have left out.
1) At the end of the CREATE TABLE statement you need some like WITH DATA (look up the syntax I don't remember it exactly) if you actually want the data to be saved.
2) Teradata is a highly parallel setup. It does this by partitioning the data with a PRIMARY INDEX. You want a primary index that does not skew the data so that only some of the "nodes" have all of the data. If you do not specify the PRIMARY INDEX then it will pick the first variable. Which might be a very poor choice.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.