The SUBTRACT statement subtracts one numeric item, or the sum of two or more numeric items, from one or more numeric items, and stores the result.
___ Format 1 ___________________________________________________________ | | | <__________________ | | >>__SUBTRACT____ _identifier-1_ _|__FROM_____________________________> | | |_literal-1____| | | | | <___________________________ | | >____identifier-2__ _________ _|_____________________________________> | | |_ROUNDED_| | | | | >__ ____________________________________________ ____________________> | | |_ ____ __SIZE ERROR__imperative-statement-1_| | | |_ON_| | | | | >__ _________________________________________________ _______________> | | |_NOT__ ____ __SIZE ERROR__imperative-statement-2_| | | |_ON_| | | | | >__ ______________ _________________________________________________>< | | |_END-SUBTRACT_| | | | |________________________________________________________________________|All identifiers or literals preceding the key word FROM are added together and this sum is subtracted from and stored immediately in identifier-2. This process is repeated for each successive occurrence of identifier-2, in the left-to-right order in which identifier-2 is specified.
___ Format 2 ___________________________________________________________ | | | <__________________ | | >>__SUBTRACT____ _identifier-1_ _|__FROM__ _identifier-2_ ___________> | | |_literal-1____| |_literal-2____| | | | | <___________________________ | | >__GIVING____identifier-3__ _________ _|_____________________________> | | |_ROUNDED_| | | | | >__ ____________________________________________ ____________________> | | |_ ____ __SIZE ERROR__imperative-statement-1_| | | |_ON_| | | | | >__ _________________________________________________ _______________> | | |_NOT__ ____ __SIZE ERROR__imperative-statement-2_| | | |_ON_| | | | | >__ ______________ _________________________________________________>< | | |_END-SUBTRACT_| | | | |________________________________________________________________________|All identifiers or literals preceding the key word FROM are added together and this sum is subtracted from identifier-2 or literal-2. The result of the subtraction is stored as the new value of each data item referenced by identifier-3.
___ Format 3 ___________________________________________________________ | | | >>__SUBTRACT__ _CORRESPONDING_ __identifier-1__FROM__________________> | | |_CORR__________| | | | | >__identifier-2__ _________ _________________________________________> | | |_ROUNDED_| | | | | >__ ____________________________________________ ____________________> | | |_ ____ __SIZE ERROR__imperative-statement-1_| | | |_ON_| | | | | >__ _________________________________________________ _______________> | | |_NOT__ ____ __SIZE ERROR__imperative-statement-2_| | | |_ON_| | | | | >__ ______________ _________________________________________________>< | | |_END-SUBTRACT_| | | | |________________________________________________________________________|Elementary data items within identifier-1 are subtracted from, and the results are stored in, the corresponding elementary data items within identifier-2.
The composite of operands must not contain more than 18 digits. The compiler ensures that enough places are carried so that no significant digits are lost during execution.
For all Formats:
In Format 2, must name an elementary numeric item, unless the identifier follows the word GIVING. Each identifier following the word GIVING must name a numeric or numeric-edited elementary item.
In Format 3, must name a group item.
Subtopics:
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.