BookmarkSubscribeRSS Feed
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Hello all,
Curious to know if it feasible to have the column header in the same line as the data point, so that instead of:

Name
Lawrence

You would have Name: Lawrence

Multiple names are not a problem here as a macro must output a single report for each event.

Thank you for your time.

Lawrence
9 REPLIES 9
Cynthia_sas
SAS Super FREQ
Hi:
Would you want the column header to still look like a column header??? If you had more than 1 obs would you want EVERY obs to have the column header for EVERY var?? Like this:
[pre]
Name: Alfred Age: 16
Name: Barb Age: 15
Name: Carl Age: 16
[/pre]

What is your destination of interest??? HTML, RTF, PDF???

What PROC REPORT gives you by default is the NAMED option. It has a particular look and feel, but it does put the COLUMN header into EVERY report cell. But rather than a colon, it uses an = by default.

cynthia
[pre]
ods listing;
ods html file='c:\temp\shownamed.html' style=sasweb;
proc report data=sashelp.class nowd named ls=100;
run;
ods _all_ close;
[/pre]
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Cynthia-
Thank you that works!
However that leads to 2 more questions-
How can I get rid of that "box" around the variable
AND
is there is a way to change the paramter of how much space follows after a report-
I am "stacking" proc reports that will be exported onto a RTF document.

So that there is:
Proc report=data.x
Proc report=data.y

but I don't want the space between them or at least minimize it.
Thanks again!


Lawrence
Cynthia_sas
SAS Super FREQ
Hi:
Well, that "box" around each variable is the interior table line or border at the top, bottom and sides of each cell, controlled by the RULES style attribute (and the frame around the entire table is controlled by the FRAME style attribute).

You could try other STYLE= options.But since you said you were interested in RTF, the best style without any interior table lines for RTF is the JOURNAL style, which you would specify as:
[pre]
ods rtf file='c:\temp\showstyle.rtf' style=journal;
[/pre]

You might not need to use the STYLE(REPORT) override, if you like the way that JOURNAL looks by default. If you wanted to remove ALL interior table lines, you can also try:
[pre]
ods rtf file='c:\temp\shownamed.rtf';
proc report data=sashelp.class nowd named
style(report)={rules=none frame=void cellspacing=0};
run;
ods _all_ close;
[/pre]


The other way to minimize space is to turn off titles between each step:
[pre]
title 'First Proc Report';
proc report data=x;
run;

title;
proc report data=y;
run;
[/pre]

I assume that you have already discovered STARTPAGE=NO with ODS RTF to get as much onto a page as possible.

Also, for the original ODS RTF the default amount of space between tables is 2 or 4 carriage returns (and I think you get a section break between each output). I do not believe that behavior can be changed. However, for the new ODS TAGSETS.RTF destination, you can change a style attribute called PARSKIP, as described here:
http://support.sas.com/rnd/base/new92/92measuredrtf.html

and with an example in this previous forum posting:
http://support.sas.com/forums/thread.jspa?threadID=12610

cynthia
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Cynthia;
Will take a stab at it. Thanks for your assistance again.
~Lawrence
Ksharp
Super User
I like to use proc report + line statement.



Ksharp
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Cynthia;
The parameters of rules=none frame=void cellspacing=0 seem to work for HTML output but not for RTF. I am sure that I can set the parameters in a template somewhere?
The journal template did not want to play ball either with RTF outputs..

Lawrence
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Cynthia:
An FYI-I had consulted SAS technical support on the gridlines-
They had none and this may be a byproduct of the version of Microsoft??

Very interesting indeed.

Lawrence
Cynthia_sas
SAS Super FREQ
Hi, Lawrence:
Yes, it is a puzzlement.

Here's what I know. If I submit this code in SAS 9.2
[pre]
ods rtf file='c:\temp\usejournal.rtf' style=journal;
proc print data=sashelp.class(obs=5);
run;
ods rtf close;
[/pre]

and open the resulting file using Word 2010, I see the following:
-- No interior table lines, except for 1 border line above the header row, 1 border line between the header row and the data and 1 border line under the last obs.
-- All output is Black and White (no gray scale)

If I use this code:
[pre]
ods rtf file='c:\temp\usedefault.rtf' style=rtf;
proc report data=sashelp.class(obs=5) nowd
style(report)={rules=none frame=void cellspacing=0};
run;
ods rtf close;
[/pre]

Then I see the following (again, SAS 9.2 and Word 2010):
-- no interior table lines, no frame around the table
-- header cells are gray background with black foreground, all other cells are black and white

If you had told me that Excel was not respecting STYLE=JOURNAL, I would totally understand -- Excel is wonky with interior table lines and borders that come from SAS -- output will look one way in a browser and look totally different in Excel. But I have been using these particular style overrides with SAS and ODS RTF since ODS RTF first came out and STYLE overrides were supported (that was a LONG time ago).

If you run the code above, you should see similar results. If you were using a word processor other than Word (such as Open Office or Star Office, then the interior lines might be an issue). But I have been using these types of overrides as far back as Office 2000 with ODS RTF and have NEVER had issues such as you report.

So I'm not sure what's up with your system. Working with Tech Support is the way to go. However, I will respectully disagree with the statement that the style overrides "seem to work for HTML output but not for RTF". There would be no point in making a template change if it's not working in STYLE overrides. The attributes that you would change in a template would be the exact same attributes that aren't working in STYLE overrides.

cynthia
_LB
Fluorite | Level 6 _LB
Fluorite | Level 6
Cynthia;
Talking with tech support def gives rise that this may be a problem with my stsem somewhere as they had no issue either. I'll simply try at home and see what happens there as well and see if that make a difference. It makes no sense at all.

In the interim, I will continue w/ the "boxes" until I get to the bottom of this.
And yes I stand corrected or rather I amend the statement of
"seem to work for HTML output but not for RTF" to
"seem to work for HTML output but not for RTF on my system.

Thanks again for your help.

Lawrence

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
  • 9 replies
  • 1300 views
  • 0 likes
  • 3 in conversation