Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What will happen if we dont code STOP RUN ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Poha Eater

New User


Joined: 31 Aug 2016
Posts: 31
Location: India

PostPosted: Mon Jun 04, 2018 5:27 pm    Post subject: What will happen if we dont code STOP RUN ?
Reply with quote

Hi All,

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.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8344
Location: Dubuque, Iowa, USA

PostPosted: Mon Jun 04, 2018 5:59 pm    Post subject:
Reply with quote

The Enterprise COBOL Language Reference manual for version 5.1 on page 337 says
Quote:
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.
Back to top
View user's profile Send private message
Poha Eater

New User


Joined: 31 Aug 2016
Posts: 31
Location: India

PostPosted: Mon Jun 04, 2018 9:40 pm    Post subject:
Reply with quote

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 ?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2020
Location: UK

PostPosted: Mon Jun 04, 2018 9:44 pm    Post subject: Reply to: What will happen if we dont code STOP RUN ?
Reply with quote

A program cannot terminate until it runs. It cannot run until it is compiled. What is confusing you? Why have you not tried a simple test?
Back to top
View user's profile Send private message
trudeaun

New User


Joined: 15 May 2018
Posts: 1
Location: Canada

PostPosted: Mon Jun 04, 2018 10:23 pm    Post subject: Reply to: What will happen if we dont code STOP RUN ?
Reply with quote

You will get an error:

Code:
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
         2680B148.


- 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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to set Return code when Time Out ... vinu78 JCL & VSAM 6 Wed May 30, 2018 11:27 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts RESP2 code -502 pshongal CICS 6 Mon May 28, 2018 10:58 am
No new posts Code Coverage and static analysis too... Aditya.Srivastava PL/I & Assembler 2 Fri May 25, 2018 12:48 pm
No new posts DB2 Sql Error code -204 rohit_naidu DB2 5 Fri May 18, 2018 4:40 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us