Hi ,
i am getting amounts as 1045000, 8982..etc but i need to load as
10450.00, 89.82..ect..can you help me how to get this done in datastage
decimal issue
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 194
- Joined: Thu May 11, 2006 9:42 am
decimal issue
Thanks,
Chris Jones
Chris Jones
-
- Participant
- Posts: 194
- Joined: Thu May 11, 2006 9:42 am
amount col in source is varchar(12) and target is decimal is (10,2), so i used the below string to decimal function but no getting the required output..data is getting loaded same as source wihout 2 decimals
If Trim(NullToValue(match_pymt_id.PROJECTED_SPEND,'0')) = '0' then 0
Else if trim(match_pymt_id.PROJECTED_SPEND)='' then '0' else StringToDecimal((TrimLeadingTrailing(match_pymt_id.PROJECTED_SPEND)))
If Trim(NullToValue(match_pymt_id.PROJECTED_SPEND,'0')) = '0' then 0
Else if trim(match_pymt_id.PROJECTED_SPEND)='' then '0' else StringToDecimal((TrimLeadingTrailing(match_pymt_id.PROJECTED_SPEND)))
Thanks,
Chris Jones
Chris Jones
-
- Participant
- Posts: 194
- Joined: Thu May 11, 2006 9:42 am
or
can i do like this, get the amount except last 2 digits concatinate with '.' and then get get the last 2 digits.
ex 8986 =89'.'86 => 89.86
if the above thing works , can someone tell me how to get the amount except the last two digits and also how to get just the last two digits since the source amount length keeps on changing
can i do like this, get the amount except last 2 digits concatinate with '.' and then get get the last 2 digits.
ex 8986 =89'.'86 => 89.86
if the above thing works , can someone tell me how to get the amount except the last two digits and also how to get just the last two digits since the source amount length keeps on changing
Thanks,
Chris Jones
Chris Jones
Re: decimal issue
You may try DecimalToDecimal() In the stage variables and assign the variable value to the column
Rahul
DS Lover
DS Lover
Re: decimal issue
In fact try assigning your string value to a decimal type stage variable....
Datastage would implicitly handle it.
Datastage would implicitly handle it.
Rahul
DS Lover
DS Lover