DateViewsCategory

Display decimal data type another name is zoned decimal. Each byte is separated into 2 parts. The first 4 bits is a zone and the second 4 bits is a value, thus one byte can contain only one digit. The low byte zone includes a sign. Positive numbers are represented by hexadecimal F and negative numbers by hexadecimal D. The summary of decimal data type can be found in COBOL Data Types article.

Storage Description

Byte 5Byte 4Byte 3Byte 2Byte 1
Zone-DigitZone-DigitZone-DigitZone-DigitSign-Digit

Sample 1

35,791 value

Byte 5Byte 4Byte 3Byte 2Byte 1
1111-00111111-01011111-01111111-10011111-0001

Sample 2

-35,791 value

Byte 5Byte 4Byte 3Byte 2Byte 1
1111-00111111-01011111-01111111-10011101-0001

COBOL Representation

Generic Formula

USAGE DISPLAY SIGN [IS] {TRAILING | LEADING} [SEPARATE [CHARACTER]]

Samples

05 VAR-ZN-DECIMAL PIC 9(5).
05 VAR-ZN-DECIMAL PIC 9(5)V9(2) DISPLAY.
05 VAR-ZN-DECIMAL PIC 9(5) USAGE DISPLAY.
05 VAR-ZN-DECIMAL PIC 9(5)V9(2) USAGE DISPLAY.
05 VAR-ZN-DECIMAL PIC 9(5) USAGE DISPLAY SIGN TRAILING SEPARATE.
05 VAR-ZN-DECIMAL PIC S9(5).
05 VAR-ZN-DECIMAL PIC S9(5)V9(3) DISPLAY.

Resources

  • ebcdic-parser tool for converting of mainframe EBCDIC data into Unicode ASCII delimited text

Comments

comments powered by Disqus