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
Introduction to MOVE Verb: The aim of this section is to introduce the learner how to move data from one place to the other place in the memory. This is completed with the help

INPUT-OUTPUT SECTION: This section holds information regarding the files to be used in the program. There are 2 paragraphs in this section- FILE-CONTROL & I-O-CONTROL. The

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

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

READ STATEMENTS: The common format for the read statements is as shown bellow. Format 1: READ file-name RECORD [ INTO   identifier ] [  ;  AT   END     imperative-s

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

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

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

Name the divisions in a COBOL program are given below DENTIFICATION DIVISION DATA DIVISION ENVIRONMENT DIVISION PROCEDURE DIVISION.

Comparison of Numeric Operands: We are well-known with the kind of the relational condition where both the operands are numeric. The comparison in this situation is algebraic