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
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

PROGRAM FOR PERFORM ...UNTIL We have to write a program to find the sum of "n" natural numbers. Identification division. Program- id. PerfUntil. Environment division.

we have input file ,record layout is EMP ID (6 char) , EMP NAME (20 char), Designation (3 char),Salary (5 digit) Base Branch (10char) Grade (3 Alphanumeric). This is the input file

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

FILE-CONTROL: The FILE-CONTROL paragraph names each and every file and identifies the first medium through file control entries. The basic format of a file control entry is gi

DIVIDE VERB: The aim of the DIVIDE verb is to divide one number by the other and to store the result.  There are few forms of this verb. One of its forms is as shown below:

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

Valid and Invalid Word - Cobol words: Valid Word             Invalid Word & Reason emp-sal                  -pay   ( it starts with a hyphen)  TOTAL MARK (blank space em

PROCEDURE DIVISION statements for the indexed files: All the statements which are available for a relative file are also available for an indexed file. READ STTATEMENT :

, (Comma) : A comma, whenever used in a picture, is considered as an insertion character and inserted wherever it become visible. There can be more than one comma in the pictu