# Examples

The section provides the examples related to the Substation ES commands.

## Example 1

The following example shows how to send multiple Substation ES commands to a Substation ES running system.

The following example issues Substation ES commands, refreshes a recipe, waits for five seconds, disconnects the CICS Interface from the CICS region, and waits for 10 seconds. It then repeats the reconnect of the Substation ES CICS Interface to the CICS region three times, waiting for two seconds between each occurrence.

    USER TIBCO
    PSWD password
    DEST-SEND-DEFAULT tibss.admin.sxs.request
    FLD STR,SXS-COMMAND,"REFR,RID=Admin-Recipe"
    WAIT 5
    END
    DEST-SEND-DEFAULT tibss.admin.sxs.request
    FLD STR,SXS-COMMAND,"DISCONN,INTF=IICICS"
    WAIT 10
    END
    REPEAT 3
    WAIT-ON-REPEAT 2
    DEST-SEND-DEFAULT tibss.admin.sxs.request
    FLD STR,SXS-COMMAND,"CONN,INTF=IICICS"
    END
    /*

## Example 2

The following examples show how to send Substation ES commands to different Substation systems.

- Send a show counters command for Substation ID `SS4TEST`:

      USER TIBCO
      PSWD password
      DEST-SEND-DEFAULT tibss.admin.sxs.request
      FLD PROP,tibss-ss-id,"SS4TEST"
      FLD STR,SXS-COMMAND,"SHOW,COUNTERS"
      END
      /*

- Send a show active listeners command for Substation ID `SS4PROD`:

      USER TIBCO
      PSWD password
      DEST-SEND-DEFAULT tibss.admin.sxs.request
      FLD PROP,tibss-ss-id,"SS4PROD"
      FLD STR,SXS-COMMAND,"SHOW,ACT,LSNS"
      END
      /*

## Example 3

When issuing IMS operational commands, display the IMS OTMA status:

    USER TIBCO
    PSWD password
    DBG OFF
    DEST-SEND tibss.admin.sxi           *Issue IMS authorised command*
    FLD STR,SXS-COMMAND,"/DIS OTMA"
    END
    /*

## Example 4

Send a simple message to a listening application:

    DEST-SEND tibss.test.msg
    FLD STR,F1-String,"General custom message"
    FLD U32,Field-U32-Name,1234
    END
    /*

Copyright © TIBCO Software Inc. All rights reserved.