CRITICAL
Rule Definition
How you define numeric fields can have an impact on performance. If you are using a field for arithmetic increment or as a subscript
and the field has 8 or fewer digits it is quite often best to define it as a binary number (usage is BINARY, COMP or COMP-4)
that is signed. This is because binary numbers can be manipulated much faster and consume less CPU.
Remediation
Check declaration of variables used as subscripts or iterators and add a sign in their picture, adapt the number of digit to 4 or 8, and set BINARY in their usage clause.
Violation Code Sample
01 DIRECT-TAX-RATE.
01 I PIC 9(01).
02 TAX-RATE PIC 99 OCCURS 5 TIMES INDEXED BY TX-INDEX.
...
PROCEDURE DIVISION.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 6
...
END-PERFORM.
Fixed Code Sample
01 DIRECT-TAX-RATE.
01 I PIC 9(01) USAGE BINARY.
02 TAX-RATE PIC 99 OCCURS 5 TIMES INDEXED BY TX-INDEX.
...
PROCEDURE DIVISION.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 6
...
END-PERFORM.
Reference
IBM Cobol - Best Practices and Recommendations
Related Technologies
Technical Criterion
Efficiency - SQL and Data Handling Performance
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.