BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
8 REPLIES 8
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
Hi eveyone,

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

Regards,
April.
deleted_user
Not applicable
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;
Cynthia_sas
SAS Super FREQ
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]
deleted_user
Not applicable
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.
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
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.

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!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 8 replies
  • 3911 views
  • 0 likes
  • 3 in conversation