CICS XCTL

CICS Link Statement CICS Data passing between progs

Advertisements


XCTL is used to call the other programs in CICS environment but it won’t expect the control back to the calling program.

When the XCTL is coded in the program, the calling program will not receive the control back.

Instead of returning the control back, it will return the control to the next upper level.

If no upper level existed, the control will return to the CICS.

If the subprogram modified, then the calling program doesn’t required to be recompile hence XCTL will use the dynamic calling of the sub programs.

Subprograms called using LINK needs PPT entry in CICS region.

In other words, XCTL transfers the control to another program.


Syntax:

EXEC CICS 

  XCTL PROGRAM(prog-name)
       COMMAREA(data-area)
       LENGTH(data-area-length)
       CHANNEL(data-value)
       INPUTMSG(input-msgdata-area)
       INPUTMSGLEN(input-msgdata-value)
  
END-EXEC. 


PROGRAM(prog-name):

Program name is mandatory entry in XCTL command.

Specifies the program name to which the control needs to be passed and from where the control expected back.

Program name is of 8 characters length which includes alphanumeric characters.

Program id and program name should be same in each case.

When the XCTL is executed, the CICS will check the program definition to execute.


COMMAREA(data-area):

COMMAREA is optional entry in XCTL command.

Specifies the communication area that is passing to the called program to process.

Calling program always passes the pointer to the data area to called program.

Subprogram or called program needs to receive it by using COMMAREA declaration in LINKAGE SECTION.


LENGTH(data-area-length):

LENGTH is optional entry in XCTL command.

LENGTH specifies 16-bit binary value which specifies the length of the communication area.

If negative value supplied, ZERO length will be assumed.


CHANNEL(data-value):

CHANNEL is optional entry in XCTL command.

Specifies the channel made available for invoked program or called program or linked program.

Channel name is of 16 characters length which contains alphanumeric characters and special characters.

If 16 characters are not given, the remaining characters at the left most characters will be filled with spaces.


INPUTMSG(input-msgdata-area):

INPUTMSG is optional entry in LINK command.

Specifies the data to be supplied to execute the called program when the it first RECEIVE statement executes.

The data will remain available until the RECEIVE or RETURN statement executes.

INPUTMSG is required when a particular program requires both commarea and message that required for RECEIVE command.


INPUTMSGLEN(input-msgdata-value):

INPUTMSGLEN is optional entry in XCTL command.

INPUTMSGLEN is mandatory when INPUTMSG coded with XCTL Statement.

INPUTMSGLEN is a half word binary value.


Error Conditions:


PGMIDERR:

PGMIDERR occurs in the following conditions.

1. The program has no program definitions entry

2. Program entry disabled.

3. Program loading fails.

4. Program defined as remote.


NOTAUTH:

NOTAUTH occurs in the following conditions.

Resource security check fails on the program name


CICS Link Statement CICS Data passing between progs

Advertisements