BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
steve_db
Calcite | Level 5

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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

  ;

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

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

  ;

steve_db
Calcite | Level 5

thanks Tom. Adding MODE=TERADATA option to the CONNECT statement worked for me.

Patrick
Opal | Level 21

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?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 3 replies
  • 27987 views
  • 1 like
  • 3 in conversation