DecimalToString 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
r.bhatia
Participant
Posts: 11
Joined: Mon Jun 30, 2008 12:45 am
Location: Manchester

DecimalToString conversion

Post by r.bhatia »

Hi,

I am facing the following problem in data transformation

The source is an ebcdic file,

1. source column details:
column name : AB_CD
column attribute : Decimal(1,0)
column value : 1

2. Transformation details:
straight mapping
even tried DecimalToString(AB_CD)

3. target column details:
column name : YY_ZZ
column attribute : char ( 8 )
column value : "1."

The problem is the additional "." which I am getting in the output, the same is propogating after load to the database.

How can I get rid of the "." charater, I need "1" as the output.
rakesh bhatia
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Decimals have decimal placeholders. End of story. If you want an integer, specify an integer data type.
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 »

Convert(Link.YY_ZZ,'.','') will remove the period.
r.bhatia
Participant
Posts: 11
Joined: Mon Jun 30, 2008 12:45 am
Location: Manchester

Post by r.bhatia »

Thanks Ray for the prompt reply.

As I have mentioned my source is an ebcdic file.

In ebcdic representation integer is internally stored as binary and decimal is internally stored in packed decimal format.

since i am reading them using Complex flat file, i read this source field as decimal and cannot read as integer as per my understanding.

So how can i do the conversion from decimal to integer and then charater? in oder to get the desired output?
Any pointers?

Thanks!
Rakesh
rakesh bhatia
jaideepbakre
Participant
Posts: 8
Joined: Mon Jun 18, 2007 5:11 am
Location: Mysore

Post by jaideepbakre »

HI,
Use AsInteger() function in the transformer stage.
I guess you will get 1 as the output.
Jaideep Bakre
Post Reply