Hi all,
Can any one help me out with how this can be achieved using Transformer.
I have the following input( Double= type)
1234.89
-1234.00
2345.67
in the output, i need to get the following (fixed length of width 12)
+00001234.89
-00001234.00
+00002345.67
I am using the target type as Decimal(10,2), the negative sign is coming but the positive sign is not (Datastage default for '+' numbers is blank)
Can anyone help me out
Thanks!
Marcus
M
Number conversion
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
or
Code: Select all
Convert(' ', '+', yourNumberAsString)
-
- Participant
- Posts: 111
- Joined: Thu Jun 01, 2006 5:12 am
- Location: Detroit
That would add '+' where ever it finds space, even if found more then one space then it will add many '+' symbols so, the best way is.
in derivation, If Coulmn>=0 then '+':StringToDecimal(Columnname,000000000D00), Datatype should be Varchar.
If you are extracting data from Database and writing into a file then use
To_Char(Columnname,'00000000D00') in SELECT query and Add '+' by concating in transformer so that it will give expected result.
in derivation, If Coulmn>=0 then '+':StringToDecimal(Columnname,000000000D00), Datatype should be Varchar.
If you are extracting data from Database and writing into a file then use
To_Char(Columnname,'00000000D00') in SELECT query and Add '+' by concating in transformer so that it will give expected result.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom