ebcdic

Reading a mainframe EBCDIC File [closed]

自古美人都是妖i 提交于 2019-12-08 04:35:27
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I have a EBCDIC coded mainframe file which I need to convert to an ASCII format. Which libraries/tools can I use to do that. I am most familiar with Python. The file I received has a cookbook with it, which can be used to parse the file (part of it is below). What do types: 'C', 'P' and 'B' mean? I'm guessing C = character, B = byte, P = packed number? 1:----------------------------------------------------------

C code to convert EBCDIC printables to ASCII in-place

自古美人都是妖i 提交于 2019-12-06 05:42:08
What is the simplest way in C to convert an EBCDIC-encoded string to its ASCII equivalent in-place. The only characters that need to be converted are the space, alphanumerics, and from the set <=>()+-*/&|!$#@.,;%_?" . All other characters can simply be replaced with . . The function signature will basically be: void ebcdicToAscii (char *s); At the moment, I'm leaning towards a series of lookup tables and multiple if statements for the various EBCDIC sections, but I wonder if there's a better way. Stu Using the table from here , from the top of my head: static const unsigned char e2a[256] = { 0

ISO8583 for Amex

断了今生、忘了曾经 提交于 2019-12-04 18:43:03
Has anyone implemented the messaging iso8583 for Amex? I have a port and ip, but when I send an echo message (1804) with a socket it does not answer anything ... The Encoding is EBCDIC. Does anyone have an example? The code is in C# Console.WriteLine("Send Message Echo..."); ManageConnection.ManageSocket _manage = new ManageConnection.ManageSocket(IpAmex, PortAmex); TupleList<Encoding, string> _request = new TupleList<Encoding, string>(); _request.Add(Encoding.GetEncoding(500), "1804"); _request.Add(Encoding.UTF8, "2030018000000000"); _request.Add(Encoding.GetEncoding(500), "000000"); _request

String.getBytes(charset) has errors for EBCDIC-charset

冷暖自知 提交于 2019-12-04 11:49:08
The String-conversion to EBCDIC via String.getBytes(charset) supplys at least one false result. The character "a" becomes a 0x3f but should be 0x81. public static void convert() throws UnsupportedEncodingException { String data="abcABC"; String ebcdic = "IBM-1047"; String ascii = "ISO-8859-1"; System.out.printf("Charset %s is supported: %s\n", ebcdic, Charset.isSupported(ebcdic)); String result= new String(data.getBytes(ebcdic)); System.out.printf("EBCDIC: %s\n",asHex(result.getBytes())); System.out.printf("Charset %s is supported: %s\n", ascii, Charset.isSupported(ascii)); result= new String

Unpacking COMP-3 digit using Record Editor/Jrecord

十年热恋 提交于 2019-12-02 20:47:39
问题 I have created layout based on cobol copybook. Layout snap-shot: I tried to load data also selecting same layout, it gives me wrong result for some columns. I try using all binary numeric type. CLASS-ORDER-EDGE DIV-NO-EDG OFFICE-NO-EDG REG-AREA-NO-EDG CITY-NO-EDG COUNTY-NO-EDG BILS-COUNT-EDG REV-AMOUNT-EDG USAGE-QTY-EDG GAS-CCF-EDG result snapshot Input file can be find below attachment enter link description here or https://drive.google.com/open?id=0B-whK3DXBRIGa0I0aE5SUHdMTDg Expected

How do I do ASCII to EBCDIC translation in Ruby?

﹥>﹥吖頭↗ 提交于 2019-12-02 13:38:29
问题 I am using Ruby 1.8.7 on Mac OS X. How do I convert ASCII to EBCDIC encoding, to communicate with legacy system. Would I have to use to jruby? 回答1: You can upgrade but that doesn't necessarily solve the problem. There are multiple flavors of EBCDIC (THANK YOU IBM!) so you'll need to identify the subset your mainframe uses. One thing I learned to do when programming on the mainframe, oh so many years ago, was to call some of the mainframe sysops, and pick their brains. They deal with

Unpacking COMP-3 digit using Record Editor/Jrecord

可紊 提交于 2019-12-02 11:52:09
I have created layout based on cobol copybook. Layout snap-shot: I tried to load data also selecting same layout, it gives me wrong result for some columns. I try using all binary numeric type. CLASS-ORDER-EDGE DIV-NO-EDG OFFICE-NO-EDG REG-AREA-NO-EDG CITY-NO-EDG COUNTY-NO-EDG BILS-COUNT-EDG REV-AMOUNT-EDG USAGE-QTY-EDG GAS-CCF-EDG result snapshot Input file can be find below attachment enter link description here or https://drive.google.com/open?id=0B-whK3DXBRIGa0I0aE5SUHdMTDg Expected output: Related thread Unpacking COMP-3 digit using Java First Problem you have done an EBCDIC --> ascii

How do I identify the level of a field in copybook using JRecord in Java?

风流意气都作罢 提交于 2019-12-02 10:27:09
I am trying to read a EBCDIC file and convert it to ASCII format in Java, with a help of copybook. I am using JRecord to read the copybook. So now, how do I get the field level from the copybook using JRecord? Edit 1: Kindly excuse me for a vague question. I have no experience in mainframe or cobol. I am adding few more details if it could help. My source file contains multiple transaction details. The copybook contains the information on the transaction and the fields relating to that particular transaction. I have to split the each transaction and its fields to a separate file(containing one

Convert String from EBCDIC to Unicode / UTF8

自作多情 提交于 2019-12-01 23:29:31
I'm able to send messages from Java to Websphere MQ on AS400 . If I send messages from WinXP , there is no difference if I use any accessible Locale , including full Language Localization; nor is there a problem with English Locale . Important for correct encoding is only this code line: msgId.characterSet = 1208; Infortunately, it's not valid. There are differences in the case that I want to take the message from MQ Queue . In the case that I get message from MQ Queue from Windows OS (English without any of Language Pack), I'm able to take message from MQ Queue in String form. In the case

How to read EBCDIC data with a non standard codepage, and not mess up numbers?

[亡魂溺海] 提交于 2019-12-01 11:19:27
Here is one for the old(er) hands :-) I'm reading a binary dump from a mainframe DB2 table. The table has varchar, char, smallint, integer and float columns. To make it interesting, the DB2 uses code page 424 (Hebrew). I need my code to be codepage independent. So I open the file with a streamreader using System.Text.Encoding like so: Dim encoding As System.Text.Encoding = System.Text.Encoding.GetEncoding(20424) Dim sr As New StreamReader(item.Key, encoding) and proceed to read the VARCHAR and CHAR data according to their lengths into char arrays using sr.ReadBlock(buffer, 0, iFieldBufferSize)