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
MOVE CORRESPONDING: It is frequently required to move some of the data items of one group to some other data items in the other group. If the names of the equivalent data item

CR and DB (Credit and Debit Sign): The two characters that is CR or DB symbol may appear only at the rightmost place of the picture. They are similar to the minus sign edit ch

MERGE VERB WITH OUTPUT PROCEDURE: Like the sort verb, the merge verb can also have an output procedure. The syntax of the MERGE verb is as shown below:   The r

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


FILE DESCRIPTION- FIXED-LENGTH RECORDS: The normal characteristics of a file are explained in the file description (FD) entry of the DATA DIVISION.

Illustration of Renames clause: In the illustration, PAT-OTHER-THAN-BASIC will become a fresh group consisting of DEARNESS-ALLOWANCE, HOUSE-RENT & MTHLY-INCENTIVE. Keep in min

Example of Write statement: Illustration: (i) WRITE TRANS-RECORD AFTER ADVANCING 3 LINES. This WRITE statement specified that the TRANS-RECORD is a record name of a fi

FILE-CONTROL ENTRIES FOR THE SEQUENTIAL FILES: The characteristics of each and every files handled in a program are specified in the ENVIRONMENT DIVISION and DATA DIVISION.

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