Hello,
I'd like to add a caption under the table that results from this statement. A footnote is too far down the page. Thanks for any suggestions!
ODS PDF file="&savepathrep.\Table_1994_2017_&val._&filedate..pdf"
STYLE=styles.analysis;
proc tabulate data=have missing classdata=dummy.dummyyr;
where lhj="&val";
class count vitalstat year;
table year*f=comma8.0 all*f=comma8.0, count*f=comma8.0 vitalstat*f=comma8.0 /misstext='0' printmiss box="&val";
label year='Year of Report'
count='Confirmed Cases'
vitalstat='Vital Status';
keylabel all='Total 1994-2017';
Title 'Title of Table Here';
run;
ODS PDF close;
I think that you want to use the Style=[Posttext=''] in the table options
proc tabulate data=have missing classdata=dummy.dummyyr;
where lhj="&val";
class count vitalstat year;
table year*f=comma8.0 all*f=comma8.0,
count*f=comma8.0 vitalstat*f=comma8.0
/misstext='0' printmiss box="&val"
style=[Posttext='Title of Table Here']
;
label year='Year of Report'
count='Confirmed Cases'
vitalstat='Vital Status';
keylabel all='Total 1994-2017';
run;
Each table in Proc Tabulate can have both PRETEXT and POSTTEXT. I find the PRETEXT handy to place "titles" immediately above a table when generating multiple tables. The weakness is that I haven't been able, yet, to have as much appearance control as a TITLE statement offers.
I think that you want to use the Style=[Posttext=''] in the table options
proc tabulate data=have missing classdata=dummy.dummyyr;
where lhj="&val";
class count vitalstat year;
table year*f=comma8.0 all*f=comma8.0,
count*f=comma8.0 vitalstat*f=comma8.0
/misstext='0' printmiss box="&val"
style=[Posttext='Title of Table Here']
;
label year='Year of Report'
count='Confirmed Cases'
vitalstat='Vital Status';
keylabel all='Total 1994-2017';
run;
Each table in Proc Tabulate can have both PRETEXT and POSTTEXT. I find the PRETEXT handy to place "titles" immediately above a table when generating multiple tables. The weakness is that I haven't been able, yet, to have as much appearance control as a TITLE statement offers.
Hi:
You could try ODS PDF TEXT but you'll also have to use STARTPAGE=NO option in your ODS PDF statement. or you could switch to PROC REPORT and do a COMPUTE block.
With ODS TEXT, you have to apply style overrides to alter the formatting.
I wouldn't use the ANALYSIS style because the background of the whole page is sort of creamy off-white color -- but that's a color preference. Otherwise, something like the above example should work. Since you didn't provide any data, I just used SASHELP.CLASS.
Cynthia
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.