General discussion

Locked

Converting EBCDIC to ASCII

By pramesh ·
How can i convert EBCDIC to ASCII using Visual Basic? Please send the sample code.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Converting EBCDIC to ASCII

by pVp In reply to Converting EBCDIC to ASCI ...

You need two arrays of characters, or strings if that works (I'm a c/c++ guy, my VB is really rusty). One array is ASCII; the other is EBCDIC.

Find the index of each character in the string to be converted, in the source array; get the corresponding character at the same index in the target array.

Collapse -

Converting EBCDIC to ASCII

by pramesh In reply to Converting EBCDIC to ASCI ...

The question was auto-closed by TechRepublic

Collapse -

Converting EBCDIC to ASCII

by hmertens In reply to Converting EBCDIC to ASCI ...

An additional point: EBCIDIC and ASCII both come in different flavours (codepages in IBM parlance). These map the relation of a specific single byte character set IDs to a specific alphabetic character, typically associated with a particular langauge. Check out the http://www.ibm.com and search on "CODEPAGE TRANSLATION" to get a start.

The good news is that most big-iron system use a simple dataprocessing oriented codepage the uses the basic western latin alphabet, arabic numerics and commonpunctuation (the codepage # escapes me) that maps simply to a "7-bit US ASCII" equivalent. In essence you will be just mapping 128-32 different character glyphs from EBCDIC to ASCII - if you now the codepage that your EBCDIC is coming from.

You may want some warning built into your code to notify you when unexpected code points are encountered in the EBCIDIC that map beyond the ASCII code point 127 - these are often indications that your codepage may NOT be what you are expecting.

Herber Mertens
Contract & C

Collapse -

Converting EBCDIC to ASCII

by pramesh In reply to Converting EBCDIC to ASCI ...

The question was auto-closed by TechRepublic

Collapse -

Converting EBCDIC to ASCII

by Sam Hobbs In reply to Converting EBCDIC to ASCI ...

See: http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?lngWId=1&txtCodeId=5902 for one sample.

It is probably better to use the Windows API to convert the EBCDIC code page to ASCII but I do not have an example of that.

Collapse -

Converting EBCDIC to ASCII

by pramesh In reply to Converting EBCDIC to ASCI ...

The question was auto-closed by TechRepublic

Collapse -

Converting EBCDIC to ASCII

by RRV In reply to Converting EBCDIC to ASCI ...

when i created a GUI interface in VB using TCPIP sockets for IBM AS/400 i wrote VB functions to convert EBCDIC to ASCII and vice versa. These modules have to start with the current codepage setting. you get the character mappings in IBM site. to mathematically finding the corresponding characters and function keys check in digital electronics book which any general engineering or MCA graduate learns.

First of all. if you are trying to create a GUI for AS/400 or any similar systems don't waste time. There are lot of drivers for that available now in market. for example for IBM AS/400 check the Client access express API programming in VB. That serves most of the purpose using pure API calls to interact with AS/400. for the last one and half years i'm creating GUI based applications for AS/400 using VB and Client access express drivers.

for more help you can contact me at rrv@hotvoice.com

Enjoy VB
Raja venkatesh.

Collapse -

Converting EBCDIC to ASCII

by pramesh In reply to Converting EBCDIC to ASCI ...

The question was auto-closed by TechRepublic

Collapse -

Converting EBCDIC to ASCII

by pramesh In reply to Converting EBCDIC to ASCI ...

This question was auto closed due to inactivity

Back to Web Development Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums