outods listing close;
options missing=' ' topmargin=0.30in bottommargin=0.01in rightmargin=0.25in leftmargin=0.25in;
ODS TAGSETS.ExcelXP file="&ReportOut..xml" Path="&OutDir" style=&t1_style;
ODS TAGSETS.ExcelXP
options(sheet_interval='none'
default_column_width='8'
sheet_name="Sales Summary"
center_horizontal="no"
Orientation='Landscape'
embedded_titles='No'
fittopage="No"
blackandwhite="No"
Embedded_Footnotes='Yes'
autofit_height="Yes");
Proc tabulate data=FC_SALE2 order= data format=10. S=[cellwidth=150];
Class Col_group STEP_CODE_DESCRIPTION;
Var ln;
Table Col_group=' ' all={label='Grand Total' S=[background = lightblue cellwidth=160]} *[STYLE=[Font_Weight=BOLD]],
STEP_CODE_DESCRIPTION='Description'*ln=' '*sum=' '
all={label='Grand Total' S=[background = lightblue]} *[STYLE=[Font_Weight=BOLD]] *ln=' '*sum=' ' / box='Investor Group';
TITLE 'Sales Summary';
quit;
Produces this output
Investor Group | Description | Grand Total | ||
Sales Held | Third Party Sale | Sales Sch | ||
Bank1 | 22 | 8 | 30 | |
Bank2 | 131 | 4 | 135 | |
Sales1 | 86 | 4 | 90 | |
Sales2 | 131 | 33 | 164 | |
Repay1 | 104 | 4 | 1 | 109 |
Repay2 | 22 | 4 | 26 | |
Grand Total | 496 | 57 | 1 | 554 |
I thought that by inserting a title at the botom, the title would appear in the output at the top. Instead only Descrption appears and I want the title to appear above trhe Description
Hi:
I don't understand what you mean when you say "I thought that by inserting a title at the bottom, the title would appear in the output at the top" -- a FOOTNOTE statement puts a "footer" at the bottom on the table, when embedded_footnotes is set to 'yes'; otherwise, the footnote from the SAS FOOTNOTE statement appears when you do PRINT PREVIEW. By default, the SAS TITLE goes into the header area of the sheet and the SAS FOOTNOTE goes into the footer area of the sheet. The suboptions embedded_titles and embedded_footnotes exist to change this behavior. A SAS FOOTNOTE would never be placed at the top of the table or the top of the page.
The SAS TITLE will also appear in the PRINT PREVIEW -- IF you allow enough space for Excel to show it to you. With your topmargin set to .3 and the default location for header set at .5 (Excel default), essentially your SAS TITLE will not be visible in PRINT PREVIEW. Look what happens if you run the code below (when I use SASHELP.PRDSALE, but with the same options) when topmargin is set to .75, the title, Sales Summary, appears in PRINT PREVIEW mode. Then, if I changed the code to have the suboption embedded_titles='yes', the SAS TITLE would appear above the table in the worksheet.
Cynthia
ods listing close;
options missing=' ' topmargin=0.75in bottommargin=0.75in rightmargin=0.25in leftmargin=0.25in;
ODS TAGSETS.ExcelXP file="c:\temp\ReportOut.xml" style=sasweb;
ODS TAGSETS.ExcelXP
options(sheet_interval='none'
default_column_width='8'
sheet_name="Sales Summary"
center_horizontal="no"
Orientation='Landscape'
embedded_titles='no'
fittopage="No"
blackandwhite="No"
Embedded_Footnotes='Yes'
autofit_height="Yes");
Proc tabulate data=sashelp.prdsale order= data format=10. S=[cellwidth=150];
Class country product;
Var actual;
Table country=' ' all={label='Grand Total' S=[background = lightblue cellwidth=160]} *[STYLE=[Font_Weight=BOLD]],
product='Description'*actual=' '*sum=' '
all={label='Grand Total' S=[background = lightblue]} *[STYLE=[Font_Weight=BOLD]] *actual=' '*sum=' ' / box='Investor Group';
TITLE 'Sales Summary';
run;
ods _all_ close;
Hi,
replace
embedded_titles='No' with
embedded_titles='Yes'
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.