Seq. file retains the input as its coming in. Thats why you see it the way its fed into the seq. file.
Are you sure the .67 is changed to .00
That should not happen, you sure your looking at the right row both in input and output.
I dont have access to DataStage so cant test that right now. Someone here will have to confirm that.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSguru2B wrote:Seq. file retains the input as its coming in. Thats why you see it the way its fed into the seq. file.
Are you sure the .67 is changed to .00
That should not happen, you sure your looking at the right row both in input and output.
I dont have access to DataStage so cant test that right now. Someone here will have to confirm that.
Hello DSguru2B:
Am using the Basic transformer and yes am very sure.
And why are you doing that. Any specific reason of changing it to varchar. Change it back to decimal, with length 17 and scale 2. See what the results are.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Source TABLE
COL_NAME SQL TYPE LENGTH SCALE NULLABLE
out_fa003_lsmw.PAR_AMOUNT Dec 17 No
TARGET TABLE
COL_NAME SQL TYPE LENGTH SCALE NULLABLE
out_fa003_lsmw.PAR_AMOUNT VarChar 17 No
My source table is DB2 API table. When I view data from it I see the value shown correctly ie: 12345.67. When I straight map it to a seq file it changes its value to 0000000012345 when I keep the SQL TYPE to Decimal in my source table.
When I change my source table SQL TYPE to VarChar and use the FMT function:
FMT(out_fa003_lsmw.FORECAST_AMOUNT,"R2") get 12345.00
FMT(out_fa003_lsmw.PAR_AMOUNT,"16'0'R2") get 0000000012345.00
The problem is with the data coming from your source.The code which DSGURU gave you is perfect. The thing is that you are not defining the scale when you are pulling the data from the source.
Source TABLE
COL_NAME SQLTYPE LENGTH SCALE NULLABLE
PAR_AMOUNT Dec 17 whatever the scale is No
TARGET TABLE
COL_NAME SQL TYPE LENGTH SCALE NULLABLE
out_fa003_lsmw.PAR_AMOUNT VarChar 17 No