Page 1 of 1

truncate on DB2

Posted: Fri Feb 18, 2005 10:27 am
by coxm19
I am doing a simple transfer from one SQL table to another. Table b is a copy of table a (same column definitions). However, when I run a job to copy data from table a to table b, all character fields truncate at 10 characters. The Table Definition for both columns is a length of 12. The same transfer works using SQL DTS. Any ideas? Thanks.

Posted: Fri Feb 18, 2005 10:34 am
by Sainath.Srinivasan
Check the column length defined within DataStage stages.

Also the varchar values may be trimmed.

Posted: Fri Feb 18, 2005 11:03 am
by coxm19
The column size is 12 for the particular column I'm testing with for both the Source and Target. Interesting new information, when I View Data from the source, it truncates to 10 characters and then adds 2 blank spaces. i.e Source in DB = "AscentialDataStage" View Data from Source = "AscentialD " Target in DB = "AscentialD"

Posted: Fri Feb 18, 2005 11:11 am
by Sainath.Srinivasan
Try connecting the source stage directly to a sequential file and test the result written in the seq file.

Can you explain the job and the steps so to try to replicate the error.

Posted: Fri Feb 18, 2005 11:20 am
by coxm19
I am just testing a simple copy from TableA to TableB (which are exact replicas of eachother). Originally I was going from DB2 to SQL, now just trying to go from SQL to SQL.

Sequential file truncates after 10 characters.

Posted: Tue Feb 22, 2005 8:18 pm
by gpatton
Check the display length column. My guess is that it is set to 10. Set this to the maximum length (12 in this case).

Posted: Wed Feb 23, 2005 9:00 am
by Sainath.Srinivasan
Gpatton,

I believe that has already been checked and confirmed to be 12 in the source, transform(s) and target. Also in the source and target table themselves outside datastage.

Posted: Wed Feb 23, 2005 9:11 am
by gpatton
What version of DB2 are you using, as well as what platform is it on?

As well, are you using ODBC or DB2 stage to connect to database?

Posted: Wed Feb 23, 2005 3:12 pm
by ray.wurlod
Did you check Display Width (not Precision)? Display width affects the width used in fixed-width format text files. Precision is part of the SQL data type definition for Char and VarChar data types.