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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4184 views
  • 1 like
  • 3 in conversation