FETCH CHILD

The EXEC CICS FETCH CHILD command is used by a parent task to inquire on the status of a specific child task, and returns the status of the specified child task.

FETCH CHILD

Read syntax diagramSkip visual syntax diagramFETCHCHILD( data-value)CHANNEL( data-area)COMPSTATUS( cvda)ABCODE( data-area)NOSUSPENDTIMEOUT( data-value)

Conditions: INVREQ, NOTFINISHED

This command is threadsafe.

Description

EXEC CICS FETCH CHILD is used by a parent task to inquire on the status of a specific child task, which is identified by the child token. FETCH CHILD will return when the child task is completed.

Options

ABCODE(data-area)
Returns, if the child task terminated abnormally, the 4-character abend code. If an abend has not occurred, the variable is set to blanks.
CHANNEL(data-area)
Returns the 16-character name of the reply channel of the child task identified by CHILD. The name is generated by CICS® and is unique within the scope of the current link level. If the child task does not have a channel to return the response, then this field will contain blanks.

A child channel can only be fetched once, and the fetched channel remains in scope until the link level changes. For more information about channel scope, see The scope of a channel.

CHILD(data-value)
Specifies the child token to fetch the response from. The child token will have been returned from the RUN TRANSID command.
COMPSTATUS(cvda)
Returns a CVDA value indicating the completion status of the child task. CVDA values are:
ABEND
The child task abended.
NORMAL
The child task did not abend.
SECERROR
The child task failed to attach due to a security error. ABCODE is blank.
NOSUSPEND
Specifies that the command will return immediately without waiting for the child task to complete. If the child task is already completed when this command is issued, the command will return with a normal response.
TIMEOUT(data-value)
Specifies a fullword binary data-value which is the maximum time in milliseconds that the command will wait for the requested child to complete before the command returns. The maximum value is 4080000 milliseconds. If TIMEOUT is not specified, or the specified value is zero, the command is not timed out.

Conditions

113 NOTFINISHED
RESP2 values:
52
NOSUSPEND was specified, but the child is not yet complete.
53
The child has not completed within the interval specified by the TIMEOUT option.
16 INVREQ
RESP2 values:
50
The data that is specified in CHILD is not a valid child token, or the child task has already been freed by a FREE CHILD command.
51
The channel of the child has already been fetched.
241
TIMEOUT value is not valid.