Chapter Contents |
Previous |
Next |
UPDATE |
Optional statement | |
Applies to: | access descriptor or view descriptor |
Not allowed with: | ASSIGN, RESET, SELECT, UNIQUE |
Syntax | |
Details | |
Updating access descriptors | |
Updating view descriptors | |
Examples |
Syntax |
UPDATE libref.descriptor-name.ACCESS|VIEW ; |
Details |
Use the UPDATE statement to perform a quick, simple update of a descriptor. For example, if the PC database file for an existing access descriptor is relocated, you can use UPDATE with the PATH option to specify the new location.
Descriptors modified by UPDATE are not checked for errors. Where validation is crucial, use CREATE to overwrite a descriptor rather than UPDATE.
The descriptor is a name in three parts separated by periods (.):
Multiple UPDATE statements may appear in one ACCESS procedure block. If you use UPDATE to change an access descriptor, one or more UPDATE statements may be required for views that depend on the modified access descriptor.
You can use UPDATE and CREATE in the same PROC ACCESS block.
Updating access descriptors |
The order of statements in an UPDATE block is as follows:
Since the UPDATE block does not validate the updated descriptor, the order of description and editing statements does not matter.
Updating view descriptors |
Examples |
The following example upates an existing access descriptor named ADLIB.PRODUCT:
libname adlib 'c:\sasdata'; proc access dbms=wk4; update adlib.product.access; path=c:\lotus\specprod.wk4; rename productid prodid fibername fiber; format productid 4. weight e16.9 fibersize e20.13 width e16.9; run;
The following example updates the access descriptor
EMPLOY, located in
c:\sasdata
, for the spreadsheet named
c:\excel\employ.xls
and updates the view descriptor for EMPLOY named
EMP1204, located in
c:\sasviews
:
libname adlib 'c:\sasdata'; libname vlib 'c:\sasviews'; proc access dbms=xls; update adlib.employ.access; path='c:\excel\employ.xls'; list all; update vlib.emp1204.view; format empid 6. salary dollar12.2 jobcode 5. hiredate datetime9. birthdate datetime9.; subset where jobcode=1204; run;
The following example updates a second view descriptor
that is based on EMPLOY named BDAYS. It is also located in
c:\sasviews
. When you update a view, it is not
necessary to specify the access descriptor (using ACCDESC=) in the PROC ACCESS
statement. Note that FORMAT can be used because the access descriptor EMPLOY
was created with ASSIGN=NO.
libname vlib 'c:\sasviews'; proc access dbms=xls; update vlib.bdays.view; format empid 6. birthdate datetime7.; run;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.