ILE COBOL Language Reference

Data Categories and PICTURE Rules

The allowable combinations of PICTURE symbols determine the data category of the item.

Note:
If the LOCALE phrase is specified in a PICTURE clause, the category of data defined by that PICTURE clause is numeric-edited only.

Alphabetic Items

Numeric Items

Examples of numeric items:

PICTURE          Valid Range of Values
9999                   0 through 9999
S99                  -99 through +99
S999V9            -999.9 through +999.9
PPP999                 0 through .000999
S999PPP            -1000 through -999000 and
                   +1000 through +999000 or zero

Numeric-Edited Items

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

If the LOCALE Phrase is Specified

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

Alphanumeric Items

Alphanumeric-edited Items

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

Boolean Items

The following rules apply:

  1. The PICTURE character-string can contain only the symbol 1.
  2. Only one character 1 can be specified.
  3. The USAGE of an item can only be DISPLAY.
  4. An associated VALUE clause must specify a Boolean literal (B"1" or B"0") or zero.
  5. The following clauses cannot be specified for a Boolean item:
  6. The INDICATOR clause can be specified.

(See the ILE COBOL for AS/400 Programmer's Guide for more information about indicators.)

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

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

DBCS Items

  1. The PICTURE character-string can contain the symbol(s) G or N.
  2. Each G or N represents a single DBCS character position (2 bytes).
  3. When PICTURE clause symbol G is used, USAGE DISPLAY-1 must be specified.
  4. When PICTURE clause symbol N is used, USAGE DISPLAY-1 must be implicitly or explicitly specified.
  5. Associated VALUE clauses must specify a DBCS literal or the figurative constant SPACE/SPACES.

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

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

DBCS-Edited Items

  1. The PICTURE character-string is a combination of G's and B's with at least one of each.
  2. Each G, and B represents a single DBCS character position (2 bytes).
  3. USAGE DISPLAY-1 must be specified.
  4. Associated VALUE clauses must specify a DBCS literal or the figurative constant SPACE/SPACES.

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

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

National Items

  1. The PICTURE character-string can contain the symbol(s) N.
  2. Each N represents a single UCS-2 character.
  3. When PICTURE clause symbol N is used, USAGE NATIONAL must be implicitly or explicitly specified.
  4. Associated VALUE clauses must specify a national hexadecimal literal or the figurative constant SPACE/SPACES.

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

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

External Floating-Point Items

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


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