BookmarkSubscribeRSS Feed
LzyButEfficient
Calcite | Level 5

I've notice this weird behavior in SAS that changing orientation from default portrait to landscape sometimes doesn't apply on first run/print of ods rtf.  Running again resolves this problem.  I don't know what causes SAS to not apply change to orientation on first run.

Is there a way to guarantee that SAS will always apply orientation=landscape on first print?

Thanks.

3 REPLIES 3
ballardw
Super User

Show your code.

 

ODS RTF determines some of the system setting type things, such as orientation, from the status in effect when the ODS RTF statement executes. So if you are setting the orientation after the ODS RTF statement that is the most likely issue.

 

Secondary is if you are calling macros or %include files and don't pay attention to the contents they might be changing system options.

LzyButEfficient
Calcite | Level 5

The options is called before ods rtf. %include programs do not contain code to reset orientation, the first options orientation=landscape is the only place it appears in code.

 

ods results on;
ods escapechar="^";
options nodate nonumber orientation=landscape pageno=1 mlogic mprint center missing=" ";
ods listing close;
%include "&SASCODE\REPORT_TEMPLATE.SAS";

ods rtf file="&Output\CTR-Tables_ExportDate_&DataExportDate._PrintedOn_%sysfunc(date(),date9.).rtf" style=custom startpage=no NOTOC_DATA wordstyle='{\s1 Heading 1;}';
ods noproctitle;
ods rtf startpage=now;
Ksharp
Super User
You need re-active ODS RTF.

............
...........
options orientation=landscape;
ods select none;
ods rtf startpage=now ;
proc print data=sashelp.class;run;
ods select all;

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 3058 views
  • 0 likes
  • 3 in conversation