Implicit conversion from source type

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
kksr
Participant
Posts: 37
Joined: Fri Dec 30, 2005 5:57 am

Implicit conversion from source type

Post by kksr »

Hi All

I have a source column whichis having length of 40 , I need to do a lookup with another table and the olumn lngth of Looup table is 26 ,after running the job I am getting this Warning.

"Implicit conversion from source type "string[40]" to result type "ustring[max=26]": Possible truncation of fixed length string. "

How to handle this warning in job level.

Thanks in Advance
Kiran
KKSR
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

How can you expect a string whose length is 40 to compare correctly with string length of 26?

Why don't you increase the length of lookup column to 40?
kksr
Participant
Posts: 37
Joined: Fri Dec 30, 2005 5:57 am

Post by kksr »

Source column length is 40(Its fixed widath file) , but the actual length of the value is 26 , the lookup is working fine loading the data in target , only concern is warning .
KKSR
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

If you are confident that rest of length are spaces you can demote this warning into an info using message handler.

But still, i would rather prefer transforming the source to have length of 26 before lookup. In this case message handler is not required.
kksr
Participant
Posts: 37
Joined: Fri Dec 30, 2005 5:57 am

Post by kksr »

Mesage Handler is not enabled for me , is there any othe ralternative , pls suggest

Thanks in advance
KKSR
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

use modify stage and convert source size 40 to 26 and do the look up.

your problem resolved.
Srinu Gadipudi
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

kksr wrote:Mesage Handler is not enabled for me , is there any othe ralternative , pls suggest

Thanks in advance
I guess i had given an alternative in my previous post.
Hari_Reddy
Participant
Posts: 1
Joined: Tue Dec 09, 2008 11:40 am
Location: pune

Post by Hari_Reddy »

just you can increse the lenth of Lookup table Column is 40. then you can not get this type of worning,
Hari
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post by AmeyJoshi14 »

Hari_Reddy wrote:just you can increse the lenth of Lookup table Column is 40. then you can not get this type of worning,
Or
do substring in the source
Or
do substring in the lookup stage.
that is column_name[1,26]

Same solution as balajisr said! :D

Hope this will help you out!! :wink:
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You can put a job level or project level handler to demote this warning message and suppress it from the log; but as you can see from the reactions of the other posters, this is not a good idea and the best (and correct) solution is to avoid this truncation problem by either making the fields appropriately sized or by using an explicit truncation function on the larger string and redefining it to the shorter length.
Post Reply