Rule Definition
COMPUTE is a performance consuming statement and should be used to perform complex arithmetic operations. Simple operation should be performed by using ADD, SUBTRACT, MULTIPLY and DIVIDE statements that are more efficient and more easy to understand.
Remediation
Replace COMPUTE statements used for only one arithmetic operation by ADD, SUBTRACT, MULTIPLY or DIVIDE statements.
Violation Code Sample
COMPUTE A = A + 1
COMPUTE D = B / C
COMPUTE E = 4
Fixed Code Sample
ADD 1 TO A
DIVIDE B BY C GIVING D
MOVE 4 TO E
Reference
IBM Enterprise Cobol - Programming Guide
Related Technologies
Cobol
Technical Criterion
Complexity - Algorithmic and Control Structure Complexity
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.