Chapter Contents

Previous

Next
DATASETS

DATASETS



Lists, copies, renames, and deletes SAS files, manages indexes for and appends SAS data sets in a SAS data library

UNIX specifics: information displayed on the SAS log and output


Details
Example
See Also


Details

Some of the information, such as the filenames and access permissions, that is generated by the DATASETS procedure depends on your operating environment. The information generated by the CONTENTS statement also varies according to the device type or access method associated with the data set. If you specify the DIRECTORY option in the CONTENTS statement, the directory information is displayed in both the log and output windows.


Example

The following SAS code creates two data sets, grades.sas7bdat and majors.sas7bdat, and runs PROC DATASETS on majors.sas7bdat.

options nodate pageno=1;
libname classes '.';

data classes.grades (label='First Data Set');
   input student year state $ grade1 grade2;
   label year='Year of Birth';
   format grade1 4.1;
   datalines;
1000 1980 NC 85 87
1042 1981 MD 92 92
1095 1979 PA 78 72
1187 1980 MA 87 94
;
run;

data classes.majors(label='Second Data Set');
   input student $ year state $ grade1 grade2 major $;
   label state='Home State';
   format grade1 5.2;
   datalines;
1000 1980 NC 84 87 Math
1042 1981 MD 92 92 History
1095 1979 PA 79 73 Physics
1187 1980 MA 87 74 Dance
1204 1981 NC 82 96 French
;
run;

proc datasets library=classes;
   contents data=majors directory;
run;

The output of this example is shown in PROC DATASETS Example. The first page of output from this example SAS code is produced by the DIRECTORY option in the CONTENTS statement. This information also appears on the SAS log. Pages 2 and 3 in this output describe the data set classes.majors.sas7bdat and appear only on the SAS output.

PROC DATASETS Example
                                  The SAS System

                              The DATASETS Procedure

                               -----Directory-----

                 Libref:            CLASSES
                 Engine:            V8
                 Physical Name:     /remote/u/yourid
                 File Name:         /remote/u/yourid
                 Inode Number:      283433
                 Access Permission: rwxrwxrwx
                 Owner Name:        yourid
                 File Size (bytes): 1024


                                       File
                 #  Name    Memtype    size  Last modified
                 -----------------------------------------------
                 1  MAJORS  DATA      16384   01JUN1999:15:50:11
                 2  GRADES  DATA      16384   01JUN1999:15:50:12
                                  The SAS System

                              The DATASETS Procedure

Data Set Name: CLASSES.MAJORS                            Observations:         5
Member Type:   DATA                                      Variables:            6
Engine:        V8                                        Indexes:              0
Created:       15:50 Tuesday, June 1, 1999               Observation Length:   48
Last Modified: 15:50 Tuesday, June 1, 1999               Deleted Observations: 0
Protection:                                              Compressed:           NO
Data Set Type:                                           Sorted:               NO
Label:         Second Data Set


                   -----Engine/Host Dependent Information-----

     Data Set Page Size:         8192
     Number of Data Set Pages:   1
     First Data Page:            1
     Max Obs per Page:           169
     Obs in First Data Page:     5
     Number of Data Set Repairs: 0
     File Name:                  /remote/u/yourid/majors.sas7bdat
     Release Created:            8.00.00B
     Host Created:               HP-UX
     Inode Number:               2834581
     Access Permission:          rw-r--r--
     Owner Name:                 yourid
     File Size (bytes):          16384
                                  The SAS System

                              The DATASETS Procedure

              -----Alphabetic List of Variables and Attributes-----

           #    Variable    Type    Len    Pos    Format    Label
           -----------------------------------------------------------
           4    grade1      Num       8      8    5.2
           5    grade2      Num       8     16
           6    major       Char      8     40
           3    state       Char      8     32              Home State
           1    student     Char      8     24
           2    year        Num       8      0


See Also


Chapter Contents

Previous

Next

Top of Page

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