Browse Prior Art Database

NLS Translation of Packed Decimal Fields

IP.com Disclosure Number: IPCOM000109935D
Original Publication Date: 1992-Sep-01
Included in the Prior Art Database: 2005-Mar-24
Document File: 1 page(s) / 35K

Publishing Venue

IBM

Related People

Trojacek, LA: AUTHOR

Abstract

Disclosed is a program that will convert packed decimal fields from EBCDIC to ASCII and vice-versa.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 100% of the total text.

NLS Translation of Packed Decimal Fields

      Disclosed is a program that will convert packed decimal fields
from EBCDIC to ASCII and vice-versa.

      A packed decimal field is always assumed to be an integer.
Each of the 10 decimal digits is represented by 4 bits, with a
maximum number of digits allowable of 31 plus 4 bits that represent
the sign of the number.  The sign of a packed decimal number must be
converted to be able to flow through multiple operating system
codepages.

      The disclosed program accepts an input and output codepage and
understands the conversion rules for packed decimal numbers from
EBCDIC to ASCII and vice-versa.  If supplied codepages are in
different character sets then the conversion would be performed.  The
conversion would convert only the last 4 bits (right side) of the
last byte (right side) which is changed as follows:
Hexadecimal 'B' (if negative and output code page is ASCII).
Hexadecimal '3' (if positive and output code page is ASCII).
Hexadecimal 'D' (if negative and output code page is EBCDIC).
Hexadecimal 'C' (if positive and output code page is EBCDIC).

      The rest of the numeric packed decimal data is the same between
codepages.

      An EBCDIC 123 would be stored as '123C' with an ASCII 123 being
stored '1233'.

      Disclosed anonymously.