IF AGE > 20 AND AGE < 60 THEN
Move 'Valid Data' TO WS-OUT-TEXT
Move 'Invalid Data' TO WS-OUT-TEXT
DISPLAY 'STILL IN THE ELSE LOOP'
And in the Copybook, I have following piece of Code. I have not used any Scope terminator in the copybook.
DISPLAY 'In PRINTEMP copybook'
My Question is whether the display 'STILL IN THE ELSE LOOP' statement will get executed.
If so, How the compiler is interpreting the Scope terminator which I have given after COPYBOOK ?
Please help me if you have any idea.
Many shops have development standards that also may specify the use of copybooks. I think most standards advice against using copybooks for bringing in code. If the logic should be reuseable globally, put it in a separate submodule.
If your site endorse using copybooks for code, they (your development support) should already know the answer to your question
If the copied statements is some standard execution, it could be made part of a standard template for a Cobol module.