In this topic, we described about the below sections -
PICTURE clause specifies the characteristics of the data items. i.e. data item type, length etc,. PICTURE clause only coded with elementary data items and individual data items.
PICTURE clause should not coded with 88 level number, USAGE COMP-1 and USAGE COMP-2. PICTURE clause specifies the general characteristics and editing requirements of an elementary item. The PICTURE clause can be specified only at the elementary level.
PICTURE or PIC -
PIC is an abbreviation for PICTURE and has the same meaning. The PICTURE clause must be specified for every elementary item. The PICTURE clause should not specify for below -
- Index data items
- The RENAMES clause
- Internal floating-point data items
character-string is a combination of certain COBOL characters used as picture symbols. The character-string determine the category of the elementary data item. character-string can contain a maximum of 50 characters.
Data Categories used in PICTURE clause -
The PICTURE symbols combinations control the data category of the item. The data categories are -
PICTURE clause editing -
PICTURE clause can be edited to represent the data in the user expected format. PICTURE clause editing has two types to represent the data in user specified format.
- Insertion editing
- ZERO suppression and replacement editing
The type of editing allowed depends on items data category. The following table shows the valid type of editing with the corresponding category –
|Data category||Type of editing||Insertion symbol|
|Numeric-edited|| Simple insertion |
| B 0 / , |
cs + - CR DB
cs + -
Z * + - cs
|Alphanumeric-edited||Simple insertion||B 0 /|
|External floating-point||Special insertion||.|