Size - picture clause, COBOL Programming

Size:

The number of characters or digits needed to store the data item in the memory in termed as the Size of the data item.

All the 4 general characteristics explained can be specified through a PICTURE clause. The clause PICTURE is to be followed by a picture character string as shown below.

663_Size.png

The character string can contain 1 to 30 code characters which define the above mentioned attributes of the elementary item. The code characters and meaning are shown below:

701_Size1.png

There is no exceptional code to indicate the size.

The total number of occurrence of 9, X or A in the picture string specifies the size.

The occurrence of V, P & S are not counted in determining the size of an item.

The permissible combinations are governed by the rules as shown below:

(i)  In the case of an alphabetic item the picture may hold only the symbol A.

(ii)  In the case of a numeric item the picture may hold only the symbols 9, V, P & S.

These are known as operational characters. It should hold at least one 9. 

The symbols V and S can appear only once and S, if it is involved, should be the leftmost character of the picture string. The symbol P can be repetitive on the right or on left as many times as is needed to indicate the position of the assumed decimal point.

(iii) In the case of an alphanumeric item, the picture may hold all Xs or the combination of 9, A and X (except all 9 or all A). In the afterward case the item is considered as if the string holds of all Xs.

The picture clause is only to be specified for the elementary items; it cannot be used for a group item. 

The size of a group item is equivalent to the total of the sizes of all the subordinate elementary items. The group item class is alphanumeric. 

Posted Date: 10/16/2012 3:51:01 AM | Location : United States







Related Discussions:- Size - picture clause, Assignment Help, Ask Question on Size - picture clause, Get Answer, Expert's Help, Size - picture clause Discussions

Write discussion on Size - picture clause
Your posts are moderated
Related Questions
calculate simple interest

OPEN STATEMENT: Whenever a READ or a WRITE operation is executed on a file, then it should be open. The opening of a file may be completed with the help of the OPEN verb. With

Example of File-control: The assign clause assigns a specific physical peripheral device name to a file. The physical peripheral device are machine-dependent. We use the devic

Rules of read statements: The next record is identified according to the rules as shown below: (i) Whenever the READ NEXT statement is the initial statement to be executed

PROGRAM USING OCCURS CLAUSE: We have to write a simple program to demonstrate Occurs Clause. Get the employee details for 3 persons and compute the total salary. identifica

CLOSE STATEMENT: When the processing of a file is completed, then the file may be closed. This is completed with the help of the CLOSE-verb. The form of the CLOSE statement is

REWRITE statement: The REWRITE statement is used to update the existing record in a disk file. The normal format is as shown below: REWRIE  record-name  [  FROM      ide

CLOSE statement: The simplified syntax of the CLOSE statement is as shown below:   CLOSE          file-name-1   [WITH   LOCK   ]                         [  , file-

Examples - Edit characters for numeric data: The following illustration illustrates the use of Z editing characters. The character b is used to indicate the space character an

Figurative Constants: The Figurative constants have several fixed names and the compiler recognizes these names and it sets up the equivalent values in the object program.