Implicit conversion from "string" to string[max=2

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
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Implicit conversion from "string" to string[max=2

Post by jweir »

Hello,

I am getting the following warning below. My column defination for both my input and my output for this transformer is VarChar(255). Usually this warning means the input is unbound, but this is not the case. The metadata is a match (from what I can tell). Can someone shed some light on this?

Code: Select all

Xfmr_1: When checking operator: When binding input interface field "COLUMN1" to field "COLUMN1": Implicit conversion from source type "string" to result type "string[max=255]": Possible truncation of variable length string.
Thanks in advance.
Jweir

--- If strength were all, tiger would not fear scorpion.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's not VarChar(255) on the input link; it's VarChar with nothing in the Precision field. Therefore DataStage is alerting you to the fact that your design is mapping an unbounded string into a bounded string, which might lead to loss of data.

To fix, make sure your metadata are correct and consistent.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Thanks for the reply Ray.

Unfortunately, I am not a premium member so I cannot view your post. But I hopefully got the gist. Where is the "Precision" column you are referring to? I thought strings did not have "Precision" options. There is a "Scale" and "Extended" option. But both of these columns are blank in the input and output metadata.
Jweir

--- If strength were all, tiger would not fear scorpion.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

jweir wrote: Where is the "Precision" column you are referring to? I thought strings did not have "Precision" options.
Precision is length of the string defined in the metadata. Scale is the one which is not applicable for String datatype.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Check transformer Xfmr_1 to see if you can see any '255' number defined for COLUMN1 in any of the output link. This doesn't seem to be related to stage variable but that is also a place to look for.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
prasannakumarkk
Participant
Posts: 117
Joined: Wed Feb 06, 2013 9:24 am
Location: Chennai,TN, India

Post by prasannakumarkk »

Which stage is feeding data to this stage.
Thanks,
Prasanna
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

The input link does have "Precision" of 255 (assuming "Precision" equals length). The stage before Xfrm_1 has length of 255 as well.
Jweir

--- If strength were all, tiger would not fear scorpion.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then you need to set the environment variable (called something like APT_SHOW_SCHEMAS) to find out whereabouts in your job the unbounded string is being used. Though, from the error message, it would appear to be in a stage called Xfmr_1. Possibly in a stage variable derivation?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

I set the OSH_PRINT_SCHEMAS environment variable, but it was not a help. The log showed the same as before. I am working in version 9.1.

The stage that this column is being sourced from is a lookup file set. The column on that stage is Varchar(255) nullable. After the lookup, it is my transformer, which also has Varchar(255) nullable. So every stage in that sequence has the same metadata.

Could it have something to do with the lookup file set source file? Can the source column actually be unbounded in the file, and even though I specified Varchar(255) in the metadata, Datastage still recognizes it as unbounded?
Jweir

--- If strength were all, tiger would not fear scorpion.
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

I got rid of these warnings when I defaulted the NULLs. Using something like below:

Code: Select all

If IsNull(COLUMN1) Then "999999" Else COLUMN1
the warnings disappeared. Not sure if this is a resolution or a workaround due to the fact that I did not know why this worked, but I will mark it as resolved for now.
Jweir

--- If strength were all, tiger would not fear scorpion.
Post Reply