CREATE Statement

Creates a SAS/ACCESS descriptor file.

Type: Required statement
Applies to: access descriptor or view descriptor

Syntax

CREATE libref.member-name.ACCESS | VIEW;

Details

Creating a Descriptor File

The CREATE statement identifies the access descriptor or view descriptor that you want to create. This statement is required for creating a descriptor file.
To create a descriptor, use a three-level name. The first level identifies the libref of the SAS library where you store the descriptor. You can store the descriptor in a temporary (Work) or permanent SAS library. The second level is the descriptor's name. The third level is the type of SAS file: specify ACCESS for an access descriptor or VIEW for a view descriptor.
You can use the CREATE statement as many times as necessary in one procedure execution. That is, you can create multiple access descriptors and view descriptors based on those access descriptors, within the same execution of the ACCESS procedure. Or, you can create access descriptors and view descriptors in separate executions of the procedure.

Access Descriptors

When you create an access descriptor, you must place statements or groups of statements in a certain order after the PROC ACCESS statement and its options, as listed below:
  1. The CREATE statement for the access descriptor must directly follow the PROC ACCESS statement.
  2. Database-description statements must follow the CREATE statement: TABLE, TBLSTAT, USER, PASSWORD, DATABASE, DBSTAT, and URT. The order of the database-description statements does not matter.
  3. The editing statements must follow the database-description statements: ASSIGN, CONTENT, DROP, EXTEND, FORMAT, INFORMAT, KEY, LIST, LISTINFO, LISTOCC, OCCURS, QUIT, RENAME, and RESET. The SELECT and SUBSET statements are used only when creating view descriptors. QUIT is an editing statement but it terminates PROC ACCESS without creating your descriptor.
  4. The RUN statement is used to signal the end of the ACCESS procedure.
Information from database-description statements is stored in the access descriptor. Therefore, you do not need to repeat this information when you create view descriptors. However, if no security values were entered in the access descriptor, then you can use the database-description statements in a view descriptor to supply them.

View Descriptors

When you create a view descriptor for an existing access descriptor, you must use the ACCDESC= option with the ACCESS procedure.
When you create view descriptors and access descriptors in the same procedure execution, you must place the statements or groups of statements in the following order:
  1. You must create an access descriptor before creating a view descriptor based on that access descriptor.
  2. You should omit the RUN statement from the access descriptor specification.
  3. Any database-description statements, such as PASSWORD, must precede the editing statements.
  4. Among the editing statements, RENAME, CONTENT, FORMAT, and INFORMAT can be specified only when ASSIGN=NO is specified in the access descriptor referenced by the view descriptor. The order of the statements within this group usually does not matter; see the individual statement descriptions for any restrictions.
  5. The RUN statement is used to signal the end of the ACCESS procedure.
If you create only one descriptor in a PROC step, the CREATE statement and its accompanying statements are checked for errors when you submit PROC ACCESS for processing. If you create multiple descriptors in the same PROC step, each CREATE statement (and its accompanying statements) is checked for errors as it is processed.
If no errors are found, each descriptor is saved when a new descriptor is created or when the RUN statement is processed. If errors are found, error messages are written to the SAS log and processing is terminated. After you correct the errors, resubmit your statements.
For examples of how to create access descriptors and view descriptors, see Defining SAS/ACCESS Descriptor Files.