Questions tagged [packed-decimal]

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).

39 questions
2
votes
3 answers

COBOL DATATYPE CONVERSION: Convert date in DDMMYY to a packed decimal of 3-bytes

I have a requirement where I want to move a date(DDMMYY) in numeric format into a packed decimal/ comp-3 of 3 bytes. the date have to be moved into an file where only 3 characters/bytes are allocated for it. This is what I tried. 03 …
Sahu Vinita
  • 69
  • 1
  • 4
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
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

Physical storage of COBOL PACKED-DECIMAL field on Little Endian machines

I understand the shape of the bytes behind a PACKED-DECIMAL number when on a Big-Endian machine. What I have not been able to discover is what shape would those bytes take on a Little-Endian machine. Note: The reason I believe there does exist a…
Morag Hughson
  • 7,255
  • 15
  • 44
1
vote
2 answers

Convert String to packed decimal in java

I have a use case wherein I need to create a file for the mainframe, which contains text and packed decimal using Java. I have gone through a lot of threads on Stack Overflow, but nothing seems to be working. I am using JTOpen library. Here is a…
praveen
  • 11
  • 1
1
vote
0 answers

Unpack mainframe packed decimal with python

I have txt file exported from mainframe, which contains the packed decimal data, looks like junk data. I want convert it to readable format using python script. for ex. convert this ��% to 5420
SKP
  • 151
  • 16
1
vote
2 answers

Who can tell me what's wrong with this RPGLE-array?

In have a printer file that looks somewhat like this: Customer-data Units01 Units02 ....... Units11 ------------------------------------------------------------- Name/address/zip/.... Count01 Count02 .......…
Jaap Bregman
  • 73
  • 1
  • 8
1
vote
0 answers

How to read packed decimal / packed integer format in R

I have to read data from an archaic fixed-width table. Some of the fields are in the IBM packed decimal Format, and I have no idea how to get the numbers. for example, one line of my Input file might look like this: 140101 72 ‘ëm§11 where…
Stefan F
  • 2,573
  • 1
  • 17
  • 19
1
vote
1 answer

packed decimal to zoned decimal or decimal conversion python

I need to write code in python which will convert packed decimal data to zoned decimal or decimal data.If anybody already have written function for it please help me with it. Thanks in Advance.
user3118158
  • 93
  • 2
  • 7
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…
1
vote
2 answers

Converting a character array of packed decimal to integer in C program

I need to write a C program to convert packed decimal field in a buffer to in integer value. The precision of packed decimal is 9 and Scale is 0. What is the best way to convert this in a IBM mainframe C progrram? In Cobol the format for Packed…
1
vote
0 answers

php string as hexadecimal

I have to write ascii digits (not letters) like hex chars. One byte have to contain 2 digits (one per semibyte), suppose this is the string i have '0665879955443322' to write in file and this result 06 65 87 99 55 44 33 22 (8 bytes) i want have!…
1
vote
3 answers

COBOL Packed data type: Type = P5

This may be a very basic question for COBOL experts. But I till date had nothing to do with COBOL. We are processing some files based on character position. The files are being sent to us from mainframe machines and we have a layout file for that…
1
vote
2 answers

COBOL DATATYPE CONVERSION: Number to Packed Numeric, Packed Date COMP-3

I am trying to convert Number to PACKED DEMCIMAL, from web research number 123 will be 123D (C if negative number) as packed number, My question is "is this a correct PACKED DECIMAL?" because requirement that I have states, date will be stored in…
Ronak Patel
  • 3,819
  • 1
  • 16
  • 29
0
votes
1 answer

COBOL Comp-3 In Java

Is that possible to generate a COMP-3 Field in Java? I'm doing a process that a I need to send a txt file to Mainframe and for bether processing it used a COMP-3 field, to avoid a conversion process in COBOL, I'm trying to generate this format in…