proc tabulate data=school ;
tables (math phys philo grd)*sum*f=10.0, all ;
format math mathematics. phys physics. philo philosophy. grd grade.;
var math phys philo grd;
run;
A touch confused.
Formats are used to control the display of a variables values. I've variable math has the values math101, math102
Labels are used to control the display of a variable name ie math='Mathematics'
Your output and description don't seem to match, which are you trying to do?
Sorry about the confusion. only half ofthe ouput was displayed.
anyway, this is how my output looks like
sum
sum
Given your code try labels then, instead of format.
If if that doesn't work please post a sample of your input data set.
Label math='Mathematics';
Formats will not be a solution for this. Just use variable labels in table statement to get the full text. Try this.
proc tabulate data=school ;
tables (math='mathematics' phys='physics' philo='philosophy' grd='grade')*sum*f=10.0, all ;
var math phys philo grd;
run;
proc tabulate data=school ;
tables (math='mathematics' phys='physics' philo='philosophy' grd='grade' )*sum*f=10.0, all ;
var math phys philo grd;
run;
It is variable label, has nothing to do with FORMAT.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.