# Substation ES Trigger Flow

The section describes the trigger flow of Substation ES.

The following figure illustrates the trigger flow.

Trigger Flow
As shown in the Trigger Flow figure , you use standard CICS calls and facilities for HVT. The process proceeds as follows:

1. A user program sets fields in the copybook or structure to inform `SXCQWRIT` of what and where the information is to which it is sent. The fields to populate are normally the type of a record, the data length, and the data; or an address of the data.
   - The data can also be located in TSQ. Just specify a TSQ name, which can be made MRO capable.
   - The data can also be in a CICS container, which can be made MRO capable.
2. The user program calls `SXCQWRIT` or `SXCQWTSQ` with `EXEC CICS LINK`.
3. `SXCQWRIT` adds data to TDQ and `SXCQWTSQ` adds data to TSQ known to Substation ES.
4. Information passed back to the user program contains a return code, a reason code, and the name of the TDQ or TSQ to which the program wrote. Always examine the return code.
   Note: If the return code is nonzero, check the rollback field. If this indicator is `Y`, you must perform a rollback because partial records might have been written to TDQ, causing unpredictable results. Links using TSQ cannot be rolled back.

Copyright © TIBCO Software Inc. All rights reserved.