Program for add verb, COBOL Programming

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

Environment division.

Data division.

Working-storage section.

77 a  pic    s9(3)v9(2) value 0.

77 b  pic     s9(3)v9(2) value 0.

77 c  pic     s9(4)v9(2) value 0.

77 e-c pic   +z(4).z(2).

Procedure division.

Para-1.

    Identification division.

    program- id. Add verb.

    environment division.

    data division.

working - storage section.

      77  A  PIC  S9(3)   V9(2)

      77  B  PIC  S9(3)  V9(2)

      77  C  PIC  S9(4)  V9(2)

      77  e-a  PIC  +z(4)  Value 0

PROCEDURE DIVISION

PARA - 1

Description:   This program gets 2 inputs from the user.

                      It adds them by using the ADD verb. 

               c=a+b

The unedited outcome is available in c.

We move c to e-c, where the edit characters are available.

Note that the variable e-c makes the use of the + edit character.

The e-c will always be exhibited with result. 

 

Posted Date: 10/17/2012 1:27:44 AM | Location : United States







Related Discussions:- Program for add verb, Assignment Help, Ask Question on Program for add verb, Get Answer, Expert's Help, Program for add verb Discussions

Write discussion on Program for add verb
Your posts are moderated
Related Questions
Illustration of the abbreviation: A few illustration of the abbreviation are given below: Illustration: The compound condition  AMOUNT GREATER THAN 499 AND AMOUNT L

PROGRAM TO FIND INTEREST ON BANK DEPOSITS: We have to write a program to find interest on deposits. The criteria is given below : identification division. program-

Comparing features of oracle rdbms with Mysql

Environment Division: The Environment Division is the second division in the COBOL source program. It is mainly machine-dependent . The computer and all the peripheral dev

SEQUENTIAL FILE CREATION AND REWRITING: We have to write a program to create a student file with just two fields: sno i.e. Student Number and same i.e. Student Name. Add a few

PROGRAM FOR RENAMES CLAUSE: identification division. program- id. environment division. data division. working-storage section. 01 emp.      02 empdet.

.(Period or Decimal Point) : The period may be used to insert a decimal point and may not come into view more than once. Both the period and V cannot appear in similar picture

DECLARATIVE and FILE STATUS Clause: The input-output exception condition in the situation of a direct access files can be handled by a declarative procedure in a manner simila

Example of Special-names: Consider the illustration: Let the SPECIAL-NAMES paragraph be as shown: SPECIAL-NAMES. CHANNEL 1 IS PAGE-TOP. The Channel is related with the t

REDEFINES CLAUSE: At times it may be found that two or more storage regions defined in the DATA DIVISION are not in use concurrently. In such situations only one storage regio