Sorting and Labels

You can sort data by values of one or more variables and replace variable names with descriptive labels.

     libname clinic 'your-SAS-data-library';
     proc sort data=clinic.admit out=admit;
        by age;
     run;
     proc print data=admit label;
        var age height weight fee;
        label fee='Admission Fee';
     run;

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


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

Terms of Use & Legal Information | Privacy Statement