'label' Statement
You can add variable labels using the label statement as shown here.
label varl='you supply label' var2='you supply label';
Variable labels are used to provide a more full description of a variable than the sometimes cryptic variable names.
label sbp1999='Systolic Blood Pressure in 1999';
When a label statement is placed in a data step, the label stays with the variable for all subsequent procedures, unless relabeled. When placed in a procedure the label only stays attached to the variable for that procedure.
Use double quotes if there is to be a single quote in the label. For example,
label mombp="mother's systolic bld pressure";
You can label multiple variables in one label statement. label varl='you supply label' var2='you supply label'; |
Comments
You can make your program easier to follow by including comments. They will not appear in your output.
Comments start with * and end with ;
or
are placed inside /* */
They appear in green in your program.
Example:
title 'STUDY OF GENETIC COMPONENT OF HYPERTENSION';
footnote 'results of example for class 3';
data family;
input id mombp dadbp kidbp;
parentsbp=(mombp + dadbp) / 2; * CREATING A NEW VARIABLE;
/*Since a SAS statement ends with a semicolon (;), a statement may last over several lines like the label statement below. Or several SAS statements can be on the same line, like in the proc print step below.*/
label mombp="mother's systolic bld pressure"
parentsbp ="average of parents' bld pressure"
id='identification number for family';
datalines;
;
run;
**use the "label" option in proc print to print out the variable labels**;
proc print data=family label; var mombp dadbp parentsbp; run;
proc chart data=family;
vbar kidbp;
title2; ** erases title2;
run;
proc gchart data=family;
vbar kidbp;run;
STUDY OF GENETIC COMPONENT OF HYPERTENSION
STUDY OF GENETIC COMPONENT OF HYPERTENSION
STUDY OF GENETIC COMPONENT OF HYPERTENSION