Function
To execute a program in the CICS® region.
Syntax

LINK
>>-LINK -PROGRAM--(--program_name--)--+---------------+--------->
'-,CICS(applid)-'
>--+-------------------------------------------------------------------------------------+-->
'-,COMMAREA(data)-+----------------+-+--------------------+-+-----------------------+-'
'-,LENGTH(value)-' '-,DATALENGTH(value)-' '-,HEXPADCHAR(hex_byte)-'
>--+-----------------------------+-----------------------------><
'-,NOTACTIVE(-+-CONTINUE--+-)-'
'-TERMINATE-'
Description
You can use the LINK command to link to and execute a program in
the target CICS region.
Note that the batch request utility does not link directly
to the requested program. As with all other commands, the LINK command
is passed to a CICS BAC request server, which in turn links to the requested
program. Therefore, the linked-to program runs as part of the same
EXCI mirror transaction that is running the CICS BAC request server.
The PROGRAM parameter is the only required parameter: all the others
are optional.
The data returned from the DPL program is written to the CBKPRINT
data set, up to a maximum of 256 bytes.
Parameters
- CICS(applid)
- Specifies the applid of the CICS region
to which the CICS BAC batch request utility is to send the distributed
program link command. If you omit this option, the command is routed
to the default CICS region specified by the most
recent DEFAULT command.
- COMMAREA(commarea_data)
- Specifies the data to be passed as the communications area to
the DPL program in CICS. The data can be up to a maximum
of 256 bytes, with no restrictions on the contents, except you cannot
have an unmatched parenthesis within the outer parentheses that enclose
the commarea data. For example, COMMAREA(abc(def) is not valid, but
COMMAREA(abc(123)def) is valid.
If you specify a commarea, you can
also specify LENGTH, DATALENGTH, and HEXPADCHAR (see below).
- DATALENGTH(value)
- Specifies the length of the data to be passed in the commarea.
If you omit this option, the length defaults to the length of the
actual data specified on the COMMAREA parameter. Note that:
- The maximum value you can specify is 256 bytes.
- If you specify a value that is greater than the length of the
COMMAREA data field, the commarea data is padded by the character
specified on the HEXPADCHAR option, or by nulls, up the length specified.
- If you specify a value that is less than the actual data length
on the COMMAREA parameter, the CICS BAC batch request utility returns
an error.
You can specify DATALENGTH only if you also specify a COMMAREA
with data.
- HEXPADCHAR(hex_byte)
- Specifies the hexadecimal character that you want to use to
pad the data up to the specified data length, or the maximum number
of characters if data length is not specified. For example, if you
want to pad with spaces, specify HEXPADCHAR(40). If you omit this
option the pad character defaults to a null value.
You can specify
HEXPADCHAR only if you also specify a COMMAREA with data.
- LENGTH(hex_byte)
- Specifies the length of the data to be returned from the CICS application program to the CICS BAC request server. If you omit
this option, the length defaults to the length of the actual data
specified on the COMMAREA parameter. The maximum value you can specify
for return data is 32500.
You can specify LENGTH only if you also
specify a COMMAREA with data.
If you specify a length less than
256 bytes, it also controls the number of bytes written to the CBKPRINT
print data set. If you specify a length greater than 256, only the
first 256 bytes are written to the data set
- NOTACTIVE({CONTINUE | TERMINATE})
- Specifies the action you want the CICS BAC batch request utility
to take if the target CICS region is not available, or if CICS BAC is
not started in the region, as follows:
- CONTINUE
- Specify CONTINUE if you want the CICS BAC batch request utility
to ignore the command and continue processing with the next command
in the input data set.
- TERMINATE
- Specify TERMINATE if you want the CICS BAC batch request utility
to terminate because of the not active condition.
- PROGRAM(progname)
- Specifies the 1-8 character name of the CICS program
to be linked to.