I'm generating tables with rolling weeks of data, so my columns have to be named in the yyyymmdd
format like 20161107
. I need to apply a comma format to these columns to display counts, but the format is also being applied to the column name so 20161107
turns into 20,161,107
. Below is example code that shows the error:
data fish; set sashelp.fish;
TEST = WIDTH*1000;
run;
ods tagsets.excelxp file = "C:\User\Desktop\test.xls" style=minimal
options(embedded_titles="yes" autofit_height="yes" autofilter="all");
proc report data = fish spanrows nowd &header_style.;
column SPECIES TEST;
define SPECIES / display;
define TEST / display "20161107"
f=comma12. style={tagattr='format:###,###,###'}; /* ERROR OCCURS WITH THIS STYLE */
title1 bold "sashelp.fish title";
run; title1;
ods tagsets.excelxp close;
It looks like I can fix this error by padding the display name with spaces like " 20161107 "
but I'm not hardcoding these names, so I'd like to try to fix it in the proc report
syntax first if possible. Any insight?