Previous Page | Next Page

Understanding and Customizing SAS Output: The Basics

Input SAS Data Set for Examples

The following program creates a SAS data set that contains Scholastic Aptitude Test (SAT) information for university-bound high school seniors from 1972 through 1998. (To view the entire DATA step, see DATA Step to Create the Data Set SAT_SCORES.) The data set in this example is stored in a SAS data library that is referenced by the libref ADMIN. For selected years between 1972 and 1998, the data set shows estimated scores that are based on the total number of students nationwide taking the test. Scores are estimated for male (m)and female (f) students, for both the verbal and math portions of the test.

options pagesize=60 linesize=80 pageno=1 nodate;
libname admin 'your-data-library';

data admin.sat_scores;
   input Test $ Gender $ Year SATscore @@;
   datalines;
Verbal m 1972 531  Verbal f 1972 529
Verbal m 1973 523  Verbal f 1973 521
Verbal m 1974 524  Verbal f 1974 520
   ...more SAS data lines...
Math   m 1996 527  Math   f 1996 492
Math   m 1997 530  Math   f 1997 494
Math   m 1998 531  Math   f 1998 496
;

proc print data=admin.sat_scores;
run;

The following output shows a partial list of the results:

The ADMIN.SAT_SCORES Data Set: Partial List of Output

                                 The SAS System                                1

                  Obs     Test     Gender    Year    SATscore

                    1    Verbal      m       1972       531  
                    2    Verbal      f       1972       529  
                    3    Verbal      m       1973       523  
                    4    Verbal      f       1973       521  
                    5    Verbal      m       1974       524  
                    6    Verbal      f       1974       520  
                    7    Verbal      m       1975       515  
                    8    Verbal      f       1975       509  
                    9    Verbal      m       1976       511  
                   10    Verbal      f       1976       508  
                   11    Verbal      m       1977       509  
                   12    Verbal      f       1977       505  
                   13    Verbal      m       1978       511  
                   14    Verbal      f       1978       503  
                   15    Verbal      m       1979       509  
                   16    Verbal      f       1979       501  
                   17    Verbal      m       1980       506  
                   18    Verbal      f       1980       498  
                   19    Verbal      m       1981       508  
                   20    Verbal      f       1981       496  
                   21    Verbal      m       1982       509  
                   22    Verbal      f       1982       499  
                   23    Verbal      m       1983       508  
                   24    Verbal      f       1983       498  
                   25    Verbal      m       1984       511  
                   26    Verbal      f       1984       498  
                   27    Verbal      m       1985       514  
                   28    Verbal      f       1985       503  
                   29    Verbal      m       1986       515  
                   30    Verbal      f       1986       504  
                   

Previous Page | Next Page | Top of Page