Need help for EBCDIC TO ASCII conversion through UNIX


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help for EBCDIC TO ASCII conversion through UNIX
# 1  
Old 08-19-2015
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 !
# 2  
Old 08-19-2015
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.

Last edited by Corona688; 08-19-2015 at 03:35 PM..
# 3  
Old 08-19-2015
Isn't there an unpack command on the mainframe?
--
Character translation can be done with dd.
For example
Code:
dd conv=ascii ifs=ebcdicfile ofs=outfile

See this and additional options with
Code:
man dd

# 4  
Old 08-19-2015
Quote:
Originally Posted by MadeInGermany
Isn't there an unpack command on the mainframe?
--
Character translation can be done with dd.
dd specifically does not handle packed decimal.
# 5  
Old 08-20-2015
Hi.

Is this different from the Jan 27th, 2015 EBCDIC TO ASCII Conversion through UNIX Command and File conversion from Binary to ASCII though UNIX command ?

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

cheers, drl
# 6  
Old 08-20-2015
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.
# 7  
Old 08-20-2015
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.
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. UNIX for Advanced & Expert Users

EBCDIC to ASCII conversion

Hi, I have a input file which is EBCIDIC and it has packed decimals. Can anyone help me to convert EBCIDIC file to ASCII(Need to convert even Packed decimal values also to normal format). Thanks swapna (12 Replies)
Discussion started by: swapna_1990
12 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. 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

6. 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

7. 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

8. UNIX for Advanced & Expert Users

UTF-8 to EBCDIC conversion in UNIX

Hi all, At present a file from AS400 system is being FTPed to an AIX system. Now, a similar file needs to be sent from our Unix box (Solaris) Is there any tool available which does the conversion in Unix from UTF-8 to EBCDIC? Any suggestions/ pointers are really appreciated. Thanks,... (4 Replies)
Discussion started by: sridhar_423
4 Replies

9. 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

10. UNIX for Dummies Questions & Answers

Unix to EBCDIC conversion

Hi, I am using HPUX 11. There is a command to convert Unix formatted data to Dos formatted data called 'ux2dos'. Is there a similar command to convert Unix formatted data to EBCDIC format? Many thanks Helen :) (2 Replies)
Discussion started by: Bab00shka
2 Replies
Login or Register to Ask a Question