Chapter Contents |
Previous |
Next |
SAS/ACCESS Interface to SYSTEM 2000 Data Management Software: Reference |
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 is in a SYSTEM 2000 database, the SAS System Supervisor calls the interface view engine to access the data. The engine can access a database for reading, updating, inserting, and deleting.
The connections between the SAS/ACCESS procedures and the SYSTEM 2000 software are shown in How the SAS System Connects to SYSTEM 2000 Software.
How the SAS System Connects to SYSTEM 2000 Software
How the SYSTEM 2000 Interface View Engine Works |
In all situations, the same PLEX commands initiate and terminate communication between the interface view engine and SYSTEM 2000 software. Each time a different SAS procedure requires use of SYSTEM 2000 software, it makes an initialization call to the engine. This first call establishes communication with SYSTEM 2000 software and opens the requested database.
The engine determines whether it must issue the START S2K command for a single-user job or the Multi-User environment, as specified by the calling SAS procedure. Then it issues an OPEN command for the specified database and returns control to the procedure. Additional calls to the engine perform retrieval and update operations required by the SAS procedure.
When the SAS procedure terminates, the engine issues a CLOSE command
for the database that was opened. It issues the STOP S2K command only when
the entire SAS session terminates, or when you want to run the QUEST procedure
in the same environment (single user or Multi-User) that SAS programs have
been running in.
Also, if you are using the ACCESS procedure to extract information into
a SAS data file, the ACCESS procedure calls the engine.
When you insert data into an existing SYSTEM 2000 database, you must specify an appropriate view descriptor in the DBLOAD procedure. The view descriptor provides a mapping between the SAS variables containing data to be inserted and the SYSTEM 2000 components that will be used to insert the data into the database. It also contains the database name, password, and access mode to be used when you do inserts.
For each observation that is retrieved from the data file specified on the DATA= option, a corresponding call is made to the interface view engine. The engine inserts the data into the database identified by the view descriptor. The engine uses only insert mode (one at a time) for inserting new descendant records into existing logical entries. Also, if the DATA= option identifies a SYSTEM 2000 view descriptor, the interface view engine is called to read that view.
When you load new logical entries (starting with records at level 0)
into a database, you can specify that you want to use an optimized loading
process. SYSTEM 2000 software processes the new logical entries as one batch
of inserts (PLEX load mode). This optimized load mode is faster than inserting
records one at a time. However, it causes the software to attach the database
with exclusive use and no other database can be open in the same execution
environment. Therefore, if your job is using optimized load, your input cannot
also be a SYSTEM 2000 view descriptor of a database in the same environment.
Before doing any retrievals, the engine processes a PLEX dynamic where-clause (if specified) to select a subset of data records that are to be processed as observations. The engine constructs the dynamic where-clause from the view where-clause and the SAS WHERE clause (if any). If no view where-clause exists, a where-clause is constructed to locate all database records.
The dynamic where-clause processing returns a Locate File containing the addresses of database records that satisfied the selection criteria. Based on those addresses, the engine issues a combination of GET S2KCOUNT, GET1, and GETA commands to read one or more database records. Then the engine combines data from the records (according to the view descriptor) to form a SAS observation, 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 observation that was just retrieved. For updates, the engine issues MODIFY, INSERT, REMOVE and so on for one or more data records, depending on how many records were used to construct the observation. Typically, the SAS procedure then calls the engine again to retrieve another SAS observation. If so, the engine locates another group of records, constructs another SAS observation, and returns it to the SAS procedure. This cycle continues until the SAS procedure terminates or until the last qualified SAS observation has been constructed and returned to the SAS procedure. In addition, the engine uses other commands, such as COMMIT, ROLLBACK, and CLEAR, to control processing.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.