Illustration of divide verb, COBOL Programming

Illustration of Divide verb:

(a) DIVIDE 5 INTO A.

If the value of A is 20, then after execution of this statement the value of A will be 4. The older value of A will be lost.

(b) DIVIDE 5 INTO A GIVING B.

If the value of A is 20, then after execution of this statement then the value of B will be 4. At this point the A will retain its older value.

(c) DIVIDE 3 INTO A GIVING B C.

In this illustration the result of the division of A by 3 will be stored both in B & C.

(d) DIVIDE 2.5 INTO A B GIVING C D.

In this situation the A will be divided by 2.5 and the result will be stored in C, while the result of the division of B by the 2.5 will be stored in D.

As in the situation of the MULTIPLY statement, the literals cannot be used for identifier-2, identifier-3, etc. Whenever the GIVING option is only used the numeric literals permitted in the place of identifier-2, identifier-3, etc. For illustration, DIVIDE A INTO 25 GIVING V. 

 

Posted Date: 10/16/2012 5:24:15 AM | Location : United States







Related Discussions:- Illustration of divide verb, Assignment Help, Ask Question on Illustration of divide verb, Get Answer, Expert's Help, Illustration of divide verb Discussions

Write discussion on Illustration of divide verb
Your posts are moderated
Related Questions
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

.(Period or Decimal Point) : The period may be used to insert a decimal point and may not come into view more than once. Both the period and V cannot appear in similar picture

GIVING    file-name-5. The input files to be merged through the MERGE statements which are specified in the USING phrase. These files should be sequential files and should be

File Description for the Relative and Indexed Files: The FD entry for a relative or an indexed file is similar to that of a sequential file. Some compilers do not permit varia

INDEXED SEQUENTIAL FILES: In the indexed sequential files which are also known as indexed files, the records are stored in the sequence order generally in ascending order. In

CLOSE statement: The simplified syntax of the CLOSE statement is as shown below:   CLOSE          file-name-1   [WITH   LOCK   ]                         [  , file-

There are some restrictions when these procedures are used. (i) The Procedure should not contain any SORT/MERGE statement. (ii) An explicit transfer of the control outside

Example of If- else statement Illustration:   IF   QUANTITY IS NUMERIC AND QUANTITY IS POSITIVE          MOVE ZERO TO ERROR-CODE. COMPUTE SALES VALUE=QUANTITY*RATE

CONDITION - COBOL Programming: The condition is an entity which at one point of time can have only one of the two values - true or false. As we already know that, the IF verb

Example of Perform statement: PERFORM BEGIN-CALCULATION THRU END-CALCULATION. Assume, BEGIN-CALCULATION and END-CALCULTION is paragraph names. The execution of the PERFORM