Program for size error , COBOL Programming

PROGRAM FOR SIZE ERROR:

 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.

Para-1.

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.

End-para.

  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
WRITE statement: The WRITE statement for tape and sequential-disk files has the syntax shown below. WRITE            record-name      [  FROM    identifier   ] As a resu

Column and Field in COBOL program: In COBOL there are 2 types of entries termed as margin A and margin B entries. The Margin A entries start from the column 8, 9, 10 or 11 and

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

Example of Move corresponding: Consider the DATA DIVISION entries shown below. Suppose it is needed that the data stored in the 4 fields of the PAY_REC should be

Illustration of perform statement: PERFORM    CALCUALTE-TAX. In this illustration, the CALCULATE-TAX is either a section name or paragraph name. Assume that it is a section

SIMPLE MERGE VERB: Like sorting, the merging of files is often required in different commercial application. It is likely to merge two or more files with the help of one MERGE

Example of Level numbers - cobol programming: To explain the hierarchical structure introduced above, the concept of the level number is employed in COBOL. The most broad

ROUNDED OPTION: Let us consider the DATA DIVISION entries which are as shown below: Now, subsequent to the execution of the statement ADD A B GIVING C, the C will hold

ON SIZE ERROR OPTION: Whenever a size error occurs, the contents of the result field after the operation is unpredictable.  Though, the processing is not-terminated and the co

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