Hello All:
I am getting a VSAM file (Binary) converted to ASCII format as my source file. This source file is a flat file with fixed width length. However there are many columns as type "Fixed Decimal". When I see the data of these fixed decimal columns I see weird characters. How do I do the conversion on the server side for this type...?
Thanks in advance.
MJ
How to convert a FIXED DECIMAL type in using flat files
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You go back to the providers of the file, and tell them that it's not an ASCII file - it contains binary fields, whereas you require EXTERNAL representations of numeric data.
Another possibility is to investigate the Iconv() function, with a second argument of "MB" or, perhaps, "MX". The former converts from binary to decimal, the latter from hexadecimal to decimal.
Another possibility is to investigate the Iconv() function, with a second argument of "MB" or, perhaps, "MX". The former converts from binary to decimal, the latter from hexadecimal to decimal.
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.
You might want to post some of these 'weird characters'. You might be seeing zoned decimal or something of that ilk.
Best answer is Ray's answer - get the provider of the file to cut you a break and build you a straight non-funky ascii file.![Wink :wink:](./images/smilies/icon_wink.gif)
Best answer is Ray's answer - get the provider of the file to cut you a break and build you a straight non-funky ascii file.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
You may need to post the definition of the file you are receiving to make sure we are all on the same page. If your file truly has packed decimal fields and if they simply converted the entire record from EBCDIC to ASCII - then they have destroyed the packed fields in the process.
Packed is packed, neither ASCII nor EBCDIC in a sense, so those fields need to be 'skipped' during the conversion. If they can't manage to do that for you, then you have a couple of choices:
1) Leave everything in EBCDIC and you convert the character fields to ASCII and unpack the packed decimal fields yourself. Yuck.
2) Make them unpack the packed fields for you - external representations of the numeric data as Ray put it. Then they can convert it all to ASCII and not trash anything. ps: It is way easier for them to deliver the fields to you unpacked than it is for you to unpack them.
I push hard for what's behind Door Number 2.![Wink :wink:](./images/smilies/icon_wink.gif)
Packed is packed, neither ASCII nor EBCDIC in a sense, so those fields need to be 'skipped' during the conversion. If they can't manage to do that for you, then you have a couple of choices:
1) Leave everything in EBCDIC and you convert the character fields to ASCII and unpack the packed decimal fields yourself. Yuck.
2) Make them unpack the packed fields for you - external representations of the numeric data as Ray put it. Then they can convert it all to ASCII and not trash anything. ps: It is way easier for them to deliver the fields to you unpacked than it is for you to unpack them.
I push hard for what's behind Door Number 2.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi chulett:chulett wrote:You may need to post the definition of the file you are receiving to make sure we are all on the same page. If your file truly has packed decimal fields and if they simply converted the entire record from EBCDIC to ASCII - then they have destroyed the packed fields in the process.
Packed is packed, neither ASCII nor EBCDIC in a sense, so those fields need to be 'skipped' during the conversion. If they can't manage to do that for you, then you have a couple of choices:
1) Leave everything in EBCDIC and you convert the character fields to ASCII and unpack the packed decimal fields yourself. Yuck.
2) Make them unpack the packed fields for you - external representations of the numeric data as Ray put it. Then they can convert it all to ASCII and not trash anything. ps: It is way easier for them to deliver the fields to you unpacked than it is for you to unpack them.
I push hard for what's behind Door Number 2.
What do you mean when you/ray say "external representations of the numeric data"
Thanks,
MJ
Hello chulett:chulett wrote:It simply means to have the packed fields unpacked. Not an 'internal' representation, but rather something 'external' or people readable.
Thank you much, appreciate it. :D
Anyways, we tried to get the DATA in ASCII and had issues with Packed decimal. However, when we went with DataStage doing the conversion from ECDIC with format type Binary....the data looks good so far. Datastage does a good job of the conversion. :D
MJ