Back to category: Miscellaneous

Limited version - please login or register to view the entire paper.

COBOL Computational Fields

COBOL Computational Fields:
This is a discussion of COBOL Computational fields. Several numeric data types are discussed, including the common "packed" and "comp-3" fields.
By default, numeric values in COBOL are stored in display, or character, format. That is, the value is stored as a base-ten number, with each digit represented by the corresponding EBCDIC (or ASCII) character. For example, the value 1234 is stored in four bytes which contain "1", "2", "3", and "4" (F1, F2, F3, F4 Hex).
But because computers perform computations with binary numbers, it is more efficient to store values in their native binary form than to store them in human readable base ten. If the number is stored in its native binary format it can be input from the file and used directly. If it's stored in a base ten format it needs to be converted to binary before performing calculations on it, then converted back to base ten for storage. Binary is faster -- typically about 8 times -- and usually requires le...

Posted by: Shelia Olander

Limited version - please login or register to view the entire paper.