Previous Page | Next Page

Getting Information about Your SAS Data Sets

Requesting Contents Information in Different Formats

For a variation of the contents listing, use the VARNUM option or the SHORT option in the CONTENTS statement. For example, the following statements produce a list of variable names in the order in which they were defined, which is their logical position in the data set:

   contents data=tempchng varnum;
run;

The CONTENTS statement specifies the data set TEMPCHNG and includes the VARNUM option to list variables in order of their logical position. (By default, the CONTENTS statement lists variables alphabetically.)

The following output shows the contents in variable number order:

Listing Contents of the Data Set TEMPCHNG in Variable Number Order

                                 The SAS System

                             The DATASETS Procedure

Data Set Name: USCLIM.TEMPCHNG                          Observations:         5 
Member Type:   DATA                                     Variables:            6 
Engine:        V8                                       Indexes:              0 
Created:       14:32 Wednesday, November 15, 2000       Observation Length:   56
Last Modified: 14:32 Wednesday, November 15, 2000       Deleted Observations: 0 
Protection:                                             Compressed:           NO
Data Set Type:                                          Sorted:               NO
Label:                                                                          


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

      Data Set Page Size:         8192                                    
      Number of Data Set Pages:   1                                       
      First Data Page:            1                                       
      Max Obs per Page:           145                                     
      Obs in First Data Page:     5                                       
      Number of Data Set Repairs: 0                                       
      File Name:                  /u/userid/usclim/tempchng.sas7bdat
      Release Created:            8.0202M0                                
      Host Created:               HP-UX                                   
      Inode Number:               14595                                   
      Access Permission:          rw-r--r--                               
      Owner Name:                 userid                                  
      File Size (bytes):          16384                                   


                     -----Variables Ordered by Position-----
 
               #    Variable    Type    Len    Format    Informat
               --------------------------------------------------
               1    State       Char     13              $CHAR13.
               2    Date        Num       8    DATE9.    DATE7.  
               3    Start_f     Num       8                      
               4    End_f       Num       8                      
               5    Minutes     Num       8                      
               6    Diff        Num       8                      

If you do not need all of the information in the contents listing, then you can request an abbreviated version by using the SHORT option in the CONTENTS statement. The following statements request an abbreviated version and then end the DATASETS procedure by issuing the QUIT statement:

   contents data=tempchng short;
run;
quit;

The following output lists the variable names for the TEMPCHNG data set:

Listing Variable Names Only for the Data Set TEMPCHNG

                                 The SAS System

                             The DATASETS Procedure

           -----Alphabetic List of Variables for USCLIM.TEMPCHNG-----

                     Date Diff End_f Minutes Start_f State

Previous Page | Next Page | Top of Page