How do I get SAS to not jump to the results viewer when i run some code.
I have my SAS set up in two screens, with the editor, results viewer and the log all visible.
My workflow is that I write some code, run it, and check the result in the log and the results viewer. Then I edit the code and repeat.
But when I run some code, the results viewer becomes the active window, so then I need to navigate back to the editor (which breaks my trains of thought, and takes unnecessarily long time.
So any ideas on this?
Hello @rasmuslarsen,
I was also wondering how you're going to "check the result in the log and the results viewer" after suppressing the (ODS) output via ODS NORESULTS. Also, doesn't the focus now switch to the output window rather than the results viewer?
Here's a different approach, assuming that you use a function key (such as F8) to submit your code:
This should make the Enhanced Editor the active window after submitting code.
If the KEYS setting is lost after closing the SAS session or you encounter error messages like
ERROR: File I/O Error. Unable to permanently save KEYS settings. ERROR: Cannot open entry DMKEYS.KEYS for write access - catalog SASUSER.PROFILE is opened for read access.
open SAS (once) with the NORSASUSER option in effect to make the change to the KEYS setting.
[Edit 2019-04-30: Reattached screenshot, which had been deleted by mistake.]
Hi,
Try:
ods noresults;
Thank you but the effect of this is that the results are not updated. What I am looking for is avoiding that the results viewer becomes the active window, when running some code (but that the results are still updated).
Hello @rasmuslarsen,
I was also wondering how you're going to "check the result in the log and the results viewer" after suppressing the (ODS) output via ODS NORESULTS. Also, doesn't the focus now switch to the output window rather than the results viewer?
Here's a different approach, assuming that you use a function key (such as F8) to submit your code:
This should make the Enhanced Editor the active window after submitting code.
If the KEYS setting is lost after closing the SAS session or you encounter error messages like
ERROR: File I/O Error. Unable to permanently save KEYS settings. ERROR: Cannot open entry DMKEYS.KEYS for write access - catalog SASUSER.PROFILE is opened for read access.
open SAS (once) with the NORSASUSER option in effect to make the change to the KEYS setting.
[Edit 2019-04-30: Reattached screenshot, which had been deleted by mistake.]
Thanks. Strangely this does not work on my machine. The focus remains on the results-viewer after I've submitted some code,
despite the suggested addition to F3 and F8 ( tried both, none of them worked ).
For checking purposes this is what my keys look like:
However from your answer I've learned that I can use F5 to focus back on the editor. So I will settle for that workaround for now.
@rasmuslarsen wrote:
Thanks. Strangely this does not work on my machine. The focus remains on the results-viewer after I've submitted some code,
That's interesting. I've just replicated your issue: On my computer it seems that it works only if the checkbox "Create listing" in the Results tab of Tools --> Options --> Preferences... is ticked (in addition to "Create HTML", i.e., listing output is produced in parallel). In this case the title bar of the results viewer shows the path to the HTM file produced. When I uncheck that checkbox, the title bar says "Results Viewer - SAS Output" and the focus remains on that window even after pressing F5 (which then seems to refresh the results viewer window). In both cases the settings in section "Results options" (still on the Results tab) were "View results using: Internal Browser" and both checkboxes ticked.
Normally I use only listing output.
I assume you are using the SAS windowing environment on windows.
If you go to Tools -> Options -> Preferences
You can set certain options like above. Setting it this way the Results window ist not opened and you stay in your editor. When you switch to the results window, press F5 so the it is refreshed, and you will get t see the latest outputs.
Bruno
Does the Results window support the AUTOPOP command like the LOG and OUTPUT windows?
Thanks. But on my machine F5 does focus on the results viewer.
These are my keys, maybe something is wrong in them:
What environment are you running, Base SAS, EG, Studio? And which version?
And how do you submit you code to run?
In Base SAS 9.2 using a function key assigned from the KEYS window that is just Submit the focus stays in (or at least returns to ) the editor.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.