dd will only do a byte to byte conversion from EBCDIC to ascii. Packed decimal achieves data compression by using 4 bit bytes, essentially storing two decimal digits in a single byte.
There're plenty of similar threads at the bottom of this in the 'More UNIX and Linux Forum Topics You Might Find Helpful' section.
Including this one by the usual "actors/participants".
Maybe I'm missing something, but wouldn't iconv do the job?
The question is more like, how to convert the ASCII text 0xFFFF into a binary number. The text is ASCII, but the value it represents is binary. Packed decimals are kind of like that, encoded in a special BCD-ish IBM manner that's neither plaintext nor binary as it's usually done.
The sticking point is, they often end up in the middle of EBCDIC streams which look like text files but are really fixed-size database records completely lacking in metadata. Very COBOL-ish. Very IBM. And not actually a text file. dd or iconv can't generate a sensible result from
So, there isn't any generic code to convert a text stream out of packed decimal, and can't be. You have to read the data in a structured way and know which bits to convert and how.
This is usually the point where we ask for the necessary sample of data, OP refuses, and the thread dies.
Last edited by Corona688; 03-21-2019 at 07:13 PM..
I cannot able to share the original input file,bcz its highly confidential data.we are not using mainframe environment setup.I need either unix command or some java programming.
What you are explaining looks very much cobol data file... in which case the easiest way out is to write a cobol program to read it and display/print the content, if that is fine, its very simple in cobol to write what need converting... and as already posted here, there is an open source cobol...
As Corona688 predicted, the OP is unwilling to share enough information for us to be able to help. Without details on the format of the file's contents, there is absolutely nothing that we can do to help decode the data that it contains.
Hi,
We have a mainframe file which is in EBCDIC format.We dont have direct access to mainframe ,client has provided us the mainframe file.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... (11 Replies)
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... (7 Replies)
I have a file in my Unix ( SOLARIS ) with EBCDIC format...I want this file to read in ASCII OR unicode...Is it possible with UNIX to convert this file on ASCII OR UNICODE format from EBCDIC format?
I was searching through web and found only conversion table :(
Request Rejected
Below is... (16 Replies)
Hi All ,
I have a mainframe file which contains the data in EBCDIC unreadable format.I have downloaded this raw unreadable file from mainframe system to windows in text format then I pushed to Unix system.Now I want to convert this file to ASCII readable format file in unix.Can anyone advise me... (2 Replies)
Hi,
I want to convert ebcdic values to ascii values. Are there anyany specific c++ libraries with g++ compiler, which can do it ?
gcc version 4.1.2 20080704 (Red Hat 4.1.2-54) (19 Replies)
Hi,
I want to convert ebcdic values to ascii values. Are there anyany specific c++ libraries with g++ compiler, which can do it ?
gcc version 4.1.2 20080704 (Red Hat 4.1.2-54) (0 Replies)
Hi,
we have source file with EBCDIC format(Main Frame files) where we receving from source system.
I would like to convert the EBCDIC format file to unix systemformat(ex: .csv,txt )
I have wrote script like:
dd if=<SRCPATH>yyy.xxx.RB065 of=<SRCPATH>/output.csv ibs=800 cbs=80... (8 Replies)
Hi All,
I am facing EBCDIC to ASCII Binary conversion on Solaris i-series Unix system.
However this is working fine on Solaris Sparc Unix system.
Input file having EBCDIC format does not work on Solaris i-series Unix system.
Could you please tell me, what will be the root cause for same? (14 Replies)