AsInteger(StringToDecimal(Field1)) producing output -1

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
Bone615
Participant
Posts: 1
Joined: Mon Feb 05, 2007 5:59 pm

AsInteger(StringToDecimal(Field1)) producing output -1

Post by Bone615 »

Any suggestions?

We have an input column going into a transformer as char 11.

We do the following to it:
AsInteger(StringToDecimal(ToTfmLC.CYBORG_LC_NBR))

The result of the above goes to a column that is bigint 19

when we send LC# 44706553390 through as input(ToTfmLC.CYBORG_LC_NBR) it
returns bigint 44706553389 or -1 of the string value that
went in as input.

CHAR 11
BIGINT 19
Input value(ToTfmLC.CYBORG_LC_NBR) Function used
Result value (one less than input value)

44706553390
AsInteger(StringToDecimal(ToTfmLC.CYBORG_LC_NBR)) 44706553389
44712358726
AsInteger(StringToDecimal(ToTfmLC.CYBORG_LC_NBR)) 44712358725
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

What is the value when you do StringToDecimal(). Also what happens when you send rtype as 'round_inf' for StringToDecimal() ?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Integer (or int8) can only contain values less than 2^31 (2147483648).

AsInteger must fail for BigInt where the value is larger than that if the target column's data type is Integer.

The manual (Parallel Job Developer's Guide) is not clear on whether AsInteger can handle BigInt (or int16).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

Cross referencing this issue as also existing in 8.1

viewtopic.php?t=150110
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
Post Reply