Data Truncation in Table.

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

hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Data Truncation in Table.

Post by hhh »

While loading Sql Server table through datastage, data is getting truncated in char and varchar data types' fields(Last character of every field), In table i have some numeric fields and not getting any data truncation there.

Have created PX job for same as i am using Odbc or DyRdbms stage and getting trucated data however with server job there is no trucation in data and table has been loaded perfectly.

What is d cause behind it ? is it problem during datastage installation ?

Please suggest your ideas on same.

Regads,
Hiten
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Could you tell us what the column definitions are and what length the truncations are occuring at (i.e. VarChar(4) but only 2 characters loaded). Also, since CHAR fields are fixed length, what kind of truncation is occurring there and what are the pad characters?
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

i have fields and its output :
Field Name Datatype I/p value O/P value O/p Datatype
a varchar(4) 'pp' 'p' Varchar(4)
b varchar(3) 'ppp' 'pp' Varchar(3)
c char(7) 'profile' 'profil ' char(7)


ArndW wrote:Could you tell us what the column definitions are and what length the truncations are occuring at (i.e. VarChar(4) but only 2 characters loaded). Also, since CHAR fields are fixed length, what kind of truncation is occurring there and what are the pad characters?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

A Char(7) field cannot have the value "profil". It might have the 7th character set to space or char(000) and not display that - could you check what that value actually is? Also, does the error go away if you write this to a sequential file? Are there any warning messages in the log files when you run this? If you increase the length of the columns by 1 in the PX job (even though it no longer matches the real table DDL) and run it - do you get warnings or truncation?
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

7 th character is some garbage(Junk) value.It is not space or any other specified value.In log file datastage doesnt throw any warning or err msg.
while writing to sequential file datastage does not give any warning or error in log file and i did not get any truncation on data
ArndW wrote:A Char(7) field cannot have the value "profil". It might have the 7th character set to space or char(000) and not display that - could you check what that value actually is? Also, does the error go away if you write this to a sequential file? Are there any warning messages in the log files when you run this? If you increase the length of the columns by 1 in the PX job (even though it no longer matches the real table DDL) and run it - do you get warnings or truncation?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This is certainly an odd problem. If you add that one character to the PX job definitions does it work? Also, do you have NLS enabled (I'm just "shooting in the dark" here, looking for a possible cause)?
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

Have seen in DS Admin with project wise, NLS tab is not Enabled. can u pls more clerify on "If you add that one character to the PX job definitions does it work? "

ArndW wrote:This is certainly an odd problem. If you add that one character to the PX job definitions does it work? Also, do you have NLS enabled (I'm just "shooting in the dark" here, looking for a possible cause)?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In the output stage change your CHAR(7) to CHAR(8) and run the job. Is the data still truncated or does it work (or do you get another error message)?
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

Despite , data is getting truncated in output, only last character

ArndW wrote:In the output stage change your CHAR(7) to CHAR(8) and run the job. Is the data still truncated or does it work (or do you get another error message)?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Umm, now I am confused. If you declare this column as CHAR(8) and assign it the value "profile " it gets truncated to "profil "?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea:
You can disable the "cool" smiley and get Char(8) working right by checking "Disable Smilies in this post" at the bottom.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

No, getting value in output : "profile:Space(1)", but here if i use varchar(8) then getting "profil" as output.

ArndW wrote:Umm, now I am confused. If you declare this column as CHAR(8) and assign it the value "profile " it gets truncated to "profil "?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Can you distill this problem into a simple job with a row generator with just one column defined as CHAR(7) and with generated value of "profile" and going straight to your DB? If this still truncates then you can submit it to IBM/Ascential as a bug report.
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

With Row generator also data is getting truncated. you are right and we think that we have to raise this issue to IBM.

[quote="ArndW"]Can you distill this problem into a simple job with a row generator with just one column defined as CHAR(7) and with generated value of "profile" and going straight to your DB? If this still truncates then you can submit it to IBM/Ascential as a bug report.[/quote]
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

At least it is now a relatively simple test case for support. Please keep us informed on this thread so that someone with the same problem in the future can use this instead of going through the headaches that you are.
Post Reply