Page 1 of 1

Packed Decimal fields - No conversion wanted

Posted: Fri Apr 14, 2006 8:54 am
by James Schneider
I am trying to convert a mainframe EBCDIC file to ASCII. I want to convert all of the the display fields, but I do not want the packed decimal fields in each record converted. How do I do this?

I used the Mainframe Copybook Wizzard to begin with. I have come closest to what I want by removing the Expand Packed Decimal filters and inserting Convert ASCII to EBCDIC filters under the Restriction filters for every packed field. I also added an ASCII to EBCDIC Map under every Restriction filter that maps every Hex code to the same ASCII code. This works for almost every field, but fields that contain x'09' in the EBCDIC file are causing some extra spaces (x'20') in my output file that I can't figure out how to remove.

Is there some easier way to say that I want certain bytes passed thru (unmodified) from the EBCDIC file to the ASCII file?

Posted: Wed Apr 19, 2006 8:37 am
by DataMystic Support
Hi James,

You;re almost there. Use this approach:
1. Remove all restrictions for packed decimal fields
2. Inside each restriction for Alpha fields, insert a Convert EBCDIC to ASCII filter as the last step.
3. Remove the final Convert EBCDIC to ASCII filter that is at the base of the filter list (the one not inside any restrictions).

If you have any trouble with this please send us your filter so far and a small sample file.

Posted: Thu Apr 27, 2006 6:23 pm
by James Schneider
Hello Simon,

I made the changes you suggested, but I'm getting the same results. The presence of x'09' in the EBCDIC input file causes extra spaces (x'20') in the output ASCII file.

Any other suggestions?

I will try to send my filter and my EDCDIC file.

Thank you.

Posted: Fri Apr 28, 2006 11:01 am
by DataMystic Support
Yes, you have an EBCDIC \x05 in your alpha fields. Just add a perl pattern search/replace filter at the end of the filter list, search for

\t

and replace with

<a space>