Need help in converting packed decimals
Moderators: chulett, rschirm, roy
Need help in converting packed decimals
In my projects I am getting source files from Mainframe system in packed format. I am converting this using the tranformation "DataTypePicComp3()",but we are not getting correct values after conversion. Could anyone help me in this. Is there any other transformation for this.
Joji John
-
- Participant
- Posts: 19
- Joined: Fri Sep 10, 2004 12:17 am
- Location: India
- Contact:
Often if the mainframe packed data doesn't seem to be correct the real reason is that the file is being converted from EBCDIC to ASCII and thereby corrupts the packed data. If that is the case you can convert those fields back using the DB EBCDIC function and then apply your SDK function.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Ok... help us help you here. Just to make sure we're all on the same page, when you say 'packed format' what exactly do you mean? COMP-3? Signed or Unsigned? Don't forget, packed is packed (neither EBCDIC nor ASCII) and requires no 'conversion', mearly unpacking.
As noted, some transfer mechanisms can automatically convert a mainframe EBCDIC file to an ASCII one and if that isn't done correctly the packed fields get converted as well - which corrupts them. Which is what you did with the DD command, I'd wager. Any idea if that is happening without DD, because if it is you'll never unpack them gracefully.
Assuming all is well in packed land, correct datatypes helps. Define the incoming field as Char or Varchar (typically half the size of the output) and then use the appropriate SDK routine to convert it to a numeric field. The end result should load just fine into Oracle.
If you still have problems, specific examples of your input and converted output would help solve it.
As noted, some transfer mechanisms can automatically convert a mainframe EBCDIC file to an ASCII one and if that isn't done correctly the packed fields get converted as well - which corrupts them. Which is what you did with the DD command, I'd wager. Any idea if that is happening without DD, because if it is you'll never unpack them gracefully.
Assuming all is well in packed land, correct datatypes helps. Define the incoming field as Char or Varchar (typically half the size of the output) and then use the appropriate SDK routine to convert it to a numeric field. The end result should load just fine into Oracle.
If you still have problems, specific examples of your input and converted output would help solve it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers