There is one stand alone program (no sub modules are being called) and in which instead of STOP RUN or GO BACK only EXIT is coded. What will happen in this scenario, Will it give compile-time error due to no STOP RUN in the procedure division or it will terminate without any error or there will be some other implications.
I would have tested it on my own but due to unavailability of Mainframe not able to test it. Please help me if anyone have faced this.
Joined: 06 Jun 2008 Posts: 8410 Location: Dubuque, Iowa, USA
The Enterprise COBOL Language Reference manual for version 5.1 on page 337 says
When there is no next executable statement in a called program, an implicit EXIT PROGRAM statement is executed.
There may be a compile problem with not having STOP RUN or whatever coded, but the program will terminate. Note that EXIT and EXIT PROGRAM are totally different statements and are listed separately in the Language Reference manual.
Thank you Robert for quick response. I have a question from your reply and it may sound naive to you but i want to clear my doubt that when you say "but the program will terminate", does it means that program will terminate because of compile time error or compiler will issue some warning only but the program will terminate without any error ?
IGZ0037S The flow of control in program CR proceeded beyond the last line of the program.
From compile unit CR at entry point CR at compile unit offset +000002E8 at entry offset +000002E8 at address
- Nicole Trudeau, IBM Compilers Digital Customer Support
The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.