BookmarkSubscribeRSS Feed
Konkordanz
Pyrite | Level 9

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;

Konkordanz_1-1690440646658.png

 

 

2 REPLIES 2
sbxkoenk
SAS Super FREQ

using rename= data set option?

 

PROC TABULATE ... out=mz2022_ergebnis(drop=_: rename=(oldname1=newname1 oldname2=newname2));

Koen

ballardw
Super User

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: 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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 470 views
  • 3 likes
  • 3 in conversation