i have a decimal field in a file, to which data is loaded as 00000.0, instead of 0.0, for an input 000000. Even after i do a trimming on 0s, the problem is not solved.
Intially the input is char and i am converting it to decimal using string to decimal and i get this - 00000.0 (for 5,1) and again loading into a char field in the xml, which is loaded as 00000.0.
can anyone tell me how to remove the leading zeros from this?
decimal field problem
Moderators: chulett, rschirm, roy
Welcome Aboard
It is doing what you asked it to do. Converting it to Decimal(5,1). What is the datatype of this particular column, as defined in your output link. What is your output , is it a flat file or database?
It is doing what you asked it to do. Converting it to Decimal(5,1). What is the datatype of this particular column, as defined in your output link. What is your output , is it a flat file or database?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
thanks for ur reply.DSguru2B wrote:Welcome Aboard
It is doing what you asked it to do. Converting it to Decimal(5,1). What is the datatype of this particular column, as defined in your output link. What is your output , is it a flat file or database?
this is wat has to be achieved:
A column (string 6) wth value for eg., 000000 from a dataset needs to be loaded into xml with decimal (5,1), as using a decimal in xml didnt give favorable output, it was being used as a char of lenght 10 and we faced the abbove said problem...
pls help in solving the problem
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
ur, wat, lenght,abbove and pls do NOT belong to the english language. And hence makes it difficult to understand your posts. Can you please correct/edit your post?vij wrote:
thanks for ur reply.
this is wat has to be achieved:
A column (string 6) wth value for eg., 000000 from a dataset needs to be loaded into xml with decimal (5,1), as using a decimal in xml didnt give favorable output, it was being used as a char of lenght 10 and we faced the abbove said problem...
pls help in solving the problem
There is always the 'preview' button to check for misspells or typos or format issues. Use it.
![Smile :)](./images/smilies/icon_smile.gif)
Thanks,
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Search would have revealed to you that Decimal data are always displayed with leading an trailing non-significant zeroes, so that you can be sure that precision and scale are working correctly, and so that they can correctly populate fixed-width format files. Such decimal values can correctly be loaded into database tables.
So why do you want to remove the leading zeroes? It's not necessary.
If you want to persist, convert to VarChar() and trim from there. You can do this with a Modify stage or with a Transformer stage.
So why do you want to remove the leading zeroes? It's not necessary.
If you want to persist, convert to VarChar() and trim from there. You can do this with a Modify stage or with a Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.