How to create and use labels in SAS

  • 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;


The output of the proc contents is shown below. You can see in this portion of the output of the proc contents that there are no labels attached to the variables in this file.
—–Alphabetic List of Variables and Attributes—–# Variable Type Len Pos———————————–5 FOREIGN Num 8 321 MAKE Char 8 02 MPG Num 8 83 REP78 Num 8 164 WEIGHT Num 8 24



One Response for "How to create and use labels in SAS"

  1. \')/* June 30th, 2008 at 12:48 pm

    ekibastos…

    ekibastos…


Leave a comment

You must be logged in to post a comment.