Execute a CICS business transaction services activity synchronously
without context-switching.

LINK ACTIVITY
>>-LINK--+-ACTIVITY(data-value)-+--+------------------------+--><
'-ACQACTIVITY----------' '-INPUTEVENT(data-value)-'
Conditions: ACTIVITYBUSY, ACTIVITYERR, EVENTERR, INVREQ, IOERR,
LOCKED, NOTAUTH, PGMIDERR
Description
LINK ACTIVITY executes a CICS business
transaction services activity synchronously with the requestor, with no context-switching.
The activity must previously have been defined to BTS.
LINK ACTIVITY
causes BTS to invoke the activity and send it an input event. If the activity
is in its initial state—that is, if this is the first time it is to be run,
or if it has been reset by a RESET ACTIVITY command—CICS® sends it the DFHINITIAL system event.
If the activity is not in its initial state, the input event must be specified
on the INPUTEVENT option.
The only activities a program can link to
are as follows:
- If it is running as the activation of an activity, its own child activities.
It can link to several of its child activities within the same unit of work.
- The activity it has acquired, by means of an ACQUIRE ACTIVITYID command,
in the current unit of work. (Note, however, that if the program is running
as the activation of an activity, it must use a RUN, not a LINK, command to
activate the activity it has acquired.)
To check the response from the activity, the CHECK ACTIVITY command
must be used. This is because the response to the request to activate the
activity does not contain any information about the success or failure of
the activity itself—only about the success or failure of the request to activate
it. Typically, the CHECK command is issued immediately after the LINK command.
No context-switching
When
an activity is activated by a LINK ACTIVITY command, it is invoked synchronously
with the requestor and:
- In the same unit of work as the requestor
- With the transaction attributes (TRANSID and USERID) of the requesting
transaction.
In other words, there is no context-switch. To invoke
an activity synchronously with context-switching—that is, in a separate
UOW from that of the requesting transaction and with the TRANSID and USERID
attributes specified on its DEFINE ACTIVITY command—use the RUN ACTIVITY SYNCHRONOUS
command.
Note: A context-switch always occurs when an activity is run
asynchronously.
If performance is more important than failure isolation,
recoverability, and security, use LINK ACTIVITY rather than RUN ACTIVITY SYNCHRONOUS.
Options
- ACQACTIVITY
- specifies
that the activity to be run is the one that the current unit of work has acquired
by means of an ACQUIRE ACTIVITYID command.
- ACTIVITY(data-value)
- specifies
the name (1–16 characters) of the activity to be run. The name must be that
of a child of the current activity.
- INPUTEVENT(data-value)
- specifies
the name (1–16 characters) of the event that causes the activity to be attached.
You must not specify this option if the activity is in its initial
state; that is, if this is the first time it is to be run, or if it has been
reset by a RESET ACTIVITY command. In this case, CICS sends the activity the
DFHINITIAL system event.
You must specify this option if the
activity is not in its initial state; that is, if it has been activated before,
and has not been reset by a RESET ACTIVITY command.
If you specify
INPUTEVENT, for the LINK command to be successful the activity to be attached
must have defined the named event as an input event.
Conditions
- ACTIVITYBUSY
- RESP2
values:
- 19
- The request timed out. It may be that another task using this activity-record
has been prevented from ending.
- ACTIVITYERR
- RESP2
values:
- 8
- The activity named on the ACTIVITY option could not be found.
- 14
- The target activity is not in the correct mode to process the specified
event option. If the INPUTEVENT option was not specified, the activity must
be in INITIAL mode. If the INPUTEVENT option was specified, the activity
must be in DORMANT mode.
- EVENTERR
- RESP2
values:
- 7
- The event named on the INPUTEVENT option has not been defined by the activity
to be run as an input event; or its fire status is FIRED.
- INVREQ
- RESP2
values:
- 4
- The ACTIVITY option was used to name a child activity, but the command
was issued outside the scope of a currently-active activity.
- 21
- The activity is suspended, and therefore cannot be run synchronously.
- 24
- The ACQACTIVITY option was used, but the issuing task has not acquired
an activity.
- 40
- The program that implements the activity is remote.
- 44
- A LINK has been attempted to a Java program, but the JVM pool is disabled.
- 45
- A LINK has been attempted to a Java program, but the JVM profile cannot
be found.
- 46
- A LINK has been attempted to a Java program, but the JVM profile is not
valid.
- 47
- A LINK has been attempted to a Java program, but the system properties
file cannot be found.
- 48
- A LINK has been attempted to a Java program, but the user class cannot
be found.
- 49
- The shared class cache is STOPPED and autostart is disabled, so a Java
program requesting use of the shared class cache cannot be executed.
- IOERR
- RESP2
values:
- 29
- The repository file is unavailable.
- 30
- An input/output error has occurred on the repository file.
- LOCKED
- The
request cannot be performed because a retained lock exists against the relevant
record on the repository file.
- NOTAUTH
- RESP2
values:
- 101
- The user associated with the issuing task is not authorized to run the
activity.
- PGMIDERR
- RESP2
values:
- 1
- A program has no entry in the PPT and either program autoinstall was switched
off, or the program autoinstall user program indicated that the program should
not be autoinstalled.
- 2
- A program is disabled.
- 3
- A program could not be loaded because:
- This was the first load of the program and the program load failed, usually
because the load module could not be found.
- This was a subsequent load of the program, but the first load failed.
In order to reset the load status the load module must be in the
DFHRPL concatenation, and a SET PROGRAM NEWCOPY will be required.
- 21
- The program autoinstall user program failed either because the program
autoinstall user program is incorrect, incorrectly defined, or as a result
of an abend in the program autoinstall user program. Program autoinstall is
disabled and message DFHPG0202 or DFHPG0203 written to the CSPL.
- 22
- The model returned by the program autoinstall user program was not defined
in the PPT table, or was not enabled.
- 23
- The program autoinstall user program returned invalid data.
- 24
- Define for the program failed due to autoinstall returning an invalid
program name or definition.