@Vani1493 wrote:
Thank you so much for your valuable reply.
attrib rf_ppterm length=$1 label="Previous Preterm Birth Y Yes";
I heard Attribs used as macro parameters and default is N...maybe that is the reason in the above statement mention Y yes. If we did not mention Y yes, it will take only N No for the variable rf_ppterm?
I am very new to SAS, please help me.
Thank you
Labels are text that a programmer wants to appear in the places that a label would appear. Period. There does not have to be any relationship to the values at all. So if you remove the "Y yes" then the text displayed changes but there is no effect on the value.
Example:
data junk;
x='abcdef';
label x='The meaning of life. 42 is the answer';
run;
proc print data=junk label;
run;
If you run the above the Proc print displays the label and the value of x. See any actual connection?
This behavior of label has several pieces. One is label attached to a variable can be permanent, i.e. part of the data set description. But you can often override the default label by providing one just for the duration of a particular procedure:
proc print data=junk label;
label x='Some random text';
run;
The above does not change the label associated with the variable X permanently, only for the duration of that procedure.
Typically a use for overriding a label may make more sense with a numeric variable where you have summarized it so want to change the label from something like "Account Ballance" to "Average account balance". You can let your imagination be your guide as needed. Another reason to override the label for a procedure may be that the text displayed is longer than you want to see for table or graph. So you could change the default label of a variable from a narrative "Count of chickens seen crossing road on Dec 7" to "# Chickens" if the "crossing the road on Dec 7" is not critical information at that point.
... View more