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
DELETE STATEMENT: The format of the delete statement is as shown below: DELETE   file-name RECORD   [  ;   INVALID   KEY  imperative-statement  ] Whenever the ACCESS MOD

Name the divisions in a COBOL program are given below DENTIFICATION DIVISION DATA DIVISION ENVIRONMENT DIVISION PROCEDURE DIVISION.

FILE CHARACTERISTICS: The task of file handling is the responsibility of the system software termed as IOCS (Input-Output control system). Record Size: We know that th

NESTED IF STATEMENT:   The then and else statement of an IF statement can hold other IF statements. The involved IF statements in their turn may also hold other IF statements

ADD VERB: The ADD Verb can be used to find the sum of two or more numbers and to store the sum.  The ADD verb takes any one of the two forms as shown below:

NONSTANDARD CLAUSES: The various clauses explained above are as per the ANSI standard. Also, most compilers provide for additional nonstandard clauses to meet the specific nec

When using the accept verb in cobol is it possible to assign something other then "SYSIN" for a ddname?

PROGRAM TO FIND INTEREST ON BANK DEPOSITS: We have to write a program to find interest on deposits. The criteria is given below : identification division. program-

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-CONTROL paragraph for the indexed files: The common format for the SELECT clause for a file is as shown below: SELECT  file-name  ASSIGN   TO  implementor -name