Coding Standards for Database Files › Coding Standards for COBOL Programs › Handling Dates in COBOL › COBOL Job Name/Operator ID › Calculation Checks
Calculation Checks
When carrying out calculations, always test that a divisor is not zero before dividing with it.
Example of testing divisor value:
- If a calculation result field for a report or display overflows, fill it with 999s.
- Unless specifically told not to, always half-adjust when adding together two fields of different precision levels.