Chapter Contents

Previous

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

Updating Descriptor Files

This section describes how to update existing descriptor files. You update access descriptor and view descriptor files with the UPDATE statement. You can edit the user and field information in the descriptor files.

When you update an access descriptor, the view descriptors based on this access descriptor are not updated automatically. You must re-create or update any view descriptors that you want to reflect the changes made to the access descriptor. That is, for some updates (such as dropping a field), the view descriptors are still valid, but they do not reflect the changes made in the access descriptor. In other situations (for example, if you edited the access descriptor to use a different userid or to add a password), the view descriptors would no longer be valid. A valid descriptor file can also be made useless by an update. For example, if an update to an access descriptor drops two of the four fields defined in a view descriptor, you may want to update or delete the view descriptor.

The following example updates access descriptor MYLIB.CUSTS to drop additional fields. The VLIB.USACUSTS and VLIB.CUSTADD view descriptors remain valid, however, you may want to update them to select new fields to replace those dropped as a result of the update.

proc access dbms=datacom;
 update mylib.custs.access; 
  drop 3 7; 
  list all; 
run;

The statements are described below.

proc access dbms=datacom;
invokes the ACCESS procedure for the SAS/ACCESS interface to CA-DATACOM/DB.

update mylib.custs.access;
identifies the access descriptor, MYLIB.CUSTS, that you want to update. The MYLIB libref must be associated with a SAS data library before you can specify this statement.

drop 3 7;
marks the CA-DATACOM/DB fields associated with position 3 (STATEZIP) and position 7 (TELEPHONE) as non-display. STATEZIP is a compound (*GROUP*) field consisting of STATE and ZIPCODE. Dropping a group effectively drops the members of the group, so the STATE and ZIPCODE fields (which are selected in VLIB.USACUST and VLIB.CUSTADD) are marked as non-display as well.

list all;
lists updated SAS information for the fields in the access descriptor. Fields that were dropped have *NON-DISPLAY* next to the SAS column description. The list is written to the SAS log.

run;
writes the updated access descriptor when the RUN statement is processed.

Altering a CA-DATACOM table that has descriptor files defined can also cause these files to be out of date or invalid. If you add a field to a table, an access descriptor is still valid. However, if you delete a field or change its characteristics and that field is used in a view descriptor, the view will fail when executed. For more information, see How Changing the CA-DATADICTIONARY Database Affects Descriptor Files.


Chapter Contents

Previous

Next

Top of Page

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