Is there way to use the variable names in PROC TABULATE instead of labels?
If you remove the labels from the variable names, then all SAS PROCs (as far as I know) use the variable name.
Or
options nolabel;
which affects all PROCs until you turn it off.
If you remove the labels from the variable names, then all SAS PROCs (as far as I know) use the variable name.
Or
options nolabel;
which affects all PROCs until you turn it off.
Thanks, this worked!
I was thinking there would be a NOLABELS options for PROC TABULATE as there is for PROC MEANS but there evidently isn't. I guess this actually makes sense because it would be rare that you would prefer the variable name when using PROC TABULATE. In any case, your solution worked.
Don't know if this helps as you don't say how many variables might be involved.
You can override the default label for any variable in a Table statement by using variablename='Label text' in Proc tabulate.
This works for statistics as well such as Sum='Sum of xxxx'
Example
proc tabulate data=sashelp.cars; class drivetrain; var mpg_city; tables drivetrain='Drivetrain', mpg_city='MPG'*mean; run;
The above will display "Drivetrain" instead of "Drive Train" and "MPG" instead of assigned label of "MPG (City)";
Or provide a Label statement.
proc tabulate data=sashelp.cars; class drivetrain; var mpg_city; tables drivetrain, mpg_city*mean; label drivetrain='Drivetrain' mpg_city='MPG' ; run;
The equivalent for statistics would be KEYLABEL: Keylabel mean='Average'; for example would display 'Average' for all mean statistics.
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.