Program for size error , COBOL Programming


 We have to write an easy program to elaborate the size error option.

Identification division.

Program- id. sizeerr.

Environment division.

Data division.

Working-storage section.

77  a     pic    s9(3) value 0.

77  b      pic    s9(3) value 0.

7    c      pic    s9(3) value 0.

77  e-c   pic   +z(3).

Procedure division.


Display(1 1) erase.

Display(3 5) "Enter first number :".

Accept a.

Display(5 5) "Enter second number :".

  Accept b.

            Sum a b to c on size error 

                      display (10 5) "Size error on c ---Please increase size"

                       go to end-para.

       Move c to e-c.

          Display(15 5) "Sum = " e-c.


  Stop run.

Description:   This program gets 2 inputs from the user.

                      It adds them by using the ADD verb. 

                      The unedited result is accessible in c.

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

                      Keep in mind that the variable e-c makes use of the + edit character.

                       The e-c will always be exhibited with result. 

Posted Date: 10/17/2012 1:31:01 AM | Location : United States

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

Write discussion on Program for size error
Your posts are moderated
Related Questions
FD Entry for variable-length Records: The RECORDS CONTAINS and BLOCK CONTAINS clause are quite dissimilar in the case of files with variable- length records. The syntax of the

PROGRAM FOR IF :   We have to write a program to check whether the given number is ODD or EVEN. Identification division. Program- id. Ifst. Environment division.

RENAMES CLAUSE: At times re-grouping of an elementary data items in a record may be essential so that they can belong to the original as well as to the latest group. This is o

Example of Nested if statement: Illustration: Consider the following sentence The nested IF sentence holds two IFs and one ELSE. The IF-ELSE couple has been marke

GO TO, STOP RUN: The GO TO verb is used to completely transfer the control to elsewhere in the program. Its form is as shown below: GO TO procedure-name As a result o

PROGRAM FOR MASTER FILE MAINTENANCE: We have to write a program to keep the stu-file for which a record has just 2 fields,viz., rno(Roll Number) and name(Student Name). Give t

Example of Redefines clause: This illustration describes a sales record that may either contain the total amount of sale or the quantity (QTY) and UNIT-PRICE. The aim of such

PROGRAM FOR ELECTRICITY BILL: An electricity company supplies electricity to 4 types of customers coded 1, 2, 3 & 4.The rate schedule for customers is shown in one table as

Structure of a COBOL Program: Every COBOL program should have the 4 divisions in the order in which they are specified below: 1. Identification division 2. Environment D

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: