String to decimal

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
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

String to decimal

Post by monaz »

Hi ,

I have one requirement where I need to convert string to decimal tried different ways by searching in the forum but nothing worked out.

Here is the example
From Source I am getting Varchar(10) and target datatype is decimal(8,2)

Source: +001000.22
Expected :- +001000.22

If the source is -001000.22
Expected in the target :- -001000.22

I tried StringTodecimal function in the transformer and applied a peek stage and viewed the data it looks okey but when I check in the db2 database it just populate as "1000."

Could anyone guide me where I would have gone wrong?

Thanks
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Re: String to decimal

Post by jwiles »

Start diagnosing the problem by answering the following questions:

How is the column defined within the database?

How are you viewing the data that has been loaded into the database? Using the db's client software (or other), or view data (or similar) within DataStage? Have you tried other methods of viewing the data?

How are you loading the data to the database? What stage, write method, column definition?

Are you receiving any warnings regarding truncation/precision within the job logs?

What happens to the data between transformation (StringToDecimal) and being loaded to the database and then viewed? Verify the datatype at each step along the way.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply