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
RULES FOR OCCURS CLAUSE: The rules apply for the OCCURS clause and the subscripts are as shown below. (1) The integer in the OCCURS clause should be a positive integer.

WRITE STATEMENT: The WRITE Statement verb releases a record in an output file. The syntax for the WRITE statement can be unlike depending on the output device and the medium us

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

REWRITE STATEMENT: As in the situation of a relative file, the REWRITE statement needs that the file should be opened in the I-O mode, and if the SEQENTIAL access mode is spec

Data Division: The Data Division is a part of the COBOL program where every data item processed by the program is described. It is very important to note that unless a data

COMPUTE VERB: The COMPUTE verb is very powerful. All the evaluations performed by the other 4 verbs can also be completed easily by using the COMPUTE verb. Its normal format i

Minus sign - edit characters for numeric data: The minus sign can appear either at the leftmost or rightmost location of the picture. If an item is negative, a minus sign will

What is the difference b/w index and subscript? Subscript indicates to the array occurrence whereas index is the displacement (in no of bytes) from the beginning of the array.

WRITE Statement:      The WRITE statement for a relative file has the format which is as shown below.          WRITE  record-name   [ FORM   identifier ]

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION: We have to write a program to create an Indexed Sequential File in a dynamic mode for Student particulars. Suppose just 3 fields: