I am running a proc freq and the output format I selected is RTF. It is generating output in portrait but I want it in landscape, or the smallest font (so my output is not broken up on different pages width-wise). I am opting for the landscape option right now. The problem is: I don't know how to change the setting for the RTF to landscape. Anyone have any ideas on this?
The method for setting orientation is a SAS Option. It works for the LISTING, RTF and PDF destinations:
ods rtf file='somefile.rtf';
... code ..
ods rtf close;
For RTF only, you can CHANGE orientations -- for example, you had one report that you wanted in portrait (perhaps from PROC PRINT) and then a second report in the same document that you wanted in landscape (perhaps from PROC TABULATE). This Tech Support note explains how to do that: http://support.sas.com/kb/24/559.html
A lot of the SAS options can be set inside EG, but some have to be specified in code or by inserting them in your task. Generally, EG generates the ODS "sandwich" statements for you -- so if you select RTF under the EG options menu, (the menu choice to select output type), then you will never see the ODS RTF "sandwich" statements.
To add the OPTIONS statement to your task code, then while you're still inside your task and before you do the submit, select the "Preview Code" button. When the preview window opens, look for the button that says "Insert Code" and click it. Then, when you scroll through the generated code, you will see places marked in gray where you can insert your own code. At the top of the file, look for the first place to insert code ABOVE a PROC step. (A SAS Options statement cannot bet inside a PROC step.) Then, double click on the gray line for to enter insertion mode.
Once the custom code window opens, type: [pre]
The above 2 lines are needed if you have selected RTF as the result type because normally, your options statement would be outside the ODS RTF sandwich. When you're in EG, you never actually see the ODS RTF sandwich -- so you have to tell ODS RTF to pay attention to the changed option. That's what the ODS RTF; statement does -- it's just alerting ODS RTF to the fact that you've issued a new option.
You could also put this code into a custom code node to be submitted before EVERY task, but this is probably not a good idea, since you may not want EVERY task going to an RTF file or in landscape mode.
Cynthia describes the sandwich of code that EGuide wraps around the task code. Is there a way to 'turn off' the sandwiching? When I insert the
in my code node, I suddenly get two (identical) RTF documents in the project and the process flow looks really messy. The second file is named
c:\windows\system32\sasrtf.rtf (it seems a strange place and potential security flaw) for every task. There is only one file, the last task run 'wins', but the icon is there for every task.
Turning off the sandwich may not be the right way to solve the problem, so I'm open to other ideas. Or is this a problem for tech support?
You might try leaving off the ODS RTF statement and just put the options statement. The time I tested this, I needed the extra ODS RTF statement to make landscape take effect. Depending on where you set the option, you may not need it (the blank ODS RTF statement).
The other thing you could try is just entering the ods _all_ close; to close what eg has opened up.
Using the techniques that Cynthia and Chris stated, I turned "off" the EGuide sandwich. I pasted the sandwich code back into my program. However, I found that turning off the sandwich turns off a lot more than just the code (the "law" of unintended consequences).
I got down to one file. It was uniformly named EGRTF for every output (as I had just copied the sandwich code). When I changed the name, it put it on my c-drive. The name was also limited to 8 characters (as it was now being picked up through the FILENAME statement).
The long term solution probably needs to be an option in Tools to specify landscape.
Martin, in tech support, also sent this. Either work well for setting the default output to LANDSCAPE.
"If you know that you want the default orientation for your output to be in landscape mode, one option is for you to add the following OPTIONS statement to your egauto.sas file:
You will find your egauto.sas file in:
C:\Documents and Settings\your-userid\Application Data\SAS\Enterprise Guide\4
The first time after making this change, you will need to stop and restart Enterprise Guide. Another option is to do the following...
From the Enterprise Guide pulldown options menu, select TOOLS and then OPTIONS. Then, on the left-hand side, select SAS PROGRAMS. On the right-hand side, click the checkbox to the left of the option titled:
Insert custom SAS code before submitted code.
Then, click the EDIT box to the right of the label above and in the custom code window, add:
Thanks so much for your post. I followed all the examples shown in the posts, but for some reason your post is the one that resolved my issue. Thanks for taking time to post your responses to help out a "noob".