ILE COBOL Language Reference

Character-String and Item Size

In your program, the size of an elementary item is determined through the number of character positions specified in its PICTURE character-string. In storage, however, the size is determined by the actual number of bytes the item occupies, as determined by the combination of its PICTURE character-string and its USAGE clause.

+-------------------------------IBM Extension--------------------------------+

The size of an elementary item with a PICTURE clause that includes the LOCALE phrase is determined from integer-1 of the SIZE phrase.

For internal floating-point items, the size of the item in storage is determined by its USAGE clause. USAGE COMPUTATIONAL-1 reserves 4 bytes of storage for the item; USAGE COMPUTATIONAL-2 reserves 8 bytes of storage.

The size of an elementary item of class date-time is determined from the FORMAT literal or from the integer in the SIZE phrase.

+----------------------------End of IBM Extension----------------------------+

Normally, when an arithmetic item is moved from a longer field into a shorter one, the compiler truncates the data to the number of characters represented

in the shorter item's PICTURE character-string.

For example, if a sending field with PICTURE S99999, and containing the value +12345, is moved to a BINARY receiving field with PICTURE S99, the data is truncated to +45. For additional information see USAGE Clause.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]