Hello,
So I've finally settled on a table style using PROC TABULATE, and I'm happy with it.However it's labor intensive and prone to syntax errors when applying to > 1 table. Here's what I've come up with:
%let header1 = style=[color=black font_size=10pt font_weight=bold font_face=calibri];
%let header2 = style=[color=black font_size=10pt font_weight=medium font_face=calibri];
%let table1 = [s={color=black font_size=10pt font_weight=medium font_face=calibri just=center}];
%let table2 = [s={color=black font_size=10pt font_weight=bold font_face=calibri just=center}];
ods listing close;
ods excel file = "C:mydocuments\table1.xlsx";
ods excel options(sheet_name="Aim1 - 22Apr2019"
sheet_interval='none'
embedded_titles="no"
embedded_footnotes="no"
);
proc odstext;
p "Aim 1 - Income x AFQT Descriptive Analysis"/ &header1;
p "Program location: P:\ORD_Tarlov_201810058D\SAS Programs & Logs\Aim 1" / &header2;
proc tabulate data = afqt_vetses missing;
class afqt_score_cat / &header1;
classlev afqt_score_cat / &header2;
var afqtperc / &header1;
tables afqt_score_cat*&table1 all*&table2,
afqtperc*(n*f=comma12. mean std q1 median q3 min max) / nocellmerge box={label="Sample B: Task 1" s={color=black font_size=10pt font_weight=bold font_face=calibri}};
keylabel all='Total';
keyword all n mean std q1 median q3 min max / &header1;
;
run;
ods excel close;
However, there are 9 more of these tables I need to output that are slight variations of the this one. Is there a more global way I can apply these styles rather than this way which seems so cumbersome? Thanks much.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.