Page 1 of 1

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

Posted: Tue Mar 05, 2013 12:53 pm
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.

Posted: Tue Mar 05, 2013 1:29 pm
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.

Posted: Tue Mar 05, 2013 1:42 pm
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.

Posted: Tue Mar 05, 2013 2:33 pm
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.

Posted: Tue Mar 05, 2013 2:38 pm
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.

Posted: Tue Mar 05, 2013 11:47 pm
by prasannakumarkk
Which stage is feeding data to this stage.

Posted: Wed Mar 06, 2013 5:06 pm
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.

Posted: Thu Mar 07, 2013 2:53 am
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?

Posted: Mon Mar 11, 2013 3:11 pm
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?

Posted: Mon Mar 11, 2013 3:30 pm
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.