Invoking the ACCESS Procedure

To invoke the ACCESS procedure, you use the options described in Using PROC ACCESS Statement Options and certain procedure statements. The options and statements that you choose are determined by your task.
  • To create an access descriptor, use the following statements:
    PROC ACCESS DBMS=Datacom;
    CREATE libref.member-name.ACCESS;
    database-description statements;
    optional editing statements;
    RUN;
  • To create an access descriptor and a view descriptor in the same procedure, use the following statements:
    PROC ACCESS DBMS=Datacom;
    CREATE libref.member-name.ACCESS;
    database-description statements;
    optional editing statements;
    CREATE libref.member-name.VIEW;
    SELECT item-list;
    optional editing statements;
    RUN;
  • To create a view descriptor from an existing access descriptor, use the following statements:
    PROC ACCESS DBMS=Datacom ACCDESC=libref.access-descriptor;
    CREATE libref.member-name.VIEW;
    SELECT item-list;
    optional editing statements;
    RUN;
  • To update an access descriptor, use the following statements:
    PROC ACCESS DBMS=Datacom;
    UPDATE libref.member-name.ACCESS;
    procedure statements;
    RUN;
  • To update a view descriptor, use the following statements:
    PROC ACCESS DBMS=Datacom;
    UPDATE libref.member-name.VIEW;
    procedure statements;
    RUN;
See ACCESS Procedure Syntax for a listing of database description and editing statements.
Note that when you update an access descriptor (for example, drop another field from the display), the view descriptors based on this access descriptor are not updated automatically. You must re-create or modify any view descriptors that you want to reflect the changes made to the access descriptor. Altering a DBMS table can invalidate both access descriptors and view descriptors.
CAUTION:
Updating access descriptors does not automatically update view descriptors.
When you update an access descriptor (for example, drop another field from the display), the view descriptors based on this access descriptor are not updated automatically. You must re-create or modify any view descriptors that you want to reflect the changes made to the access descriptor. The view descriptors would still be valid, but they would no longer match the access descriptor. However, in some situations the view descriptors would no longer be valid (for example, if you re-create an access descriptor with the same name but base it on a different CA-Datacom/DB table).
CAUTION:
Altering CA-Datacom/DB tables can affect descriptor files.
Altering a CA-Datacom/DB table that has descriptor files defined on it might cause these descriptors to be out-of-date or invalid. For example, if you add a field to a table and an existing access descriptor is defined on that table, the access descriptor does not reflect the new field, but it remains valid. However, if you delete a field or delete a table on which the view descriptor is based, the view descriptor fails when executed. Therefore, you must change the descriptor files manually when changes to CA-DATADICTIONARY invalidate them.
Follow these steps to change the descriptor files manually when changes to CA-DATADICTIONARY invalidate them:
  1. When you change CA-DATADICTIONARY, you must re-create the access descriptor(s) with PROC ACCESS, using the same name(s).
  2. Then you must edit each view descriptor with PROC ACCESS. You get a message if the view descriptor differs from its access descriptor. Change the view descriptor as needed.
The SAS/ACCESS interface view engine does a rudimentary validation of a view descriptor upon opening it. For example, the engine checks the data type information. If a problem is found, the engine writes a message to the log and stops.
For more information about the effects of changing a CA-Datacom/DB table on existing view descriptors, see Information for the Database Administrator.