Implicit conversion

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
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Implicit conversion

Post by jpraveen »

Hi

Length precosion
source1 column
HOSP_NUM int 4 10


source2 column
PRVDR_FAC smallint 2 5




Target column
PRVDR_FAC smallint 2 5


I am using Lookup on 2 source columns (HOSP_NUM,PRVDR_FAC) and these are different types(int,smallint) and target is(PRVDR_FAC-smallint )
i am getting the error
When binding output interface field "HOSP_NUM" to field "HOSP_NUM": Implicit conversion from source type "int32" to result type "int16": Possible range limitation.
i had changed the Lenghts in between the stages but it's not working.
Jaypee
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

If you add $OSH_PRINT_SCHEMAS = true to your job parameters you can see the actual schema used between your stages. You are converting HOSP_NUM to a datatype with less possible value and thus you are getting the warning message. The best solution is to explicitly convert the data to the same types in your job to avoid this message.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

ArndW wrote:If you add $OSH_PRINT_SCHEMAS = true to your job parameters you can see the actual schema used between your stages. You are converting HOSP_NUM to a datatype with less possible value and thus you are getting the warning message. The best solution is to explicitly convert the data to the same types in your job to avoid this message.
A request for a more general discussion of the fact that the only place in Designer that one can code explicit conversions is the Transformer stage. When I see suggestions like yours, my first reaction is to shudder at the thought that some jobs will be full of Transformers just to avoid warning messages. :?
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course this alert will be generated. You have an int (that is, int32) in source1 and you're specifying that it should be transferred to a smallint (that is, int16) in the target. It's got nothing at all to do with length. int32 is a four-byte (binary) integer, int16 only has two bytes. There are int32 values that simply can not be loaded into an int16 field. That's why the alert is generated. If the source only contains int16s, alter the metadata appropriately.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jpraveen
Participant
Posts: 71
Joined: Sat Jun 06, 2009 7:10 am
Location: HYD

Post by jpraveen »

HI all

so i need to change the Datatype by using Modify stage or is there any other option.
Jaypee
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Transformer stage.
Copy stage. (You will still get the warning.)
Modifying the source metadata.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply