Illustration of subtract verb, COBOL Programming

Illustration of Subtract verb:

(a) SUBTRACT A FROM B.

This illustration means that the value of A will be subtracted from the value of B and the subtracted result will be stored in B. The decimal point alignment will be completed automatically.

(b) SUBTRACT A, B FROM C.

This one represents that the value of B and A will be added and the resultant sum will be subtracted from the value of C.  After subtraction, the concluding result will be stored in C.  The older value of C will be lost.

(c) SUBTRACT A, B FROM C GIVING D.

This represents that the summation of the value of A & B will be subtracted from the value of C and the last result will be stored in D.  The older value of D will be lost while in this situation C retains the older value.

(d)  SUBTRACT 15 FROM A B.

At this point the number 15 will be subtracted from the values of A & B. The A & B will obtain these new values. As in the situation of the ADD statement, here also the last-named operand should not be a literal as the last result will be stored there. If the GIVING option is used, then identifier-3, identifier-4 etc. can also be the numeric literals.  For illustration, SUBTRACT A B FROM 50 GIVING C.

 

Posted Date: 10/16/2012 5:19:58 AM | Location : United States







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

Write discussion on Illustration of subtract verb
Your posts are moderated
Related Questions
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 COMPUTE VERB: We have to write an easy program to elaborate the COMPUTE verb.  Identification division. Program- id. compverb. Environment division. Da

SEQUENTIAL FILE CREATION AND REWRITING: We have to write a program to create a student file with just two fields: sno i.e. Student Number and same i.e. Student Name. Add a few

PROGRAM FOR DIVIDE VERB:   We have to write an easy program to elaborate DIVIDE verb. You can also use edit characters in the program. Identification division. Program-

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

RULES OF RENAMES CLAUSE:   The rules below should be observed while using the RENAMES clause: (i) All RENAMES entries should be written only after the last record descript

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

SUBTRACT VERB: The SUBTRACT verb is used to subtract one, or the sum of two or more numbers from one or more numbers and to store the result. The form of the SUBTRACT verb

BLANK WHEN ZERO: BLANK WHEN ZERO is an editing clause that may be used along with a picture. This will set the whole data item to blanks of its value is equal to zero. Though,

RULES OF REDEFINES CLAUSE The rules shown below govern the use of the REDEFINES clause: (i) The level-number of data-name-1 and data-name-2 should be identical. (ii) Exce