Truncation of Data

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
samu
Charter Member
Charter Member
Posts: 16
Joined: Wed Aug 24, 2005 2:50 pm

Truncation of Data

Post by samu »

Hi,

I have a simple job of copying data one table in one Database to another table in other database. But when I trying to copy the data using Parallel Extender job it is truncating the last digit in the column even though the Column is defined as varchar. I had tried increasing the length of the column and also trim but it didn't work . So I had done a Server job of the same data dump and it is working fine. So can some one explain to me why the data is being truncated by the PX job. I am using DRS stage to dump the data since the respective databases are sitting on MSSQL servers.

The column in question has data as 1000, Z123 etc.,

Thanks.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

DS 7.5.1A SQL Server drivers does not support SQL Server 2005. For that, you need to ask IBM for DataDirect5.2 drivers which will allow you to write to a SQL Server 2005 database.

For a temporary solution, you need to add a transformer right before the load using the DRS stage. Then, for every varchar column, in the Derivation, add a space. So if your column was called Address, you do:

Address: " "

In the output column of the transformer, increase the width by 1 so the input column coming to the DRS stage will be increased by 1 automatically. This will take care of the problem.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Re: Truncation of Data

Post by us1aslam1us »

samu wrote:Hi,
The column in question has data as 1000, Z123 etc.,
Thanks.
What is the data-type and length for this field in source? How are you cinfirming that the ' last digit' is missing through 'view data' or by query on target table. When you load is working fine with server job, it will work with parallel too unless you are not designing your PX job properly.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
samu
Charter Member
Charter Member
Posts: 16
Joined: Wed Aug 24, 2005 2:50 pm

Re: Truncation of Data

Post by samu »

us1aslam1us wrote:
samu wrote:Hi,
The column in question has data as 1000, Z123 etc.,
Thanks.
What is the data-type and length for this field in source? How are you cinfirming that the ' last digit' is missing through 'view data' or by query on target table. When you load is working fine with server job, it will work with parallel too unless you are not designing your PX job properly.
As I had said the job is simple it has DRSstage (MSSQL server 2000) -- Transformer --- DRSstage (MSSQL server 2005). the length of the column is the same in both the databases. the job is designed the same way for both parallel and server jobs. So is there any mistake in the design of the job :roll:.The data is queried on the target table in the target database.
Post Reply