HI...
I want to know the difference between XCTL and LINK and some examples
WHEN I SHOULD USE THE XCTL AND WHEN I SHOULD USE LINK COMMAND
Difference Between XCTL and LINK
Moderators: DikDude, Natarajan, Moderator Group
-
- Member
- Posts: 10
- Joined: Sun Jul 04, 2010 5:26 pm
Difference Between XCTL and LINK
Anil-Sani
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
-
- Member
- Posts: 10
- Joined: Sun Jul 04, 2010 5:26 pm
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Use LINK to go from one module to another and then return to the first module.
you would link to a module to provide the first some data.
Use XCTL to go from one module without a need to return to the first module.
you would xctl when module-1 has finished its work and another module must continue the process.
you would link to a module to provide the first some data.
Use XCTL to go from one module without a need to return to the first module.
you would xctl when module-1 has finished its work and another module must continue the process.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 1
- Joined: Wed Jan 31, 2018 11:19 pm
- Location: New Delhi
- Contact:
The link is used to call another program and return back to itself.
XCTL is used for Transfer program control
XCTL is used for Transfer program control
Blogger at https://www.onlineinterviewquestions.com/
Here's a simple example.
XCTL:
Suppose you have a CICS main menu inquiry screen that will have 2 options as below; each option will call a separate program. PROG1 will be called when option 1 is chosen, and PROG2 will be called when option 2 is chosen.
TRN1 INQUIRY SCREEN DD/MM/CCYY
HH:MM:SS
(1) PERSONAL DETAILS INQUIRY
(2) ORGANIZATION INQUIRY
SELECT OPTION: __
Since the screen itself is a running program, you may want to use XCTL to invoke the calls to PROG1 or PROG2. The screen program will transfer the control to the called PROG1 or PROG2. It will not wait for PROG1 or PROG2 to complete. We used XCTL so that the screen program may actually end and release the resources back to CICS.
sample code:
IF OPTION = '1'
EXEC CICS XCTL
PROGRAM ('PROG1')
END-EXEC
ELSE
EXEC CICS XCTL
PROGRAM ('PROG2')
END-EXEC
END-IF
LINK:
Suppose PROG1 in the previous example will call a routine program CALC1 that will calculate the individual's statistics or whatever; the data from the CALC1 obviously will be needed by PROG1, then you may want to use LINK call since PROG1 would want to wait for calculated data from CALC1 and it will wait for CALC1 program to complete.
sample code:
EXEC CICS LINK PROGRAM ('CALC1')
COMMAREA(WK-COMMAREA-DATA)
LENGTH(LENGTH OF WK-COMMAREA-DATA)
RESP(WS-EIBRESP)
END-EXEC
XCTL:
Suppose you have a CICS main menu inquiry screen that will have 2 options as below; each option will call a separate program. PROG1 will be called when option 1 is chosen, and PROG2 will be called when option 2 is chosen.
TRN1 INQUIRY SCREEN DD/MM/CCYY
HH:MM:SS
(1) PERSONAL DETAILS INQUIRY
(2) ORGANIZATION INQUIRY
SELECT OPTION: __
Since the screen itself is a running program, you may want to use XCTL to invoke the calls to PROG1 or PROG2. The screen program will transfer the control to the called PROG1 or PROG2. It will not wait for PROG1 or PROG2 to complete. We used XCTL so that the screen program may actually end and release the resources back to CICS.
sample code:
IF OPTION = '1'
EXEC CICS XCTL
PROGRAM ('PROG1')
END-EXEC
ELSE
EXEC CICS XCTL
PROGRAM ('PROG2')
END-EXEC
END-IF
LINK:
Suppose PROG1 in the previous example will call a routine program CALC1 that will calculate the individual's statistics or whatever; the data from the CALC1 obviously will be needed by PROG1, then you may want to use LINK call since PROG1 would want to wait for calculated data from CALC1 and it will wait for CALC1 program to complete.
sample code:
EXEC CICS LINK PROGRAM ('CALC1')
COMMAREA(WK-COMMAREA-DATA)
LENGTH(LENGTH OF WK-COMMAREA-DATA)
RESP(WS-EIBRESP)
END-EXEC
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page