PROGRAM FOR SUBTRACT VERB:
We have to write a simple program to elaborate the SUBTRACT verb. You can also use edit characters in the program.
Program- id. Subverb.
77 a pic s9(3)v9(2) value 0.
77 b pic s9(3)v9(2) value 0.
77 e-b pic +z(3).z(2).
Display(1 1) erase.
Display(3 5) "Enter first number :".
Display(5 5) "Enter second number :".
Subtract a from b.
Move b to e-b.
Display(15 5) "b-a = " e-b.
Description: This program gets 2 inputs from the user.
It subtracts them by using the SUBTRACT verb.
b-a is computed and stored in b.
Afterward the execution: OLD value of a is similar
OLD value of b is lost and
b-a is stored in b.
The unedited result is available in the b.
We move b to e-b, where the edit characters are available.
Note that the variable e-b makes proper use of the + edit character.
The e-b will always be exhibited with result.