BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SaranyaSundar
Calcite | Level 5

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gamotte
Rhodochrosite | Level 12

Hello,

 

Use the label option on the proc print statement :

 

Proc print data=SAS label;
Var Obsvalue;
Label ObsValue='Observed Value';
Run;

View solution in original post

2 REPLIES 2
gamotte
Rhodochrosite | Level 12

Hello,

 

Use the label option on the proc print statement :

 

Proc print data=SAS label;
Var Obsvalue;
Label ObsValue='Observed Value';
Run;
ed_sas_member
Meteorite | Level 14

Hi @SaranyaSundar 

 

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,

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1144 views
  • 1 like
  • 3 in conversation