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
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

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

PERFORM WITH VARYING OPTION: The format is as shown below:

Data Division: The Data Division is a part of the COBOL program where every data item processed by the program is described. It is very important to note that unless a data

Comparison of the Numeric Operand with Nonnumeric Operand: The numeric operand can be compared to the nonnumeric operand subject to the restrictions which are as follows.

Program for Sequential File Creation & Rewriting  We have to write a program to create a Length file with just two fields: l (Length) and l-c (Length-Code). Add a few records.

RELATIVE FILES: The Files that are stored on a direct access storage medium like magnetic disk are frequently known as direct access files. The COBOL supports three different

RULES OF MOVE VERB:  The Data movement is managed by the rules which are as shown below: (a) The contents of the identifier - 1 or the value of the literal - 1 is moved to

COMPUTE VERB: The COMPUTE verb is very powerful. All the evaluations performed by the other 4 verbs can also be completed easily by using the COMPUTE verb. Its normal format i

SIGN CONDITION:   The sign condition establishes whether or not the algebraic value of an operand is negative, positive or zero. The operand can be either the numeric identif