ACCESS Procedure Specifics for Sybase

Overview

For general information about this feature, see ACCESS Procedure. A Sybase example is available.
SAS/ACCESS for Sybase supports all ACCESS procedure statements. Here are the ACCESS Procedure specifics for Sybase.
  • The DBMS= value for PROC ACCESS is SYBASE.
  • The database-description-statements that PROC ACCESS uses are identical to the database-connection-arguments in the CONNECT statement for the SQL pass-through facility.
  • Here is the TABLE= statement for PROC ACCESS.
    TABLE= <'>table-name<'>;
    specifies the name of the Sybase table or Sybase view on which the access descriptor is based.

Example

The following example creates access descriptors and view descriptors for the EMPLOYEES and INVOICE tables. These tables have different owners and are stored in PERSONNEL and INVENTORY databases that reside on different machines. The USER= and PASSWORD= statements identify the owners of the Sybase tables and their passwords.
libname vlib 'sas-library';

proc access dbms=sybase;
   create work.employee.access;
      server='server1';
      database='personnel';
      user='testuser1';
      password='testpass1';
      table=EMPLOYEES;
   create vlib.emp_acc.view;
      select all;
      format empid 6.;
      subset where DEPT like 'ACC%';
run;

proc access dbms=sybase;
   create work.invoice.access;
      server='server2';
      database='inventory';
      user='testuser2';
      password='testpass2';
      table=INVOICE;
      rename invoicenum=invnum;
      format invoicenum 6. billedon date9.
        paidon date9.;
   create vlib.sainv.view;
      select all;
      subset where COUNTRY in ('Argentina','Brazil');
run;

options linesize=120;
title 'South American Invoices and
        Who Submitted Them';

proc sql;
   select invnum, country, billedon, paidon,
          billedby, lastname, firstnam
      from vlib.emp_acc, vlib.sainv
      where emp_acc.empid=sainv.billedby;
Sybase is a case-sensitive database. The PROC ACCESS database identification statements and the Sybase column names in all statements except SUBSET are converted to uppercase unless the names are enclosed in quotation marks. The SUBSET statements are passed to Sybase exactly as you enter them, so you must use the correct case for the Sybase column names.