|SAS/ACCESS Software for PC File Formats: Reference|
ACCESS Procedure Reference describes the generic options and procedure statements that enable you to create access descriptors, view descriptors, and SAS data files from PC file format data. The following section describes the PC file-specific statements you use in the SAS/ACCESS interface to DIF files.
|ACCESS Procedure Statements for DIF Files|
To create an access descriptor, you use the DBMS=DIF option and the database-description statements PATH=, DIFLABEL, and SKIPROWS. These statements supply DIF-specific information to the SAS System, and must immediately follow the CREATE statement. In addition to the database-description statements, you can use optional editing statements when you create an access descriptor. These editing statements must follow the database-description statements.
Database-description statements are only required when you create access descriptors. Because the DIF information is stored in an access descriptor, you do not need to repeat this information when you create view descriptors.
The SAS/ACCESS interface to DIF uses the following procedure statements:
PROC ACCESS options;
The QUIT statement is also available in PROC ACCESS. However, its use causes the procedure to terminate. QUIT is used most often in the interactive line and noninteractive modes to exit the procedure without exiting SAS.
COL2, and so on. These labels become the names of SAS variables in the access descriptor.
If you specify DIFLABEL, the ACCESS procedure reads column labels from the first row of the DIF file and uses them as the SAS variable names in the access descriptor. You provide the DIF file column labels; they are not the letters (for example, A, B, and so on) that identify the columns in a worksheet. If you specify DIFLABEL, the SKIPROWS statement automatically changes to 1.
Always specify DIFLABEL after the PATH= statement and before any editing statements. When you update a descriptor, you are not allowed to specify the DIFLABEL statement.
The following example creates an access descriptor and a view descriptor based on .DIF file data.
options linesize=80; libname difdliba 'SAS-data-library'; libname diflibv 'SAS-data-library'; proc access dbms=dif; /* create access descriptor */ create difliba.custs.access; path='c:\difiles\dbcusts.dif'; diflabel; skiprows=2; assign=yes; rename customer = custnum; format firstorder date9.; list all; /* create usacust view */ create diflibv.usacust.view; select customer state zipcode name firstorder; run;
0. The skipped (or ignored) rows often contain information such as column labels or names or underscores rather than input data.
If you specify the DIFLABEL statement, the default value
of SKIPROWS automatically changes to
1. The SKIPROWS statement
should always follow the PATH= statement and precede any editing statements
when you are creating a descriptor. The first row of data after SKIPROWS is
used to generate the SAS variable types and formats. If there are no data
in the first row of a column after SKIPROWS, the data in the rest of the column
are assumed to be character, even if the data in the next row are numeric.
By default, any data value in a column that does not match the
type is treated as a missing value. However, if you set the DIFNUMS environment
YES in your SAS configuration file, any numeric data
values in a character column are converted to the character representation
of the number and are not treated as missing values. Add the following line
to your SAS configuration file to set the DIFNUMS environment variable to
-SET DIFNUMS YES
The default for the DIFNUMS environment variable is
NO. Refer to the SAS documentation for your operating environment
for more information about environment variables.
You can change the column type from the type determined by SAS/ACCESS software when you create an access descriptor.
If you omit the TYPE statement, the database field types are generated from the PC file data types. You can change as many database field types as you want in one TYPE statement.
Top of Page
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.