How to rotate column header in proc report

Reply
N/A
Posts: 0

How to rotate column header in proc report

Hi I am using sas 9.1 version.My output is in rtf and I am trying to get to rotate the header variables by 90 degrees.So far I have been un successful.
I even looked at on line programs but the rotate option is only available for sas 9.2

Can anyone please help me with this?

Thanks for your time.
Regards,
April.
Super Contributor
Super Contributor
Posts: 3,174

Re: How to rotate column header in proc report

Apparently, not a simple process using a STYLE=[...] override. A reference I found mentioned this paper and indicated that the only solution is a post-edit on the SAS-generated RTF document. As well as this paper, also recommend reviewing the Microsoft standard which is referenced in the paper below, for particulars.

Scott Barry
SBBWorks, Inc.

ODS RTF: Practical Tips
Cindy Tong, PPD Development
http://www.nesug.org/Proceedings/nesug03/at/at007.pdf
SAS Super FREQ
Posts: 8,721

Re: How to rotate column header in proc report

Hi:
Until you have 9.2 and TAGSETS.RTF, you might try some of the techniques shown in these previous forum postings:
http://support.sas.com/forums/thread.jspa?messageID=10428⢼
http://support.sas.com/forums/thread.jspa?messageID=7928Ỹ

cynthia
N/A
Posts: 0

Re: How to rotate column header in proc report

Hi eveyone,

Thanks a lot for your help.I will definately try it out.

Regards,
April.
N/A
Posts: 0

Re: How to rotate column header in proc report

Hi !
I tried using the code mentioned below with escapechar and n in proc report but the output it displays is A
nG
nE
is it because i am trying to output ods rtf file or is there something i am doing wrong.
Please advise.

Regards,
April.




proc report data=sashelp.class nowd; column name age height; define name / order 'N~nA~nM~nE'; define age / display 'A~nG~nE'; define height/ display 'H~nE~nI~nG~nH~nT';run;
SAS Super FREQ
Posts: 8,721

Re: How to rotate column header in proc report

Hi:
Do you have
ODS ESCAPECHAR='~';

in your code -- before the proc report step where you use ~n??? The other thing is that sometimes, you may need to use ~1n instead of ~n.

When I run this sample code, I get the expected results. If you are trying to open your LISTING window output in Word, then you will see/should see the ~n. Also, make sure that your PROC REPORT split character is NOT set to ~. You don't actually have to use ODS ESCAPECHAR to get each character in a header on a separate line...you could do it with just the SPLIT character, as shown in report #2.

cynthia

[pre]

ods listing close;
ods rtf file='c:\temp\vert_hdr.rtf';
ods escapechar='~';

proc report data=sashelp.class nowd split='#';
title '1) With Escapechar';
column name age height;
define name / order 'N~nA~nM~nE';
define age / display 'A~nG~nE';
define height/ display 'H~nE~nI~nG~nH~nT';
run;

proc report data=sashelp.class nowd split='#';
title '2) With Split Only';
column name age height;
define name / order 'N#A#M#E';
define age / display 'A#G#E';
define height/ display 'H#E#I#G#H#T';
run;
ods rtf close;
[/pre]
N/A
Posts: 0

Re: How to rotate column header in proc report

Thanks a lot Cynthia...
It helped and I did get the output but I was expecting it to rotate by 90 degrees.
Instead the the variables appeared as
P
I
D
instead i want the varibles to read as they read when I use rotate option in excel spreadhseet.I am unable to add the screen shot here to show you .
The code you sent outputs them aligned vertically and it does the job for now.

Please advise if there is a code or macros that will rotate them in sas 9.1 version.
Thanks again for your time and help.

Regards,
April.
SAS Super FREQ
Posts: 8,721

Re: How to rotate column header in proc report

Hi:
What you are seeing is the only kind of vertical header you can get -- easily. Headers are not really rotated, there is just the equivalent of a line feed or carriage return between each character in the header. Word and Excel do rotation differently.

With SAS 9.2, you can pass RTF rotation control strings to the table using TAGSETS.RTF, as described in this paper:
http://www.nesug.org/proceedings/nesug08/np/np11.pdf

Also described in the paper is the type of macro used by the paper author to post process a SAS 9.1 RTF file in order to rotate headers.

cynthia
N/A
Posts: 0

Re: How to rotate column header in proc report

Cynthia,

Thanks a lot for your time n patience with me.
I really appreciate your help.
The paper on macro was really helpful.I hope our company upgrades to sas 9.2
soon.

Regards,
April.
Ask a Question
Discussion stats
  • 8 replies
  • 1636 views
  • 0 likes
  • 3 in conversation