Questions tagged [comp-3]

A convention for storing numerals, one per half-byte, with the final half-byte being an indicator of the sign. Common values for the sign are C (positive) D (negative) and F (unsigned, treated as positive).

A convention for storing numerals, one per half-byte, with the final half-byte being an indicator of the sign. Common values for the sign are C (positive) D (negative) and F (unsigned, treated as positive). Rare, but possible, other values for the sign are A (positive), B (negative) and E positive.

See BCD for what looks like a packed-decimal, but only containing numerals (no signs).

31 questions
1
vote
0 answers

Unable to unpack "COMP-3" data in .NET

We are experiencing some difficulty unpacking COMP-3 fields containing both numeric and date data from a file provided to us by one of our vendors. The file specification provides the following information: 0066-0070 DATE-OPENED S9(9) COMP-3 The…
Mike Hofer
  • 16,477
  • 11
  • 74
  • 110
1
vote
2 answers

In SQL Server, I need to pack 2 characters into 1 character, similar to HEX. How?

I have a SQL Server table that has a column in it that is defined as Binary(7). It is updated with data from a Cobol program that has Comp-3 data (packed decimal). I wrote a C# program to take a number and create the Comp-3 value. I have it…
0
votes
1 answer

How to build dataframe from cobol and ebcdic file with COMP fields using Cobrix?

I am trying first to build a simple dataframe from mainframe source with cobrix to find out how it deals with ebcdic files. My Input looks like this. (hex) : 313030100C3230301A0C. If I quickly open with Notepad++ : raw_data I use these options to…
Pic Ale
  • 3
  • 1
0
votes
0 answers

EBCDIC data load into oracle

I need to load this into a table in oracle. Need the table datatype definition in oracle and SQLLoader code. the upto 500 times is ok, if I get to read the data in the file to be loaded, then I can apply other oracle concepts like Unpivot to…
Jay J
  • 1
  • 1
0
votes
1 answer

Read a packed decimal (Comp-3) number value which is 8 characters; but holds a 13 digit number and convert to 13 digits numeric value

I am seeking code to read a text file which is in packed decimal (Comp -3) numeric value which was created in main frames system and is 8 characters, but holds a 13 digit number in packed decimal format. I came across below code private Decimal…
VR1256
  • 1,266
  • 4
  • 28
  • 56
0
votes
0 answers

C++ interpreting Cobol "Comp-3" values

I'm making a C++ program that, given a Cobol copy and a sequential file, plots the content of the sequential file into a table. The problem with this is that, for example, "+12345" value in Cobol Comp-3 variables that are structured like this: 05 …
SidusBrist
  • 45
  • 6
0
votes
1 answer

EBCDIC unpacking comp-3 data returns 40404** in Java

I have used the unpack data logic provided in below link for java How to unpack COMP-3 digits using Java? But for the null data in source it returns 404040404 like on Java unpack code. I understand this was space in ebcdic, but how to unpack by…
Rajesh
  • 69
  • 1
  • 6
0
votes
2 answers

Unable to unpack comp 3 to numeric in java

I referred a code on the internet to unpack comp 3 to numeric in java. I tried to pass a sample comp3 file to the code but I didn't get the proper unpacked data. I got some weird numbers. I am new to this concept(comp 3) so can you guys help me on…
0
votes
1 answer

How to unpack comp3 files to readable format?

I have a problem while unpacking the comp3 digits in a file which is extracted from the legacy system(main frame). I tried the code which was given by a fellow stack overflow member @Jose Ventura but it didnt work. I tried to print the unpacked data…
0
votes
2 answers

In COBOL, how to convert sign comp-3 value to a readable format along with sign

I have come across a situation where the value coming in from record is in below format 01 WS-PREMIUM PIC S9(05)V9(02) comp-3. As we know in comp-3, sign is stored in last nibble. e.g. WS-PREMIUM having value +1234.10 will be stored in as…
VinDesai
  • 13
  • 1
  • 1
  • 4
0
votes
1 answer

Converting COMP-3 columns in Mainframes to readable format using Record Editor tool

This is the file which we received as Binary from Mainframes which includes COMP-3 columns as well along with other columns And when we tried loading this Binary file into Record Editor, It is displaying Special Characters Kindly let us know…
Rahul Patel
  • 307
  • 1
  • 9
  • 27
0
votes
4 answers

Converting comp-3 back to a human readable format

I have the information, that a PIC S9(4) field is encoded with comp-3. I also have a data file which contains data (in my case about a customer). When I open the data file using notepad++, it show's me chars like "DLE", "BEL" or "NUL", which leads…
jdstaerk
  • 882
  • 1
  • 13
  • 30
0
votes
3 answers

conversion of a binary put in a comp -3 field Cobol

I am trying to convert a pic S9 (9)V99 comp-3 field which has been store with binary in it. It is display like this: 6/PS X'000000002000'. This amount should show like this 20.00. I am trying to find the proper way to convert it to a pic -9…
user3127986
  • 388
  • 1
  • 10
  • 33
0
votes
0 answers

How do I move a PIC X field to a PIC S9 COMP-3 field in COBOL?

My situation is as follows. I'm reading input from a file into the following working storage field: WORKING-STORAGE SECTION. 01 WORK-FIELDS. 05 W1-INPUT. 10 TESTCASE-NUMBER PIC X(02). 10 …
Lena
  • 147
  • 1
  • 5
  • 15
0
votes
2 answers

handling comp3 and ebcidic conversion in java to ASCII for large files

I am trying to convert comp3 and EBCIDIC characters in my java code but im running into out of memory exception as the amount of data handled is huge about 5 gb. my code is currently as follows: byte[] data = Files.readAllBytes(path); this is…
BaN3
  • 435
  • 1
  • 3
  • 16