Need help for EBCDIC TO ASCII conversion through UNIX

Hi All ,
We have a mainframe file which is in EBCDIC format.We dont have direct access to mainframe ,client has provided us the mainframe file in unix box.The mainframe file is containing pact data(COMP1 ,COMP2 etc) which are unreadble.Can anyone suggest me how to convert this kind of ebcdic file to ascii format(which are readble) through unix only.Any help in this regard will be highly appreciated.Thanks !

By PACT I'm guessing you mean "packed decimal". There is no simple converter which you can feed a file containing packed decimal into and get ASCII numbers out.

This is because they were never anything like ASCII, or even EBCDIC: They're more like raw binary numbers. What they mean depends on how you interpret them, and the file does not contain enough information to automatically process them, or even reliably determine where they begin or end.

Explanation of Packed Decimal

So you have to examine the file, experiment a bit, and determine what kind of numbers they are. Once you know that you can write a program which extracts the numbers individually and converts them in the correct manner and reassembles it to get the output you want.

If you could attach a sample of the data, that might be helpful.

Isn't there an unpack command on the mainframe?
--
Character translation can be done with dd .
For example

dd conv=ascii ifs=ebcdicfile ofs=outfile

See this and additional options with

man dd

dd specifically does not handle packed decimal.

Hi.

Is this different from the Jan 27th, 2015 EBCDIC TO ASCII Conversion through UNIX Command and http://www.unix.com/shell-programming-and-scripting/254878-file-conversion-binary-ascii-though-unix-command.html\#post302933011 ?

If so, how? If not, why ask again?

cheers, drl

Wow, he didn't answer any of those threads.

If they were still open I'd close this one as a duplicate, but on the off-chance he'll ever return to post anything which lets us help him, I'll leave this one open.

Thanks all for your suggestion.So I understood that the conversion of ebcdic to ascii with packed decimal need to be done in mainframe env only .There is no way to be done unix env if mainframe data contains packed decimal data.Correct me if I misunderstood.

I did not say "no way". I said there's no "turn to ascii command" which will extract and fix the packed decimals without being told which parts are packed decimal, more effort than that is required. Without a sample of the data, it's difficult to find a solution that'd work for you.