EBCDIC to ASCII conv for packed decimals.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers EBCDIC to ASCII conv for packed decimals.
# 1  
Old 05-11-2007
EBCDIC to ASCII conv for packed decimals.

By using dd command in Unix one can convert EBCDIC file into ASCII. It fails when it comes to having packed decimals within the EBCDIC file. The resultant of it has garbage chars.

How can we have EBCDIC file convertedinto ASCII, which has packed decimal data in it?

Thanks in advance.
# 2  
Old 05-11-2007
Packed decimal is essentially a display field using a 4 bit byte.
The simplest solution is probably to write a cobol program to create a file without packed decimal (comp-3) prior to doing the conversion.
Also, the character sets are different, so that some characters will not convert at all.
The alternative is to write a program afterwards that does bit manipulation in order to convert a five byte field to a 9 decimal digit number.
# 3  
Old 05-12-2007
So there is no straightforward option in command 'dd' or some other command available by which we can convert packed decimals into ASCII recognized decimals?
If yes, then we should handle this at COBOL side, as you mentioned is to explicitly handle to create a file without having packed decimals. Am I correct to understand to what you have said?
# 4  
Old 05-12-2007
There is certainly no option to dd to handle a case like this. The program is that some parts of each record are ebcdic while other are not. A program or script must be written that knows which parts of the record need converting.
 
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. 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

4. Shell Programming and Scripting

Ebcidic to ASCII (Packed decimals are there)

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) (12 Replies)
Discussion started by: Anusha_Reddy
12 Replies

5. Homework & Coursework Questions

how can i pass the conv=ucase and conv=lcase in bash script?

how can i pass this dd command utility conv=ucase and conv=lcase in bash script? if for example i have sample menu like: Menu for translating contents of file A.) translate contents of file to lowercase B.) translate contents of file to uppercase how to do this in the script so... (0 Replies)
Discussion started by: amneytia1
0 Replies

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

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. Shell Programming and Scripting

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

9. Shell Programming and Scripting

convert Regular decimals to Packed decimals

Hi, I am trying to find if there is a way to convert regular decimal values to Paced decimal values. I tried to find a c program but I could get a Packed converted to regular decimal not the other way round. If not unix please let me know if any other progrimming language I can use to do... (2 Replies)
Discussion started by: mgirinath
2 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