Problem:
The following statement has caused a compiler error "Operand TALLY is not declared":
DIVIDE WS-VALUE1 BY WS-VALUE2
GIVING TALLY REMAINDER WS-VALUE3
Resolution:
The TALLY special register is a syntax that is not standard COBOL but is part of IBM Syntax. To use this you need to enable it using either the OSVS or VSC2 compiler directives.
If you use either of these then your program will compile cleanly.