ebcdic

How do you generate java~jrecord code for a Cobol copybook

别说谁变了你拦得住时间么 提交于 2019-12-17 06:56:19
问题 How do you use the RecordEditor to Generate Java~JRecord code from a Cobol Copybook to read/write a Binary EBCDIC Mainframe File . This a Question and answer to try an prevent some poor/misleading questions being asked or the answer can be pointed to. 回答1: File Transfer To transfer a Binary file from the Mainframe to Windows / *nix box you must do a Binary Transfer for a very simple reason: the Ebcdic --> Ascii program can not distinguish between binary fields and Text fields. Comp-3 value

C code to convert EBCDIC printables to ASCII in-place

点点圈 提交于 2019-12-13 12:36:41
问题 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

Getting EBCDIC value of a character in C

ε祈祈猫儿з 提交于 2019-12-13 05:37:50
问题 I need to get the EBCDIC value of a character in C. I don't know how. Do I have to get the ASCII value first then get the EBCDIC value from there? Thanks anyone 回答1: If you're on a system that uses EBCDIC as the character encoding, you already have it: char xyzzy = 'A'; // xyzzy is now 0xc1 If your environment is an ASCII one and you simply want the EBCDIC code point, you can just use a lookup table built from both tables, like: A lookup tables for a system using 8-bit ASCII characters to

why does “STRING”.getBytes() work different according to the Operation System

こ雲淡風輕ζ 提交于 2019-12-12 20:07:46
问题 I am running the code below and I am getting different outcome from "some_string".getBytes() depending if I am in Windows or Unix. The issue happens with any string (I tried a very simple ABC and same problem. See the differences below printed in console. The code below is well-tested using Java 7. If you copy it entirely it will run. Additionally, see the difference in Hexadecimal in the two images below. The first two images shows the file created in Windows. You can see the hexadecimal

Reading db2 clob from binary download

a 夏天 提交于 2019-12-11 14:08:58
问题 More then a year ago I asked about reading DB2 EBCDIC data in a .Net program. The amazingly helpful answer included a routine for reading VARCHAR columns. I am now faced with reading CLOB columns. Is their internal structure similar in that the first word contains the actual size? Or is it the whole word, considering the possible length of the CLOB is much larger? Thanks! 回答1: Not the mainframe but DB2/400 (midrange) appears to store CLOB fields externally from the table itself: CREATE TABLE

Internal EBCDIC support for ANTLR 3.1.3?

余生颓废 提交于 2019-12-11 09:38:18
问题 I'm trying to use ANTLR 3.1.3 on a system with local EBCDIC char set Even a simple grammar like this: lexer grammar test; GENERIC_ID : (LETTER)* ; fragment LETTER : 'a' .. 'z' ; results in these errors during the initial compile (java org.antlr.Tool test.g): error(10): internal error: problem parsing group <unknown>: line 1:1: unexpected char: 0x7 : line 1:1: unexpected char: 0x7 org.antlr.stringtemplate.language.GroupLexer.nextToken(GroupLexer.java:233) antlr.TokenBuffer.fill(TokenBuffer

PHP / SQL - Convert EBCDIC to ASCII

末鹿安然 提交于 2019-12-11 05:35:45
问题 We have PHP server code, executing SQL statements against our iSeries midrange. Here is a simplified version of the SQL query SELECT 'Regular' "sales_type", sum(sales_type1) "sales" FROM salesTable The query executes just fine, the problem is that when using a static field/value such as 'SomeText' "Title" and the results come back in PHP, they are not in the desired format string(7) "م�����" To connect to the system and retrieve the results db2_connect ( '*LOCAL', 'user', 'pass' ); if (!

EBCDIC to ASCII conversion using JAVA

大兔子大兔子 提交于 2019-12-11 05:01:53
问题 I'm trying to convert mainframe fixed length file from EBCDIC format to ASCII format. Currently I'm reading file using JZOS api (ZFile) and converting field by field. is it possible to convert without knowing the layout of file (aka COPYBOOK) by just reading entire bytes of a record or line? If so how do handle packed decimals and binary values? 回答1: is it possible to convert without knowing the layout of file (aka COPYBOOK) by just reading entire bytes of a record or line? No. Text fields

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

ぐ巨炮叔叔 提交于 2019-12-09 18:58:27
问题 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()));

Unpacking COMP-3 digit using Java

女生的网名这么多〃 提交于 2019-12-08 04:54:47
问题 I have a file with some COMP-3 encoded fields. Can someone please tell me how do I test this code in below thread ? How to unpack COMP-3 digits using Java? Code I tried is BufferedReader br = new BufferedReader(new FileReader(FILENAME))) { String sCurrentLine; int i=0; String bf =null; while ((sCurrentLine = br.readLine()) != null) { i++; System.out.println("FROM BYTES "); System.out.println(unpackData(sCurrentLine.getBytes(), 5)); for (int j = 0; j < sCurrentLine.length(); j++) { char c =