Hi guys,
I knew this is an old post but I am running the same issue using EG 7.1.
However, I am able to run the program and get the same result from Teradata by changing Substring to substr in SAS. I am not sure why it work and would like to know is this appropriate?
Here's my example:
proc sql;
connect to Teradata as tera(
authdomain=TeraAuth
tdpid=xxxx
mode=teradata
connection=global
);
execute (
CREATE VOLATILE TABLE Test AS (
SELECT ID, Substr(ID,3,5) AS NewID
FROM YYYtable
GROUP BY 1,2
) WITH DATA ON COMMIT PRESERVE ROWS
) by tera;
If I change to Substring (ID, 3,5) to Substr(ID,3,5) in sas, it works and gives me the same result like Tera's......If someone could support my solution or explain a bit would be great.
Thanks in advance,
Vi
So what confirmation do you want beyond the fact that the sub-string function is named differently in two different flavours of SQ? I suggest you look up the documentation for both for more details.
Hi,
So I looked up Teradata's documentary. Substring and Substr are slightly different although they are all doing substring work.
SAS Substr is equal to Substring in Teradata.
My confusion is that when I code in sas, I ask sas to connect to Tera and perform query in tera, and then, create table in sas. So how did Teradata understand SAS substr and perform the query?
Thanks,
Vi
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.