Hi ,
what would be the expected output if i try to read a string say "1024" using datatype decimal[4,2] in a sequential file ?
also what will be the output if the string is 10.
Please reply , I dont have an environment to check these things.
Thanks
string to decimal
Moderators: chulett, rschirm, roy
Re: string to decimal
Hi Abhi...Abhijeet wrote:Hi ,
what would be the expected output if i try to read a string say "1024" using datatype decimal[4,2] in a sequential file ?
also what will be the output if the string is 10.
Please reply , I dont have an environment to check these things.
Thanks
The Expected output is 1024.00 using Datatype decimal[4,2] and for 10 it is 10.00 ....
can anyone specify why it may be so....
-
- Participant
- Posts: 42
- Joined: Tue Jan 18, 2005 5:48 am
Decimal(4,2) ment total length is 4 and out of it, precision is 2. And hence the mantissa is also 2 here. If it is fixed width 4 consicutive digit can be read as 4,2.
In case of delimited input, 10 will be considired as 10.00.
In case of delimited input, 10 will be considired as 10.00.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It is always safest to treat text files as if they contain text as the only data type. Within the DataStage job you can then apply data type conversion functions using a Modify stage or a Transformer stage. The obvious exception is when you know that there are binary data in the "text" file.
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.