Hi,
I've a typical scenario , I need to do the below conversion to provide the file to mainframe group so that they can match the data from ascential generated file with mainframe file
e.g. Value -212.00 should be converted to 0000000021200D
The above looks like decimal to Hex conversion. I tried all tyhe routines in DS for the same like Xtd, dtx, mxoc, MUOC but its not giving the desired o/p even i tried the packed decimal routines provided by datastage for packed decimal field .
Can any body help.
Regards.
COnversion
Moderators: chulett, rschirm, roy
Nope, not hex, not packed. Looked like Zoned Decimal for a second, but it's not that either. Ask your mainframe folks what that 'D' is supposed to represent.
The FMT command can handle the zero padding and the descaling of the number to remove the decimal point.
The FMT command can handle the zero padding and the descaling of the number to remove the decimal point.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Hi Shrey3a,
I have encountered a similar case before. It looks like you have to encode your values using a particular logic. Find out if there is any logic to be applied inorder to get the 00D for a negative number.
I think your o/p field is of length 14. You should also let us know the length and datatype of your input field.
More information is needed from your side to proceed further. Once you are sure about the conversion logic, then apply the logic and use the Fmt function as said by Craig.
Thanks,
Naveen.
I have encountered a similar case before. It looks like you have to encode your values using a particular logic. Find out if there is any logic to be applied inorder to get the 00D for a negative number.
I think your o/p field is of length 14. You should also let us know the length and datatype of your input field.
More information is needed from your side to proceed further. Once you are sure about the conversion logic, then apply the logic and use the Fmt function as said by Craig.
Thanks,
Naveen.
Hi ,
The D stands for (-) and (+) or nothing stands for C. And length of the mainframe field is 14.
Regards,
The D stands for (-) and (+) or nothing stands for C. And length of the mainframe field is 14.
Regards,
naveendronavalli wrote:Hi Shrey3a,
I have encountered a similar case before. It looks like you have to encode your values using a particular logic. Find out if there is any logic to be applied inorder to get the 00D for a negative number.
I think your o/p field is of length 14. You should also let us know the length and datatype of your input field.
More information is needed from your side to proceed further. Once you are sure about the conversion logic, then apply the logic and use the Fmt function as said by Craig.
Thanks,
Naveen.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Fmt(Abs(Iconv(TheNumber,"MD2")),"R%13") : (If TheNumber < 0 Then "D" Else "C")
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.