Chapter Contents


SAS/ACCESS Software for PC File Formats: Reference


One advantage of using SAS/ACCESS software is that it enables the SAS System to read and write PC files data directly from SAS programs. This chapter presents examples in which PC files data-accessed through view descriptors are used as input data for SAS programs, and it also shows you how to use SAS procedures and the DATA step to review and update PC file data that are described by SAS/ACCESS view descriptors.

The examples in this chapter use DIF, DBF, WKn, and XLS data. The PC file format is identified in each example and any file-specific issues are described in the example. Throughout the examples, the SAS terms variable and observation are used instead of column and row because this chapter illustrates SAS System procedures and the SAS DATA step. The examples in this chapter show how to create access descriptors and view descriptors and then use the view descriptors in SAS procedures and DATA steps. For more information on the SAS language and procedures that are used in the examples, refer to the books listed at the end of each section. For information about using view descriptors efficiently in SAS programs, see Performance and Efficient View Descriptors and ACCESS Procedure Reference.

In examples that update DBF file data, examples that are re-run will not work the same because the data have been modified. In this case, submit the PCFFDBL.SAS file to re-create the PC files tables.

See Sample Data for all the PC files on which the access and view descriptors are defined. This appendix also includes the SAS data files that are used in this chapter, as well as the SAS statements that created them.

Running the Examples in This Chapter

The examples in this chapter use data in different PC file formats. The PC file data are identified in each example and any file-specific issues are described in the example.

The examples in this chapter show

As you work through the examples, notice that you can create the descriptors in a number of ways. In some cases, the ASSIGN=YES statement is specified and SAS variable names and formats are assigned when the access descriptor is created. In other cases, the ASSIGN statement is omitted and editing statements, such as RENAME and UNIQUE, are specified when the view descriptors are created. How you create descriptors depends on your site's needs and practices. When you run the examples, you only need to create an access descriptor or a view descriptor one time per example. If you re-run the examples, you do not need to re-create the descriptors.

The macro file (PCFFMAC.SAS) provided with the files contains macros that enable any SAS/ACCESS interface for a PC format to create database-description statements. Use the macro file with PCFFDBL.SAS (creates PC files), PCFFSAMP.SAS (contains samples) and PCFFSCL.SAS (contains SAS/AF examples). To adapt the PCFFMAC.SAS file for use at your site, insert your PC file format in the first line of the code. See the comments in the PCFFMAC.SAS file for more information.

If you run the examples individually instead of running the entire examples file, you must preface them with LIBNAME statements to identify where your SAS data libraries are stored. In these examples, the libname DLIB is used for SAS data files; the libname SLIB is used for PROC SQL views; the libname ADLIB is used when creating access descriptors; and the libname VLIB is used when creating view descriptors.

The files that create the PC files tables, descriptors, and the examples are shipped with your SAS/ACCESS software. See Sample Data in This Book for more information about these files.

Chapter Contents



Top of Page

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