mod stage

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
suresh_dsx
Participant
Posts: 160
Joined: Tue May 02, 2006 7:49 am

mod stage

Post by suresh_dsx »

Hi,
I tried the below syntax for converting decimal to string using modify stage.

Source column:CUST_ID/decimal/38/Key column
Modify stage Derivation:CUST_ID:string[2]=string_from_decimal[suppress_zero](CUST_ID)

Target column: CUST_ID/varchar/1

I am getting the below warning:
Error when checking operator:
When binding output schema variable "outRec": When binding output interface field "CUST_ID" to field "CUST_ID": Conversion from source type "decimal [38, 0]" to result type "string [2]": Not enough room in string for decimal [38, 0].

How can I convert using modify stage from decimal to string (38 to 2)?


Any help greatly appreciated.

Thanks and Regards,
Suri
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

How can you convert a number such as 537276302 into a string with a maximum length of 2 characters?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can save a Decimal(38,0) in a String(max=40) but not successfully in a String(2). Think about why that is.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Then put it into a string of length 40 so the conversion cannot cause an error, and use strnig truncation to copy that into a length 2 column.
Post Reply