I need to find mean and standard deviation for a data where my label option is not working when I want to change the variable name
The following is my data:
Data SAS;
input Obsvalue;
cards;
12.000
15.000
13.000
11.000
;
Run;
Proc Means data= SAS Mean STD maxdec=7;
Var Obsvalue;
Run;
Proc print data=SAS;
Var Obsvalue;
Label ObsValue='Observed Value';
Run;
The result is displayed without changing the variable name from obsvalue to Observed Value.
Can someone help?
Thanks
Hello,
Use the label option on the proc print statement :
Proc print data=SAS label;
Var Obsvalue;
Label ObsValue='Observed Value';
Run;
Hello,
Use the label option on the proc print statement :
Proc print data=SAS label;
Var Obsvalue;
Label ObsValue='Observed Value';
Run;
As mentioned by @gamotte, PROC PRINT uses the name of the variable as the column heading unless you overrides this default behavior by using the keyword "LABEL" in the PROC PRINT statement.
Best,
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: