truncate on DB2

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
coxm19
Charter Member
Charter Member
Posts: 8
Joined: Tue Jun 29, 2004 5:43 pm

truncate on DB2

Post 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.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Check the column length defined within DataStage stages.

Also the varchar values may be trimmed.
coxm19
Charter Member
Charter Member
Posts: 8
Joined: Tue Jun 29, 2004 5:43 pm

Post 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"
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
coxm19
Charter Member
Charter Member
Posts: 8
Joined: Tue Jun 29, 2004 5:43 pm

Post 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.
gpatton
Premium Member
Premium Member
Posts: 47
Joined: Mon Jan 05, 2004 8:21 am

Post 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).
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post 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.
gpatton
Premium Member
Premium Member
Posts: 47
Joined: Mon Jan 05, 2004 8:21 am

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply