Value clause - cobol programming, COBOL Programming

VALUE CLAUSE:

The value clause defines the preliminary value of the data item.

Normally initialization will be completed just before the first statement in the procedure division is executed.

The syntax is:

VALUE is literal

The literal can be any of the numeric value, a nonnumeric string of characters involved within the quote (") or any figurative constant. 

Examples:

1)  01 a  pic value is 100

2)  01 compname pic x(15) value is "ABC Company"

3)  01 n pic 9(2) value is ZERO

4)  01 ans pic x value is space

5)  01 result pic x(4) value spaces. 

6)  For Group Data value specification

       01 test-entry  value is "123456".

       02  t1      pic 9(2).

       02  t2      pic 9(2).

       02  t3      pic 9(2).

                 Here t1=12, t2=34 & t3=56. 

 

Posted Date: 10/16/2012 4:24:31 AM | Location : United States







Related Discussions:- Value clause - cobol programming, Assignment Help, Ask Question on Value clause - cobol programming, Get Answer, Expert's Help, Value clause - cobol programming Discussions

Write discussion on Value clause - cobol programming
Your posts are moderated
Related Questions
Illustration of simple sort verb: Illustration: Suppose that we have a card file with the following records description in the data division. The names of the work fil

PROGRAM FOR ADD VERB: We have to write a simple program to elaborate the ADD verb. You can also use edit characters in the program. Identification division. Program- id.

PROGRAM FOR MASTER FILE MAINTENANCE: We have to write a program to keep the stu-file for which a record has just 2 fields,viz., rno(Roll Number) and name(Student Name). Give t

Block Size: The normal practice is to group a number of consecutive records to form that is termed as a block or a physical record. The number of records in a block is frequen

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

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

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

Data Names and Identifiers:   The Data name provides reference to the storage space in the memory where the real value is stored. This value takes part in the operation whene

Abbreviation: The Consecutive relational conditions in a compound condition can be abbreviated in many cases as shown: (i) When the subjects in the consecutive relational c

ON SIZE ERROR OPTION:   If after an arithmetic expression, the result exceeds the highest value which can be accommodated in the result; this error is termed as size error. T