CICS logical level importance?



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

CICS logical level importance?

Postby tivrfoa » Wed Jan 18, 2017 12:29 am

Hi,

I understand that the logical level is important when using EXEC CICS RETURN instead of GOBACK,
https://www.ibm.com/support/knowledgece ... fhp3p9.htm

but why would I want to create a lower logical level?

Why would I call a subprogram that uses commarea, using EXEC CICS LINK instead of CALL?

Probably in > 90% of the time subprograms want to return to the caller, so why not simply use GOBACK and don't care about how they were called?
Are there other differences if using EXEC CICS RETURN beyond the flow?

Did you have any situation that you needed to use EXEC CICS RETURN instead of GOBACK?

Thank you very much!!!
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: CICS logical level importance?

Postby Robert Sample » Wed Jan 18, 2017 2:09 am

If you study this diagram carefully http://www.ibm.com/support/knowledgecenter/SSGMCP_4.2.0/com.ibm.cics.ts.applicationprogramming.doc/topics/dfhp3_cobol_subprog_flow.html, I believe many of your questions will be answered. As the diagram shows (look at program V for example), GOBACK and EXEC CICS RETURN behavior depends upon the invocation method -- CALL or EXEC CICS LINK (or EXEC CICS XCTL to some extent). One reason to use EXEC CICS LINK is if you use CEDF to debug the transaction, CEDF will stop at EXEC CICS LINK statements whereas it will NOT stop for CALL statements. Logical levels can be very important in CICS since a statement such as GOBACK may return to the same level program or a higher level program. If you have 20 or 30 programs at 3 or 4 or more logical levels being invoked by a transaction, with EXEC CICS LINK, EXEC CICS XCTL, and CALL statements in different programs you could easily find yourself in a program you don't expect to be in when you use GOBACK or EXEC CICS RETURN.

These users thanked the author Robert Sample for the post:
tivrfoa (Wed Jan 18, 2017 3:03 pm)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: CICS logical level importance?

Postby tivrfoa » Wed Jan 18, 2017 10:36 pm

Thanks a lot Robert.

Could someone share a use case (real world example) that you needed to use EXEC CICS RETURN instead of GOBACK?

I can't see when a subroutine would not want to return to the caller.
tivrfoa
 
Posts: 84
Joined: Wed Aug 22, 2012 6:35 pm
Has thanked: 60 times
Been thanked: 0 time

Re: CICS logical level importance?

Postby Robert Sample » Wed Jan 18, 2017 10:45 pm

I'm not sure you understand -- EXEC CICS LINK and CALL are used for subprograms; however, EXEC CICS XCTL is used for a same-level change of program. The new program is NOT a subprogram, and may in fact be invoked from other programs. When XCTL is used (and it is used often), EXEC CICS RETURN goes back to the previous level, not to the program that invoked the XCTLed program.

A real-world example: at a previous employer, medical exam data was stored in a hierarchical data base. Since there could be multiple types of records (lab, blood results, etc) stored for a single exam, XCTL was used to go to the correct program to display that type of data for that exam (which often required using paging). When the listing was done, no matter which program was being executed at the time, EXEC CICS RETURN would go back to the exam selection screen.

These users thanked the author Robert Sample for the post:
tivrfoa (Wed Jan 18, 2017 11:48 pm)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post