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
RULES OF REDEFINES CLAUSE The rules shown below govern the use of the REDEFINES clause: (i) The level-number of data-name-1 and data-name-2 should be identical. (ii) Exce

OCCURS CLAUSE - PROGRAM: We have to write a program to demonstrate the occurs clause. Get names of the students and show them on the screen.  identification division.

PROGRAM FOR ADD CORRESPONDING: We have to write a simple program to demonstrate Add Corresponding.   identification division.   program- id.   environment division.

PROGRAM FOR SIMPLE PERFORM: We have to write a program to elaborate simple PERFORM statement Identification division. Program- id.  Perf1. Environment division. Da

bal majduri ik kanuni apradh hai is de bavjud bache ,ghra,hotla,road, kam karn lai majbur han bacheya te mapeya nu parhai val prerit karn lai ik bashan teyar kro

Write a COBOL IF sentence to use the values of numeric variables EXAM and COURSEWORK , both assumed to be with format PIC 999 and in the range 0 to 100 and to move the value:

File Activity: The file activity is a measure of the proportion of records processed during an update run. Therefore we define the activity ration as shown below. Activi

Comparing features of oracle rdbms with Mysql

Point Location: The position of the decimal point is the other characteristic which can be specified in the case of the numeric data items. If the position is not specified, t

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