GeekInterview.com
Series: Subject: Topic:
Question: 103 of 233

What will happen if we give GOBACK instead of STOPRUN in a cobol program which is not called by some other program?

This question is related to TCS Interview
Asked by: Interview Candidate | Asked on: Dec 8th, 2006
Showing Answers 1 - 7 of 7 Answers
chetan

Answered On : Dec 23rd, 2006

The pgm will go to an infinite loop

  
Login to rate this answer.

The program wont go into aninfinite loop!!!The results are same while using GOBACK or STOP RUN.Except in the first case if there is a calling program control will pass back. The programmer can use any of these 2 commands to end pocessing....

Yes  2 Users have rated as useful.
  
Login to rate this answer.
rs55108

Answered On : Jan 31st, 2009

View all answers by rs55108

If GOBACK is coded instead of STOPRUN in a cobol program which is not called by any other program, nothing wrong will happen. The program will give desired results. Generally 3 things are coded to halt the execution of a program, they are STOP RUNGOBACKEXIT PROGRAMSTOP RUN is frequently used and mainly coded in main programs(calling program). The control will be returned to OS.GOBACK is coded in the mainly in the subroutines or called programs. The control will be returned to the calling program. If STOP RUN is coded in the calling program, the program will go to an infinite execution. GOBACK can be coded in the programs which is not called by any programs instead of STOP RUN.EXIT PROGRAM is seldom used.

  
Login to rate this answer.
rajkumar5m

Answered On : Jul 3rd, 2009

View all answers by rajkumar5m

In case of subprogram, GOBACK or STOPRUN used to terminate the sub program, but when it is used in main progarm it will cause the program to terminate.

  
Login to rate this answer.
balaji_k83

Answered On : Jan 26th, 2010

View all answers by balaji_k83

Stoprun gives back control to OS . Goback will give back control from where the control was achieved. If goback is coded in sub program the control will be passed to main program, if Goback is coded in main program itself then control will be passed to OS. So if goback is coded in a cobol program instead of Stoprun there will be no problem,But if stop run is coded in sub program the program wiil abend.

  
Login to rate this answer.
Kariab

Answered On : Apr 8th, 2010

View all answers by Kariab

Goback ends the processing

  
Login to rate this answer.
87chumma

Answered On : Aug 27th, 2010

View all answers by 87chumma

When the goback is specified in the mainprogram, the control will go back to the runjcl from which step the control came. It will start executing the next step in the JCL if available, the program will continue normally.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.