Page 1 of 1

What is the difference between GOBACK and RETURN in CICS?

Posted: Mon May 18, 2015 6:07 pm
by Karthik G
Hi,

I am new to CICS and I find GOBACK and return very similar in their function... but I think there must be some difference as they are two differnt verbs. Could you please tell me the Difference between GOBACK and RETURN? It will be a great help.

Re: What is the difference between GOBACK and RETURN in CICS

Posted: Mon May 18, 2015 10:55 pm
by Robert Sample
Are you talking about the COBOL GOBACK statement compared to the EXEC CICS RETURN statement? The first, and most obvious, difference is that GOBACK is a COBOL verb while EXEC CICS RETURN is part of the CICS API.

Re: What is the difference between GOBACK and RETURN in CICS

Posted: Tue May 26, 2015 6:01 pm
by Karthik G
Thanks. Yes, I was askig about that. Is that the only difference?

Re: What is the difference between GOBACK and RETURN in CICS

Posted: Tue May 26, 2015 10:47 pm
by Robert Sample
There are differences between GOBACK and EXEC CICS RETURN. For example, if you use a COBOL CALL verb to invoke a subprogram (instead of EXEC CICS LINK), an EXEC CICS RETURN in the subprogram will end the calling program while GOBACK returns to the calling program. Discussing GOBACK and EXEC CICS RETURN requires discussion of the method used to invoke the subprogram since the behavior will vary depending upon how the invocation was done.

Re: What is the difference between GOBACK and RETURN in CICS

Posted: Thu Jun 04, 2015 8:46 pm
by Karthik G
Thanks.
if you use a COBOL CALL verb to invoke a subprogram, an EXEC CICS RETURN in the subprogram will end the calling program while GOBACK returns to the calling program.
"an EXEC CICS RETURN in the subprogram will end the calling program", will it end the called program or the calling program itself??

Re: What is the difference between GOBACK and RETURN in CICS

Posted: Thu Jun 04, 2015 11:27 pm
by Robert Sample
If you used a COBOL CALL statement instead of EXEC CICS LINK, as far as CICS is concerned the subprogram and the calling program are the same -- hence EXEC CICIS RETURN will end the CALLING program as well as the called program.