how to convert data from ASCII to Packed Decimal

Hi All,
Please let me know if it is possible to convert data from ASCII to Packed Decimal through Unix?

Basically we have ASCII file with numeric data we want to convert that files data to Packed decimal format to send it to main frame.
Please let me know if we can do it through unix script.

Thanks in advance.

Regards,

Alok

This would be very difficult in shell but easy in a high level language such as Cobol (pic COMP-3).
Common sense says do the conversion on the Mainframe unless you have the tools on the unix server.
There is much variation in Packed Decimal which is further complicated if you need to generate EBCDIC on the unix server.
Binary-coded decimal - Wikipedia, the free encyclopedia
If it is really necessary to do the conversion on the unix server the blunt approach is with a conversion table, though you don't state data volumes or anything about the computers or software involved.