I wrote a load to Teradata using SAS DI 4.2.
I'm using a Join with USER WRITTEN body to do the
proc sql ;
connect to TERADATA
(
SERVER=THE_SERVER AUTHDOMAIN='the_auth_domain' SCHEMA=the_schema );
execute (
INSERT INTO target_table
(column1, column2, etc)
Select column1, column2, etc.
FROM source1
INNER JOIN source2 on SOURCE1.COLUMNX= SOURCE2.COLUMNX;)
by Teradata;
when run
ERROR: Teradata execute: Right truncation of string data.
btw - this is a known problem with SAS interface to Teradata: 14383 - "ERROR: Teradata execute: Right truncation of string data" when usingthe SAS/ACCESS Interfac...
the workaround is to:
To resolve this problem, use MODE=TERADATA. This MODE is documented in
the Teradata white paper. Please see the link below:
how would I do that in SAS DI?
Did you try adding the MODE option to the connect statement?
proc sql ;
connect to TERADATA
(
SERVER=THE_SERVER AUTHDOMAIN='the_auth_domain' SCHEMA=the_schema
MODE=TERADATA
)
;
execute
(
INSERT INTO target_table (column1, column2, etc)
Select column1, column2, etc.
FROM source1
INNER JOIN
source2
on SOURCE1.COLUMNX= SOURCE2.COLUMNX
) by Teradata
;
Did you try adding the MODE option to the connect statement?
proc sql ;
connect to TERADATA
(
SERVER=THE_SERVER AUTHDOMAIN='the_auth_domain' SCHEMA=the_schema
MODE=TERADATA
)
;
execute
(
INSERT INTO target_table (column1, column2, etc)
Select column1, column2, etc.
FROM source1
INNER JOIN
source2
on SOURCE1.COLUMNX= SOURCE2.COLUMNX
) by Teradata
;
thanks Tom. Adding MODE=TERADATA option to the CONNECT statement worked for me.
The SAS Note you posted is for SAS8.2. Are you sure that the error is not simply caused by a Teradata column too short for the string you want to insert?
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.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.