I heard that generally one must avoid GO TO statement in COBOL and even if it is applied it must be applied only in forward direction that is preferably to the exit paragraph of the module. Is this true? If so why is it so?
Printable View
I heard that generally one must avoid GO TO statement in COBOL and even if it is applied it must be applied only in forward direction that is preferably to the exit paragraph of the module. Is this true? If so why is it so?
Yes what you have heard is true. This is because GOTO is a unconditional programming language and in fact not only for cobol for any language say for C also the goto statements should be used to a minimum to have a good programming structure. The additional restriction in cobol is it must be applied only in forward direction.