The SAS Output Delivery System and reporting techniques

Title in proc tabulated ODS

Reply
Frequent Contributor
Posts: 141

Title in proc tabulated ODS

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 DescriptionGrand Total
Sales HeldThird Party SaleSales Sch
Bank1228 30
Bank21314 135
Sales1864 90
Sales213133 164
Repay110441109
Repay2224 26
Grand Total496571554

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

SAS Super FREQ
Posts: 8,861

Re: Title in proc tabulated ODS

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;


title_in_header.pngwith_embedded_titles_yes.pngpage_setup_needs_room_for_header.png
Frequent Contributor
Posts: 117

Re: Title in proc tabulated ODS

Hi,

replace 

embedded_titles='No' with

embedded_titles='Yes'

Ask a Question
Discussion stats
  • 2 replies
  • 401 views
  • 4 likes
  • 3 in conversation