> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SAS Viya

> This page outlines the steps to install and configure the Connect AI connector for SAS Viya. After installation, SAS Viya can pull data from sources that you have connected to your Connect AI account.

## Prerequisites

Before you can configure and use SAS Viya with Connect AI, you must first connect a data source to your Connect AI account. See [Sources](/ja/Sources) for more information.

You must also generate a Personal Access Token (PAT) on the [Settings](/ja/Settings#personal-access-tokens) page. Copy this down, as it acts as your password during authentication.

## Connect to Connect AI

To establish a connection from SAS Viya to Connect AI through the JDBC driver, follow these steps.

<Steps>
  <Step>
    Download and install the Connect AI JDBC driver.

    a. Open the **Integrations** page of Connect AI.

    b. In the **Dev Tools** section, click **JDBC**.

    c. Download and run the setup file.

    d. When the installation is complete, the JAR file can be found in the installation directory.
  </Step>

  <Step>
    Log in to SAS Viya.
  </Step>

  <Step>
    Click on the navigation button on the upper left.
  </Step>

  <Step>
    Click **Develop Code and Flows**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_01.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=342870d5c7282f4cc0cb0cfaa6d2152a" alt="SAS Visual Analytics Client 01" width="1420" height="605" data-path="ja/images/sas_visual_analytics_client_01.png" />
    </Frame>
  </Step>

  <Step>
    Upload the Connect AI JDBC JAR file.

    * Right click on a directory.
    * Click on **Upload Files**.
    * Choose the Connect AI JDBC JAR file.
  </Step>

  <Step>
    Place the JAR file of the Connect AI JDBC driver in any directory and note its file path.

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_02.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=84be6289ea9e8b31f81a300e6ead6e92" alt="SAS Visual Analytics Client 02" width="1427" height="655" data-path="ja/images/sas_visual_analytics_client_02.png" />
    </Frame>
  </Step>

  <Step>
    Click on the **Libraries** icon in the left vertical navigation bar.
  </Step>

  <Step>
    Click on the connection symbol in the top left under **Libraries** to create a new library for the JDBC connection.

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_03.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=4814425d6effe7796636feb5ed101eea" alt="SAS Visual Analytics Client 03" width="1424" height="598" data-path="ja/images/sas_visual_analytics_client_03.png" />
    </Frame>
  </Step>

  <Step>
    Enter the library connection settings.

    * **Connection name**—enter a name for your connection
    * **Library name (libref)**—enter a reference for your library
    * **Library type**—choose **SAS/ACCESS to JDBC**

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_04.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=a017ec14b909fbdee47312d68c6876e8" alt="SAS Visual Analytics Client 04" width="619" height="542" data-path="ja/images/sas_visual_analytics_client_04.png" />
    </Frame>
  </Step>

  <Step>
    Click the **Properties** tab and set **Library attributes** to **READONLY**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_05.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=65eca9d300886b6ea65741e69b2c1a68" alt="SAS Visual Analytics Client 05" width="578" height="442" data-path="ja/images/sas_visual_analytics_client_05.png" />
    </Frame>
  </Step>

  <Step>
    Click the **Connection Options** tab and enter the following details.

    * **Hive JDBC driver's class name**—enter *cdata.jdbc.connect.ConnectDriver*
    * **Java CLASSPATH**—enter the file path to the JAR driver file

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_06.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=116f2409fb928c7b7687d3a460669fdb" alt="SAS Visual Analytics Client 06" width="578" height="404" data-path="ja/images/sas_visual_analytics_client_06.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_07.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=b1e6d532eb9c5c2d659f9b3376d990d1" alt="SAS Visual Analytics Client 07" width="544" height="172" data-path="ja/images/sas_visual_analytics_client_07.png" />
    </Frame>
  </Step>

  <Step>
    Click on **Test connection**. If it succeeds, click **Save and connect**.
  </Step>

  <Step>
    Click the "+" to add a new tab and select **SAS program**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/sas_visual_analytics_client_08.png?fit=max&auto=format&n=6pGFG61-t-b5cPZl&q=85&s=c5bddc9cbcb426b4e7c9084d6fc01d1d" alt="SAS Visual Analytics Client 08" width="746" height="414" data-path="ja/images/sas_visual_analytics_client_08.png" />
    </Frame>
  </Step>

  <Step>
    Fill in the code block below with your setup parameters.

    * **Libref**—enter the library reference you defined in Step 9.
    * **ClassPath**—enter the file path to the JAR driver file.
    * **Username**—Connect AI のユーザー名を入力します。ユーザー名は、Connect AI の画面の右上に表示されています。例：*[test@cdata.co.jp](mailto:test@cdata.co.jp)*
    * **DefaultCatalog**—enter the connection configured in Connect AI that you want to query.
    * **Password**—[Settings](/ja/Settings#personal-access-tokens) ページで生成したPAT を入力します。
  </Step>

  <Step>
    Click **Run**. You can see the data load from Connect AI into SAS Viya.
  </Step>
</Steps>

```bash theme={null}
libname [Libref] JDBC  
classpath=[ClassPath] 
class="cdata.jdbc.connect.ConnectDriver"    
URL="jdbc:Connect:AuthScheme=Basic;User=[Username];DefaultCatalog=[DefaultCatalog];DefaultSchema=dbo;Password=[Password]";
proc sql;
SELECT * FROM [Libref].MyTable;
quit;
```
