BookmarkSubscribeRSS Feed
Vi_
Fluorite | Level 6 Vi_
Fluorite | Level 6

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

SASKiwi
PROC Star

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.

Vi_
Fluorite | Level 6 Vi_
Fluorite | Level 6

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 17 replies
  • 4584 views
  • 1 like
  • 8 in conversation