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.
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.
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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.