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

How do I rename  Number_of_surveys to  Number of surveyswhich is without underscore

proc freq data=nSubj ;
tables Number_of_surveys/ NOCUM ;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20
options validvarname=any;
proc freq data=nSubj(rename=(Number_of_surveys='Number of surveys'n)) ;
tables 'Number of surveys'n/ NOCUM ;
run;

View solution in original post

4 REPLIES 4
novinosrin
Tourmaline | Level 20
options validvarname=any;
proc freq data=nSubj(rename=(Number_of_surveys='Number of surveys'n)) ;
tables 'Number of surveys'n/ NOCUM ;
run;
hjjijkkl
Pyrite | Level 9
Thank you!
Reeza
Super User
Why not use a label instead?

It means you'll have to type out the name with the spaces and quotes and N each time otherwise? 'Number of Surveys'n is now your new variable name.

label number_of_surveys = 'Number of Surveys';

If you want more control over your output from PROC FREQ I suggest using PROC TABULATE instead.
hjjijkkl
Pyrite | Level 9

I have used it and using the Label name changes the the label "Frequency count" that is automatically generated with the freq table not the variable "number_of_surveys" when used proc freq

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 4477 views
  • 1 like
  • 3 in conversation