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
GO TO, STOP RUN: The GO TO verb is used to completely transfer the control to elsewhere in the program. Its form is as shown below: GO TO procedure-name As a result o

INPUT-OUTPUT SECTION: This section holds information regarding the files to be used in the program. There are 2 paragraphs in this section- FILE-CONTROL & I-O-CONTROL. The

Floating Insertion   The currency symbol ($) can emerge in multiples on the left-hand side of the picture. In this situation the character will be treated in similar way as t

RULES OF MOVE VERB:  The Data movement is managed by the rules which are as shown below: (a) The contents of the identifier - 1 or the value of the literal - 1 is moved to

The LENDER Bank offers mortgages on homes valued up to $500,000. The required down payment is calculated as follows: 4% of the first $60,000 borrowed 8% of the next $30,000 borro

TO WRITE A QUADRATIC EQN ROOTS ARE COMPLEX IN COBOL PROGRAM

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

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

SPECIAL-NAMES: This paragraph is used to associate some hardware names to the user-specified mnemonic names. This paragraph is elective in all compilers. The format of this pa

Currency Sign - edit characters for numeric data: $ (Currency Sign): The single currency sign can appear at the leftmost place of a picture. In that situation the $ cha