Hi,
Using the PROC Tabulate, I'm trying to format the field in the VAR statement using the values in CLASSLEV variable. Unfortunately, it does not work. The format in the VAR statement is dependent on the values in the CLASS variables.
Any help is appreciated. Thanks.
Please post code and log in the windows appearing when using {i}- or running-man-icon. Test-data, posted as data-step using datalines statement, is useful, too.
I'm experimenting if the code below works. I attached the sample data.
/* START OF SAS CODE */
proc format;
value measure_fmt
1 = comma32.
OTHER = comma32.2
;
run;
proc tabulate data=WORK.sample_data;
class F1 F2 F3 F4 SEQ_NO;
classlev F4 / style={Format=measure_fmt.};
var NOACCT;
table
/* Row Labels */
SEQ_NO,
/* Column Labels */
F1=" "*F2=" "*F3=" "*F4={LABEL=" "}*NOACCT=" "*SUM=" "*{STYLE=<PARENT>};
RUN;
/* END OF SAS CODE */
SAS-Formats are applied by using the format-statement, not the style option.
So adding
format F4 measure_fmt.;
should solve the issue.
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.