Chapter Contents

Previous

Next
SAS/ACCESS Interface to CA-DATACOM/DB: Reference

How the SAS/ACCESS Interface to CA-DATACOM/DB Works

When you use the ACCESS procedure to create an access descriptor file, the SAS System calls CA-DATADICTIONARY to get a description of the database. When you create a view descriptor file, the SAS System has information about the database in the access descriptor, so it does not call CA-DATADICTIONARY.

The ACCESS procedure writes the descriptor files to a SAS data library. Then, when you use a SAS procedure with a view descriptor whose data are in a CA-DATACOM/DB table, the SAS System Supervisor calls the interface view engine to access the data. The engine can access a CA-DATACOM/DB table for reading, updating, inserting, and deleting. The interface view engine accesses CA-DATADICTIONARY to validate the view descriptor.

When you update either an access descriptor or a view descriptor, the SAS System does not call CA-DATACOM/DB or CA-DATADICTIONARY.

Note:   Data records in a CA-DATACOM/DB table cannot be accessed by number. That is, in SAS terms, a CA-DATACOM/DB record is not addressable by row number. Therefore, various SAS procedures behave differently when accessing a CA-DATACOM/DB table than they do when accessing a SAS data file. For example,

  [cautionend]


How the CA-DATACOM/DB Interface View Engine Works

The interface view engine is an application program that retrieves and updates data in a CA-DATACOM/DB table. Calls are in one of the following categories:

In all situations, the interface view engine initiates and terminates communication between the engine and CA-DATACOM/DB. Each time a different SAS procedure requires use of CA-DATACOM/DB, the program makes an initialization call to the engine. This first call establishes communication with CA-DATACOM/DB. Additional calls to the engine perform retrieval and update operations required by the SAS procedure.

Calls Made on Behalf of the ACCESS Procedure

The ACCESS procedure calls the interface view engine to retrieve information from the CA-DATADICTIONARY database about entity-occurrence names and attributes. The engine sends this information (for example, name, data type, level) to the ACCESS procedure for each field in the table. The procedure stores this information in the access descriptor for later use when creating view descriptors.

Also, if you are using the ACCESS procedure to extract information and place them in a SAS data file, the ACCESS procedure calls the interface view engine.

Calls Made by Other SAS Procedures

SAS procedures can access records in a CA-DATACOM/DB table by referring to a view descriptor with the DATA= option. The SAS System examines the view descriptor to determine which database management system is referred to and passes control to the appropriate engine. The interface view engine uses information stored in the view descriptor (for example, field name, data type, key, level, and occurs specifications) to process CA-DATACOM/DB data records as if they were rows in a SAS data file.

Before doing any retrievals, the engine processes the WHERE clause (if any) to select a subset of data records that are to be processed as rows. The engine constructs the selection criteria from the view WHERE clause and the SAS WHERE clause (if any). If no WHERE clauses exist, all data records in the table qualify.

The interface view engine forms a SAS row (according to the view descriptor), which it passes back to the calling procedure for processing.

Based on the capabilities of the SAS procedure, the next call to the engine might be a request to update or delete the SAS row that was just retrieved. For updates, the engine issues UPDAT, ADDIT, and DELET commands for the data records. Typically the SAS procedure then calls the engine again to retrieve another SAS row. If so, the engine locates another data record, constructs another SAS row, and returns it to the SAS procedure. This cycle continues until the SAS procedure terminates or until the last qualified SAS row has been constructed and returned to the SAS procedure.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.