Conversion from EBCDIC to ASCII


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Conversion from EBCDIC to ASCII
# 1  
Old 10-26-2009
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

Code:
ÈðñÃÁÂÅãÄÆÒññõøøÃÁÔâ@@@@@@@@@@@@@@@@@@@@@@@@@@@@...@@@@@@@@ðóöòñò

target file with few weird characters:-

Code:
H01CABETDFK11588CAMS                                                                                                                                                              
                                                          H02BETALNING           20091023       ¦Æ                                                                                
                                                                                                                         10P0000957048                     19981101        0366102
51958  FYPNA  STFOONPNA  10750 1 Niklas Sandstr|m            P0003680554                                                                                                          
 10P0004419382                     19980124        036212310137  FYPNA  STFOONPNA  10570 1 Lars Liljeqvist             P0003398257                                                
                                                           10P0003454348                     19980124        034105072138  FYPNA  STFOONPNA  10790 1 Ulrik Ringborg              P
0001851751                                                                                                           10P0002243745                     19990216        01671208293
9  FYPNA  STFOONPNA  10710 1 Stefan Carlsson             P0003761437                                                                                                           10P
0004563278                     19980124        035607177655  FYPNA  STFOONPNA  10550 1 Kent Viklund                P0002966188                                                    
                                                       10P0000708441                     19980124        035809293110  FYPNA  STFOONPNA  10790 1 Maximiliano Zapata Carvallo P0003
115417                                                                                                           10P0005470608                     19991224        036811093050  F
YPNA  STFOONPNA  10650 1 Rutger Niklasson            P0006115944                                                                                                           10P0004
692281                     19980124        034511020655  FYPNA  STFOONPNA  10630 1 Bj|rn Sj|holm               P0002187277                                                        
                                                   10P0007152400                     20010710        036204096280  FYPNA  STFOONPNA  10590 1 Marja Ohlsson               P00068776
67                                                                                                           10P0011115830                     19980124        037107037066  FYPNA
  STFOONPNA  10750 1 Olga Tchernycheva           P0003999441                                                                                                           10P00121037
04                     19990119        038108052773  FYPNA  STFOONPNA  10730 1 TIM MIC J#DER$S             P0005441587                                                            
                                               10P0012571286                     19980124        035003088514  FYPNA  STFOONPNA  10790 1 Lars Burstedt               P0002526565  
                                                                                                         10P0013069012                     19980124        015408065638  FYPNA  ST
FOONPNA  10630 1 Nils-$ke Gustafsson         P0002833765                                                                                                           10P0013725504  
                   20071121        037412180882  FYPNA  STFOONPNA  10630 1 Helen Tewolde Beyenne       P0008577288                                                                
                                           10P0014322873                     19980124        033909251914  FYPNA  STFOONPNA  10750 1 Arne Anshed                 P0001758460      
                                                                                                     10P0014369043                     19980330        036406128253  FYPNA  STFOON
PNA  10510 1 Peter Jansson               P0004708439                                                                                                           10P0014465434      
               19990423        037903264963  FYPNA  STFOONPNA  10810 1 Therese Bilger              P0005829845                                                                    
                                       10P0014615929                     20000828        038211240190  FYPNA  STFOONPNA  10570 1 Henrik Larsson              P0006564452          
                                                                                                 10P0014665365                     20090519        012608120172  FYPNA  STFOONPNA 
 10790 1 Lennart Tegman              P0008973342                                                                                                           10P0014722089          
           19980124        035505246255  FYPNA  STFOONPNA  10590 1 Lennart Johansson           P0002887017                                                                        
                                   10P0014751933                     20000131        036601016006  FYPNA  STFOONPNA  10750 1 Naima Serifi                P0006134050              
                                                                                             10P0014775043                     20090804        012607042138  FYPNA  STFOONPNA  107
50 1 G|sta Cederin               P0009013021                                                                                                           10P0014818005              
       20080603        035901090117  FYPNA  STFOONPNA  10790 1 H}kan Cederberg             P0008691018                                                                            
                               S990000002320091023      ¦Æ

I am using dd if=infile of=outfile conv=ascii.
Please help me with this and how to get correct file with 23 records as of now it shows like single line.

Thanks,
Velpula.

Last edited by zaxxon; 10-26-2009 at 09:56 AM.. Reason: code tags!
# 2  
Old 10-26-2009
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums
# 3  
Old 10-26-2009
You may fare better by doing the conversion on the mainframe. It looks like detail such as accented characters and the record structure has already been lost in the existing process.

We would normally assume that data files are text files suitable for processing in unix shell. Though you do not state what program was run to display the content of the file, it is clearly not a normal text file. I wonder if it is actually a database?
# 4  
Old 10-26-2009
If you have a file from mainframe in ebcdic with numbers in comp3 format (which will be screwed up with dd's conversion), the easiest way to look at the data is to load the data into an Oracle table with:

Code:
LOAD DATA
CHARACTERSET WE8EBCDIC500
INFILE 'infile' "FIX 23?"
TRUNCATE INTO TABLE T
(
 F1  POSITION(1) CHAR(??),
 AMT POSITION(*) DECIMAL(??),
 F2  POSITION(*) CHAR(??)
)

In your case, it doesn't seem to have any amount field.
Be careful with posting your company's financial data.

Last edited by Franklin52; 10-26-2009 at 12:05 PM.. Reason: Please use code tags, thanks!
 
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. 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

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

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

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

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

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

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

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