Hi,
with the following proc-tabulate-step I create the dataset "mz2022_ergebnis" (screenshot). The variables names are pretty cryptic. Is there a option to define the output-names within the proc-tabulate-step?
proc tabulate data=mz2022 out=mz2022_ergebnis (drop=_:);
class PET_ArbZeit_neu / mlf;
var HRF;
tables PET_ArbZeit_neu="" all="Gesamt",HRF=""*sum="sum_2022" HRF=""*COLPCTSUM="rel_2022";
where PET_StiB3 = "2_abhBesch" and P_erwtyp3= "1_ET" and BevHH_HW=1;
format PET_ArbZeit_neu $PET_ArbZeit_neu_fmt.;
run;
using rename= data set option?
PROC TABULATE ... out=mz2022_ergebnis(drop=_: rename=(oldname1=newname1 oldname2=newname2));
Koen
Nothing at all cryptic about the variable names.
Class variables get the names of the class variables.
Statistics get the name of the variable with the statistic appended. Var_sum is the Sum of Var for the given combination of class variables (and table if more than one table created).
This is pretty much the behavior of Proc Means/Summary with the Autoname option for statistics of Var variables.
Only likely headache is starting with very long variable names where the appended statistic either has no room at all or results in a name too long to fit inside 32 characters.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.