What is the difference between GOBACK and RETURN in CICS?

Customer Information Control System. Middleware and MQ Series.
Post Reply
Karthik G
New Member
Posts: 6
Joined: Wed Sep 03, 2014 4:37 pm

What is the difference between GOBACK and RETURN in CICS?

Post 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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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.
Karthik G
New Member
Posts: 6
Joined: Wed Sep 03, 2014 4:37 pm

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

Post by Karthik G »

Thanks. Yes, I was askig about that. Is that the only difference?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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.
Karthik G
New Member
Posts: 6
Joined: Wed Sep 03, 2014 4:37 pm

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

Post 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??
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

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

Post 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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “CICS, Middleware and MQ Series.”