SAS Viya


SAS Viya


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

Prerequisites

Before you can configure and use SAS Viya with CData Connect Cloud, you must first connect a data source to your CData Connect Cloud account. See Connections for more information.

You must also generate a Personal Access Token (PAT) on the Settings page. Copy this down, as it acts as your password during authentication.

Connecting to CData Connect Cloud

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

  1. Download and install the CData Connect Cloud JDBC driver.
    1. Open the Client Tools page of CData Connect Cloud.
    2. In the Dev Tools section, click JDBC.
    3. Download and run the setup file.
    4. When the installation is complete, the JAR file can be found in the installation directory.
  2. Log in to SAS Viya.

  3. Click on the navigation button on the upper left.

  4. Click Develop Code and Flows.

  5. Upload the CData Connect Cloud JDBC JAR file.

    • Right click on a directory.
    • Click on Upload Files.
    • Choose the CData Connect Cloud JDBC JAR file.
  6. Place the JAR file of the CData Connect Cloud JDBC driver in any directory and note its file path.

  7. Click on the Libraries icon in the left vertical navigation bar.

  8. Click on the connection symbol in the top left under Libraries to create a new library for the JDBC connection.

  9. 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

  10. Click the Properties tab and set Library attributes to READONLY.

  11. 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

  12. Click on Test connection. If it succeeds, click Save and connect.

  13. Click the “+” to add a new tab and select SAS program.

  14. 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—CData Connect Cloud のユーザー名を入力します。ユーザー名は、CData Connect Cloud の画面の右上に表示されています。例:test@cdata.co.jp
    • DefaultCatalog—enter the connection configured in CData Connect Cloud that you want to query.
    • PasswordSettings ページで生成したPAT を入力します。
    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;
    
  15. Click Run. You can see the data load from CData Connect Cloud into SAS Viya.