mainframe

How to unpack COMP-3 digits using Java?

左心房为你撑大大i 提交于 2019-11-26 18:25:41
问题 I have huge mainframe file and there are some packed digits in that file. I would like to know how to unpack following digit using java? packed digit : ? I read tutorials for unpacking digits and found the following rule to count the number of bytes required to unpack digits : total_number_of_bytes = (no. of digits + 1) / 2 I wrote the following code to unpack digits : public String unpackData(String packedData, int decimalPointLocation) { String unpackedData = ""; char[] characters =

Dynamically Reading COBOL Redefines with C#

社会主义新天地 提交于 2019-11-26 14:43:33
问题 I'm making a C# program that will be able to dynamically read an IBM HOST Copybook written in COBOL and generate an SQL table off of it. Once the table is generated I can upload a file into my program and it will read, convert from IMB-37 and insert the file into that sql table. So far I can handle almost anything, although I'm running into some issues with REDEFINES. For example: 10 SOME-FIELD PIC 9(3) COMP-3. SCRRB205 4117 10 SOME-OTHER-FIELD REDEFINES 3041-17 4117 SOME-FIELD PIC X(2). 3041