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?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.