PROC DATASETS generates a Segmentation Violation error when trying to list tables in a Cloud Data Exchange libref with the "defer=yes" option


When using a Cloud Data Exchange (CDE) LIBNAME statement with the DEFER=YES option, you might encounter a segmentation violation or a resource unavailability issue.  When using either PROC DATASETS or PROC DS2, an error message similar to the following might appear in the SAS log:

ERROR: An exception has been encountered. Please contact technical support and provide them with the following traceback information:
The SAS task name is [DATASETS] Segmentation Violation
ENCRYPTED TRACEBACK BEGIN
...
ENCRYPTED TRACEBACK END

or 

ERROR: DS2: Libname <libref>, engine CDE: driver is not available.
ERROR: PROC DS2 initialization failed.

Workaround

When DEFER=YES is specified as an option in the CDE LIBNAME statement, the connection to the data source occurs when a data source table is opened. To work around the issue, do not specify DEFER=YES in the CDE LIBNAME statement. Instead, use the CONNECT TO option in PROC SQL.

You can force the database connection attempt by using the CONNECT TO syntax in PROC SQL. The example below does the following:

  1. Makes the connection.
  2. Executes SQL pass-through statements.
  3. Closes the connection. 

PROC SQL;
    CONNECT TO dbms-name AS myconn (user=your_user password=your_password ...);
      /* ... your SQL Pass-Through statements ... */
    DISCONNECT FROM myconn;
QUIT;