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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.