Questions tagged [ebcdic]

Extended Binary Coded Decimal Interchange Code (EBCDIC) is a set of 8-bit character encodings.

Extended Binary Coded Decimal Interchange Code (EBCDIC) is a set of closely related 8-bit character encodings (code pages) used primarily on IBM mainframe operating systems such as z/OS, OS/390, VM and VSE, as well as IBM midrange computer operating systems such as OS/400 and i5/OS (see also Binary Coded Decimal).

208 questions
1
vote
2 answers

PySpark failing to decode 'cp1047' when processing mainframe input

In one of my requirements is to decode a byte-array based on a cp1047 code page. A sample of my code is: ebcdic_str = input_bytes.decode('cp1047') The above code using python works correctly but while executing the same operation as part of the…
1
vote
1 answer

Save EBCDIC string to a file - Python

I am trying to write this EBCDIC string(ÑkÀ*) to a file. I want to save the exact string in the file but whenever i try saving it, it adds extra characters to the file and the byte count is 6 bytes(2 hidden characters added) instead of 4…
bil mason
  • 11
  • 4
1
vote
3 answers

Converting EBCDIC Char to Hex values (AFP EBCDIC data)

I working with some EBCDIC data that I need to parse and find some Hex values. The problem that I'm having is that it appears that I'm reading the file in with the incorrect encoding. I can see that my record begins with "!" (which is a x5A in…
Tom Alderman
  • 305
  • 8
  • 17
1
vote
1 answer

Simple Way in Java to check if char is in EBCDIC

I'm trying to figure out how to check if a char is in EBCDIC. One approach would be to have a predefined array with all possible EBCDIC signs, and check if the character can be found in that array. Is there a better/cleaner way?
1
vote
1 answer

Loading packed decimals into DB2 for IBM i

I am having trouble loading packed data exported from IBM i DB2 into a second IBM i DB2 database. The file comes from a vendor and other kinds of methods like direct connections are not available. Here are the contents of small test file. Note that…
f_lost
  • 67
  • 1
  • 4
1
vote
3 answers

Convert EBCDIC file to ASCII using Python 2

I need to convert the EBCDIC files to ASCII using python 2. The sample extract from the sample file looks like the below (in notepad++) I have tried to decode it with 'cp500' and then encode it in 'utf8' in python like below with open(path, 'rb')…
Ramandeep Mehmi
  • 81
  • 1
  • 13
1
vote
3 answers

Convert EBCDIC data file to ASCII

I have an EBCDIC data file which is variable length. Inside this file, it contains binary data (comp), packed-decimal (comp-3), display-numeric (pic (9)), and string (pic (x)). How to convert it to ASCII using a language such as Java, Perl, or…
pat
  • 57
  • 1
  • 10
1
vote
1 answer

Read packed decimal and convert to numeric in spring boot

All, I am using a Spring boot application to store data in DB. I am getting this data from IBM MQ through Kafka topic. I am getting messages in EBCDIC format, so used cobol copybook, JRecord, cb2xml jars to convert to readable format and store in…
Sojan
  • 47
  • 5
1
vote
1 answer

EBCDIC (Cp1047) junit 0D25

I'm working with some data encoded in EBCDIC and I'm required to substitute some of the values. One of the values is the hex bytes 0D 25 which have to become 40 40. I understand this to mean that the EBCDIC characters are as follows: 0D: carriage…
geco17
  • 5,152
  • 3
  • 21
  • 38
1
vote
0 answers

Decoding EBCDIC byte array to String and back to byte array

In my previous question, I pointed out the following problem: byte[] a = new byte[] { 0x00, 0x00, 0x00, 0x25 }; String stringValue = new String(a, "273"); int firstResult = ByteBuffer.wrap(a).getInt(); …
doct0re
  • 373
  • 4
  • 10
1
vote
1 answer

How to convert unicode to ebcdic CCSIDs-1025 and write to a db2

My problem is that the input is an XML file with UTF-8 encoding. The database is encoded with CCSIDs-1025 (DB2). The application itself is windows-1251 encoded. After parsing the XML, I save the data to a regular char array. Of course, in my system…
Dastin_DV
  • 11
  • 1
1
vote
1 answer

Having trouble unpacking Comp-3 in .Net. There are letter characters aside from sign character inside Comp-3 value

I am trying to import a Mainframe EDI File back to SQL Server using .NET and I am having problems unpacking some comp-3 fields. This file was from one of our clients and I have the Copy Book layout for the following fields: 05 EH-GROSS-INVOICE-AMT …
Sirch Dcmp
  • 147
  • 1
  • 9
1
vote
1 answer

Get File encoding ASCII or EBCDIC with java

I have a file which extension is .b3c i want to know if it's encoded in ASCII or EBCDIC using java jow can I achieve that please. Help is needed. Thanks
Bizi
  • 69
  • 1
  • 8
1
vote
1 answer

External Table Oracle using EBCDIC file in binary format - Error KUP-03003

My environment: Oracle 12.2 on Red Hat version 7 ( database characterset AL32UTF8 ) I am having a huge issue dealing with an external table which points to a file in EBCDIC format coming from an AS400 system. I could figure out finally the length of…
Roberto Hernandez
  • 8,231
  • 3
  • 14
  • 43
1
vote
0 answers

Is there any way to convert IBM937 to Unicode in .NET

Is there any way to convert IBM937(EBCDIC with Chinese zh-tw) to Unicode in .NET? The Encodings in .NET supported some EBCDIC encodings, but not all, especially in DBCS. I want to convert EBCDIC byte array (maybe with 0x0e, 0x0f) from/to Unicode…
Chinor
  • 91
  • 1
  • 6