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

I uploaded a file from PC to Mainframe, variable LRCL 256. In my COBOL program I defined it as FD INPUT-FILE LABEL RECORDS ARE OMITTED BLOCK CONTAINS 0 RECORDING MODE

What is the difference between subscript and index

DISPLAY STATEMENT:   The function of the DISPLAY statement is just opposite to that of the ACCEPT statement. It is used to display the low-volume results on the operator's co

How do i write a simple cobol programming that works

Illustration of if- else statement: IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 BALANCE-CODE In this illustration, the OK-BALANCE is a condition name. No action is specific if

I need help with a COBOL programming assingment. I have started the program but I need help completing the program. I have 5 errors. Here is the question. 10. Suppose your company

RULES FOR SEARCH VERB: The rules apply for the SEARCH verb is as shown below: (1) The SEARCH verb can be applied only to a table that has the OCCURS clause and INDEXED phra

REWRITE statement: The REWRITE statement is used to update the existing record in a disk file. The normal format is as shown below: REWRIE  record-name  [  FROM      ide

PROGRAM FOR MOVE CORRESPONDING: We have to write a simple program to demonstrate Move Corresponding. identification division.   program- id.   environment division.