Chapter Contents

Previous

Next
RESET

RESET



Resets DBMS columns to their default settings.

Optional statement
Applies to: access descriptor or view descriptor
Interacts with: ASSIGN, DROP, FORMAT, RENAME, SELECT


Syntax
Details
Access descriptors
View descriptors

Syntax

RESET ALL |<'>column-identifier-1<'> <...<'>column-identifier-n<'>>;

Details

The RESET statement resets either the attributes of all the columns or the attributes of the specified columns to their default values. The RESET statement can be used when creating an access descriptor or a view descriptor. However, this statement has different effects on access and view descriptors, as described in the following sections.

If you use an editing statement, such as RESET, it must follow the CREATE statement and the database connection statements when you create a descriptor. See CREATE for more information on the order of statements.

Note:   The RESET statement cannot be used with the UPDATE statement.  [cautionend]


Access descriptors

When you create an access descriptor, the default setting for a SAS variable name is a blank. However, if you have previously entered or modified any of the SAS variable names, the RESET statement resets the modified names to the default names that are generated by the ACCESS procedure. How the default SAS variable names are set depends on whether you included the ASSIGN statement. If you omitted ASSIGN or set it to NO, the default names are blank. If you set ASSIGN=YES, the default names are the first eight characters of each DBMS column name.

The current SAS variable format is also reset to the default SAS format, which was determined from the column's data type. Any columns that were previously dropped, but that are specified in the RESET statement, become available; they can be selected in view descriptors that are based on this access descriptor.


View descriptors

When you create a view descriptor, the RESET statement clears any columns that were included in the SELECT statement (that is, it "de-selects" the columns).

When creating the view descriptor, if you reset a SAS variable and then select it again within the same procedure execution, the SAS variable names and formats are reset to their default values, which are generated from the column names and data types. This applies only if you have omitted the ASSIGN statement or set the value to NO when you created the access descriptor on which the view descriptor is based. If you specified ASSIGN=YES when you created the access descriptor, the RESET statement has no effect on the view descriptor.

The RESET statement can take ALL or column identifiers as arguments:

ALL
for access descriptors, resets all the DBMS columns that have been defined to their default names and format settings and reselects any dropped columns.

For view descriptors, ALL resets all the columns that have been selected so that no columns are selected for the view; you can then use the SELECT statement to select new columns. See SELECT for more information on that statement.

column-identifier
can be either the DBMS column name or the positional equivalent from the LIST statement, which is the number that represents the column's place in the access descriptor. For example, to reset the SAS variable name and format associated with the third column, submit the following statement:
reset 3;

If the column name contains lowercase characters, special characters, or national characters, enclose the name in quotes. You can reset as many columns as you want in one RESET statement, or use the ALL option to reset all the columns.

When creating or updating an access descriptor, the column-identifier is reset to its default name and format settings. When creating a view descriptor, the specified column is no longer selected for the view.


Chapter Contents

Previous

Next

Top of Page

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