BookmarkSubscribeRSS Feed
JohnH
Fluorite | Level 6
I have row headers in a table that look like:
Workers
{tab}Retired
{tab tab}Full Benefit
{tab tab}Reduced Benefit
{tab}Disabled

I need to use a Proc Format for these headers. Proc Tabulate usually ignores leading spaces. How do I get a tab or spaces to happen in the row headers in Proc Tabulate??
6 REPLIES 6
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
In some circumstances, I find that using a hex low-value of "00"X sometimes does what you need, at least until printing time.

Scott Barry
SBBWorks, Inc.
polingjw
Quartz | Level 8
Use invisible characters. To insert a character into your program turn num lock on, hold down the alt key, type the digits 255 on the numeric keypad, then release the alt key.
Reeza
Super User
Is it possible to use some of the traffic light format options to accomplish this? Mostly curious.
Cynthia_sas
SAS Super FREQ
Hi:
ODS does not have the concept of a "tab" control.

Although the RTF specification DOES have a \TAB instruction -- the issue with the \TAB instruction is that different folks might have different TAB stops set in their word processor -- so that would not necessarily guarantee that the same amount of space was represented by a \TAB control string with RTF. I have seen folks insert a \TAB instruction into their RTF file using ODS -- but I prefer to use LEFTMARGIN or INDENT style attributes (INDENT or TEXTINDENT).

I generally start with INDENT and sometimes use LEFTMARGIN, as shown in Example 1 on page 9 of this paper:
http://www.lexjansen.com/pharmasug/2008/sas/sa08.pdf
created with the following syntax:
[pre]
style={font_weight=medium leftmargin=12pt}
[/pre]

This PROC TABULATE code will do an indent of the class level values for AGE using INDENT= or TEXTINDENT= (which are aliases for each other):
[pre]
ods listing close;

ods html file='c:\temp\tab_indent_use.html' style=sasweb;
ods rtf file='c:\temp\tab_indent_use.rtf';
ods pdf file='c:\temp\tab_indent_use.pdf';

proc tabulate data=sashelp.class;
class age / style={cellwidth=2in};
classlev age /style={cellwidth=2in font_weight=medium indent=20};
var height weight;
table age ,
height*mean weight*median;
run;

ods _all_ close;
[/pre]

For more information on the INDENT= (or TEXTINDENT=) option, look under the documentation topic entitled: "Style Attributes and Their Values".

cynthia
JohnH
Fluorite | Level 6
Thanks, everyone, especially Cynthia and polingjw. A combination of both your ideas work for us. Cynthia, I looked at the paper you referenced about complex reports. You show some complex tables that have some features that we could use. You mention that the code is available at the SGF website. I have tried and failed to find it there. Could you please give a link, or email me the code for those tables? Thanks so much for all of your help!
Cynthia_sas
SAS Super FREQ
Hi:
If you go to http://support.sas.com/rnd/papers/ you will get to the main site where papers by SAS staff are listed. The page is organized by year...and some descriptions just give a link to the published PDF and other descriptions give a link to download a zip file.

So if you go to the above web site, the quickest way to find my paper and the zip file that goes with it is to do a search in the browser for the word "Complex" and that should take you directly to the link for my paper. Alternately, you can scroll down to the section entitled "SAS Presentations at SAS Global Forum 2008" and my "Creating Complex Reports" section is the 8th presentation listed in that section.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 6 replies
  • 2588 views
  • 0 likes
  • 5 in conversation