EBCDIC to ASCII conversion


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users EBCDIC to ASCII conversion
# 8  
Old 03-21-2019
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.
This User Gave Thanks to jgt For This Post:
# 9  
Old 03-21-2019
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".
# 10  
Old 03-21-2019
Quote:
Originally Posted by vgersh99
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
Code:
String1String2String3(BCD Garbage)String4String1String2String3(BCD Garbage)String4

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..
This User Gave Thanks to Corona688 For This Post:
# 11  
Old 03-22-2019
Hi jgt ,

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.

Thanks
Swapna
# 12  
Old 03-22-2019
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...
# 13  
Old 03-22-2019
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.

Moderator's Comments:
Mod Comment This thread is closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

EBCDIC to ASCII conversion

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)
Discussion started by: swapna_1990
11 Replies

2. Shell Programming and Scripting

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... (7 Replies)
Discussion started by: STCET22
7 Replies

3. UNIX for Advanced & Expert Users

Conversion from EBCDIC to Ascii OR unicode

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)
Discussion started by: joshilalit2004
16 Replies

4. UNIX for Dummies Questions & Answers

EBCDIC TO ASCII Conversion through UNIX Command

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)
Discussion started by: STCET22
2 Replies

5. Programming

Ebcdic to ascii

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)
Discussion started by: tostay2003
19 Replies

6. UNIX for Advanced & Expert Users

Conversion of data - ebcdic to ascii

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)
Discussion started by: tostay2003
0 Replies

7. Shell Programming and Scripting

EBCDIC Format to ASCII

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)
Discussion started by: koti_rama
8 Replies

8. Solaris

EBCDIC to ASCII Binary conversion issue on Solaris i-series Unix

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)
Discussion started by: amodkavi
14 Replies

9. UNIX for Dummies Questions & Answers

Conversion from EBCDIC to ASCII

when i try to convert a mainframe EBCDIC file to ASCII ,i dont see correct file this is the source file ... (3 Replies)
Discussion started by: venkatvelpula
3 Replies

10. Shell Programming and Scripting

ascii to ebcdic conversion

Hello, I need a program for ascii to ebsdic conversion. If anybody can help, it'll be greatly appreciated. Thanks. (1 Reply)
Discussion started by: er_ashu
1 Replies
Login or Register to Ask a Question