BookmarkSubscribeRSS Feed
SamA
Calcite | Level 5

Hi,

I'm using Sas 9.1.3, with Excelxp tagsets from 2005 (maybe I need a new version).  I have a dataset generated by proc summary that I am using wiht proc report to output to Excel.  Thep problem I have is controlling the alingnment of the header boxes. Attached is a one page pdf displaying a sample desired output.  For instance, I would like the "family characteristic" header to be one merged box with the text centered, and then have the "percentage of families saved" and "percentage of familes" headers reach all the way to the year spanned header.  Currently the way I do it has two blank cells at the top of the cell since there are two spannings (the year and the 'income' header above the mean and median); also since I set 'income' to span there is a blank cell at the top of the percentage of families header cells.

In the table below (illustrating my output) the two cells under 1998 would actually be merged in my output and contain the word 'income' I just can't get it to do this in the table in this discussion.

Header 11998



Family characteristic

MedianMean

Here is the column statement I am using:

COLUMN LABEL YEAR, (('Income' INCOME_MEAN INCOME_MEDIAN)   PERCENT_SAVING  PCT_FAMILIES);

where label is a character variable label for each row, whose header title is "family characteristic".  I have searched a lot online and can't find anywhere where it mentions something like this.  I have also not seen examples of similar output in papers.  The closest I can find is where you can 'erase' the gridlines by making them white using DDE but this wouldn't help me center the header title within the 'merged' cell, also I am using linux which appears not to work with DDE, and I think these features are new to SAS 9.2.  Any tips?  Or am I just wasting my time trying to do this?

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi,

Your example actually looks like a fairly standard PROC TABULATE output...customized with some extra ODS to get the dots and the italics, etc into the output.

The big "box" area in TABULATE is used to show the "intersection" of the row dimension and the column dimensions of the table.

I do not believe you fake out a box like that with PROC REPORT. In fact, people use PROC REPORT a lot of times because they do NOT want that box area that they get with TABULATE.

cynthia

SamA
Calcite | Level 5

Hi Cynthia,

Thanks for the advice.  The thing is that I need to do some post output processing to the output summary dataset (to censor low N values, for example).  I tried with proc summary to output a dataset and i seem to get the same thing I would get from the proc summary steps I am using.  It seems that this need for post-output processing would make invalidate the use of proc tabulate.  Perhaps I misunderstand though.  I tried tabulate and the printed table looks pretty good though.

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
  • 846 views
  • 0 likes
  • 2 in conversation