Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using GetString function - Returns EBCDIC codes

Status
Not open for further replies.

DarkWynd

Programmer
Nov 27, 2012
5
CA
Hello everyone,

I am currently using Excel to gather some data from our Mainfram systems. We are using Extra 6.71 as the Mainframe emulator. Using VBA, I am able to connect to Extra and then use the Function "SendKeys" to get to a specific screen on the mainframe.

The problem however lies when I'm using the function "GetString" (Which should be reading a string from the screen as a given position).

The string I see on the screen is : "JCLEDIT"
The string returned by the GetString function is : "ÑÃÓÅÄÉã"
The ASCII Codes of the string returned by GetString are : 209,195,211,197,196,201,227
After much fooling arround, I realized that those codes are actually the EBCDIC codes of "JCLEDIT"

Anybody knows how to have GetString do the conversion automatically?

If not, what would be a good algorithm to convert EBCDIC to ASCII?
 
that's some emulator you have. couldn't you build a table as a lookup to convert this?
 
Have you no setting in your emulator to select ASCII or EBCDIC. I know that there is such with data transfer thru the emulator.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I did not find any settings on my Emulator or within Excel that would fix this issue. It might be worthwhile to note that I'm using MS Excel 2012 (v 14.0.6106.5005 (32 bit))

In the end, I made up my own EBCDIC to ASCII conversion function in order to properly populate the data in MS Excel.

I would, however, prefer not to rely on my own functions for such a trivial thing...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top