About SAS/ACCESS Software |
The ACCESS procedure enables you to create access descriptors, which are SAS files of member type ACCESS. They describe data that is stored in a DBMS in a format that SAS can understand. Access descriptors enable you to create SAS/ACCESS views, called view descriptors. View descriptors are files of member type VIEW that function in the same way as SAS views that are created with PROC SQL, as described in Embedding a SAS/ACCESS LIBNAME Statement in a PROC SQL View and SQL Procedure Pass-Through Facility.
Note: If a dynamic LIBNAME engine is available for your DBMS, it is recommended that you use the SAS/ACCESS LIBNAME statement to access your DBMS data instead of access descriptors and view descriptors; however, descriptors continue to work in SAS software if they were available for your DBMS in Version 6. Some new SAS features, such as long variable names, are not supported when you use descriptors.
The following example creates an access descriptor and a view descriptor in the same PROC step to retrieve data from a DB2 table:
libname adlib 'SAS-library'; libname vlib 'SAS -library'; proc access dbms=db2; create adlib.order.access; table=sasdemo.orders; assign=no; list all; create vlib.custord.view; select ordernum stocknum shipto; format ordernum 5. stocknum 4.; run; proc print data=vlib.custord; run;
When you want to use access descriptors and view descriptors, both types of descriptors must be created before you can retrieve your DBMS data. The first step, creating the access descriptor, enables SAS to store information about the specific DBMS table that you want to query.
After you have created the access descriptor, the second step is to create one or more view descriptors to retrieve some or all of the DBMS data described by the access descriptor. In the view descriptor, you select variables and apply formats to manipulate the data for viewing, printing, or storing in SAS. You use only the view descriptors, and not the access descriptors, in your SAS programs.
The interface view engine enables you to reference your SAS view with a two-level SAS name in a DATA or PROC step, such as the PROC PRINT step in the example.
See SAS Views for more information about SAS views. See the SAS/ACCESS documentation for your DBMS for more detailed information about creating and using access descriptors and SAS/ACCESS views.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.