- Author: admin
- Filed under: Auto-cars
- Date: Mar 12,2008
Creating variable labels We use the label statement in the data step to assign labels to the variables. You could also assign labels to variables in proc steps, but then the labelsonly exist for that step. When labels are assigned in the data step they are available for all procedures that use that data set.
The following program assigns variable labels to rep78, mpg and foreign.
DATA auto2; SET auto; LABEL rep78 =”1978 Repair Record” mpg =”Miles Per Gallon” foreign=”Where Car Was Made”;RUN;PROC CONTENTS DATA=auto2;RUN; Read the rest of this entry »
- Author: admin
- Filed under: Auto-cars
- Date: Mar 12,2008
There are two main items that can be labeled, variables and values.once created these labels will appear in the output of statistical procedures and reports that you may produce from SAS. They are also displayed by some of the SAS/GRAPH procedures.
The program below reads the data and creates a temporary data file called auto
. The labeling shown in this module are all applied to this data file called auto.
DATA auto ; INPUT make $ mpg rep78 weight foreign ;CARDS;AMC 22 3 2930 0AMC 17 3 3350 0AMC 22 . 2640 0Audi 17 5 2830 1Audi 23 3 2070 1BMW 25 4 2650 1Buick 20 3 3250 0Buick 15 4 4080 0Buick 18 3 3670 0Buick 26 . 2230 0Buick 20 3 3280 0Buick 16 3 3880 0Buick 19 3 3400 0Cad. 14 3 4330 0Cad. 14 2 3900 0Cad. 21 3 4290 0Chev. 29 3 2110 0Chev. 16 4 3690 0Chev. 22 3 3180 0Chev. 22 2 3220 0Chev. 24 2 2750 0Chev. 19 3 3430 0Datsun 23 4 2370 1Datsun 35 5 2020 1Datsun 24 4 2280 1Datsun 21 4 2750 1;RUN;PROC CONTENTS DATA=auto;RUN; Read the rest of this entry »