BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

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

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

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
Vish33
Lapis Lazuli | Level 10

Hi,

replace 

embedded_titles='No' with

embedded_titles='Yes'

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 997 views
  • 4 likes
  • 3 in conversation