Module 6: Procedure Division
COBOL SUBTRACT Verb
- The SUBTRACT verb is used to subtract one or the addition of two or more numeric values from one or more numeric values and store the subtracted value.
- Basic syntax:-
Format 1:-SUBTRACT {identifier-1/literal-1} [, {identifier-2/literal-2}]… FROM identifier-3 [, identifier-4]…Format 2:-SUBTRACT {identifier-1/literal-1} [, {identifier-2/literal-2}]… FROM {identifier-3/literal-3} [, {identifier-4/literal-4}]… GIVING identifier-5 [, identifier-6]…
- Below table will help you understand few possible operations using SUBTRACT
- Last named operand must never be literal as the resultant value is always stored there.
- When GIVING option is coded, then only we can use numeric literal in place of identifier-3, identifier-4