> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/mainframe/connect-session-1.md).

# Connect Session

This is pre-built Action located under the **Mainframe List Element**. The functionality of this action in Avo Assure is to connect to a currently open host session using the provided session ID. This allows the script to perform operations or validations on the connected session.

## **Syntax**

**Input Value**: `<ShortSessionID>` or `<host name;portID;LU_name>`

| Argument                                  | Description                                                                                                                                               |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<ShortSessionID></p><p>(Required)</p> | Specify the unique ID of the open host session to connect.                                                                                                |
| <p>\<host name><br>(Required)</p>         | Provide the network address of the mainframe server that the automation script connects to.                                                               |
| <p>\<portID><br>(Required)</p>            | Provide the communication port used to establish the session with the mainframe.                                                                          |
| <p>\<LU\_name><br>(Required)</p>          | Provide Logical Unit name which is a unique session/terminal identifier used to connect automation scripts to a specific mainframe session for execution. |

**Output Value**: `<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)`

| Argument                                                     | Description                                                     |
| ------------------------------------------------------------ | --------------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable> (Optional) | This dynamic variable holds the result as **True** or **False** |

### Example 1: Connecting to a Specific Mainframe Session Using Session ID

In this example, we show how to connect to a specific mainframe session using a session ID.

* **Action**: Connect Session
* **Input Value**: 23.229.8.213
  * The value (23.229.8.213) specifies the short session ID of the mainframe session to connect to.
* **Output Value**: {Status}\
  The operation status is stored in this dynamic variable with the following possible values:
  * **True**: If the connection to the specified session is established successfully.
  * **False**: If the connection to the specified session cannot be established.
* **Logical Explanation**: The **Connect Session** action fetches the value from the **Input Value** column (**23.229.8.213**) and attempts to establish a connection to the specified mainframe session using the provided short session ID. The result of the operation is stored in the **{Status}** variable as True if the connection is established successfully.

<figure><img src="/files/6WuQ6R3SrwzNelpJ2RZb" alt=""><figcaption></figcaption></figure>

### Example 2: Connecting to a T3270 Session Using Host name, Port ID and Logical Unit Name

In this example, we show how to connect to a specific mainframe session using the host name, port ID, and Logical Unit name.

* **Action**: Connect Session
* **Input Value**: Avo151;Avo151;LUD01
  * The first argument (**Avo151**) specifies the host name.
  * The second argument (**Avo151**) specifies the port ID.
  * The third argument (**LUD01**) specifies the LU\_name(Logical Unit).
* **Output Value**: {Status}\
  The operation status is stored in this dynamic variable with the following possible values:
  * **True**: If the connection to the specified session is established successfully.
  * **False**: If the connection to the specified session cannot be established.
* **Logical Explanation**: The **Connect Session** action fetches the values from the **Input Value** column (**Avo151;Avo151;LUD01**) and attempts to establish a connection to the specified mainframe session using the provided port ID, hostname, and Logical Unit. The result of the operation is stored in the **{Status}** variable as True if the connection is established successfully.

<figure><img src="/files/hr2Ct8gAlNJzZjDeDWmN" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/mainframe/connect-session-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
