9 replies
by pvp
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.
by pramesh
by hmertens
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
by pramesh
by sam hobbs
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.
by pramesh
by rrv
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.
by pramesh
by pramesh
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending