When you use a view descriptor
in a DATA step or procedure to read DBMS data, the
SAS/ACCESS interface
view engine requests the DBMS to execute an SQL SELECT statement.
The interface view engine follows these steps.
-
Using the connection
information that is contained in the created view descriptor, the
SAS/ACCESS interface calls the DBMS to connect to the database.
-
SAS constructs a SELECT
statement that is based on the information stored in the view descriptor
(table name and selected columns and their characteristics) and passes
this information to the DBMS.
-
SAS retrieves the data
from the DBMS table and passes it back to the SAS procedures as if
it were observations in a SAS data set.
-
SAS closes the connection
with the DBMS.
For example, if you
run the following SAS program using a view descriptor, the previous
steps are executed once for the PRINT procedure and a second time
for the GCHART procedure. (The data used for the two procedures is
not necessarily the same because the table might have been updated
by another user between procedure executions.)
proc print data=vlib.allemp;
run;
proc gchart data=vlib.allemp;
vbar jobcode;
run;