SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating List Reports
Selecting Variables


By default, a PROC PRINT step lists all the variables in a data set. You can select variables and control the order in which they appear by using a VAR statement in your PROC PRINT step.


General form, VAR statement:
VAR variable(s);

where variable(s) is one or more variable names, separated by blanks.


For example, the following VAR statement specifies that only the variables Age, Height, Weight, and Fee be printed, in that order:
     proc print data=clinic.admit;
        var age height weight fee;
     run;

The procedure output from the PROC PRINT step with the VAR statement lists only the values for the variables variables Age, Height, Weight, and Fee.


Obs Age Height Weight Fee
1 27 72 168 85.20
2 34 66 152 124.80
3 31 61 123 149.75
4 43 63 137 149.75
5 51 71 158 124.80
6 29 76 193 124.80
7 32 67 151 149.75
8 35 70 173 149.75
9 34 73 154 124.80
10 49 64 172 124.80
11 44 66 140 149.75
12 28 62 118 85.20
13 30 69 147 149.75
14 40 69 163 124.80
15 47 72 173 124.80
16 60 71 191 149.75
17 43 65 123 124.80
18 25 75 188 85.20
19 22 63 139 85.20
20 41 67 141 149.75
21 54 71 183 149.75



back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement