BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
rasmuslarsen
Obsidian | Level 7

 

 

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?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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:

  1. Open the KEYS window (by pressing F9 or entering "keys" into the command line).
  2. Add the WPGM command to the key you use for submitting code (see screenshot below).
  3. Close the KEYS window.

This should make the Enhanced Editor the active window after submitting code.

keys_window.png

 

 

 

 

 

 

 

 

 

 

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

View solution in original post

9 REPLIES 9
rasmuslarsen
Obsidian | Level 7

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

FreelanceReinh
Jade | Level 19

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:

  1. Open the KEYS window (by pressing F9 or entering "keys" into the command line).
  2. Add the WPGM command to the key you use for submitting code (see screenshot below).
  3. Close the KEYS window.

This should make the Enhanced Editor the active window after submitting code.

keys_window.png

 

 

 

 

 

 

 

 

 

 

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

rasmuslarsen
Obsidian | Level 7

 

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:

Udklip.PNG

 

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. 

 

FreelanceReinh
Jade | Level 19

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

BrunoMueller
SAS Super FREQ

I assume you are using the SAS windowing environment on windows.

 

If you go to Tools -> Options -> Preferences

Capture.PNG

 

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

Tom
Super User Tom
Super User

Does the Results window support the AUTOPOP command like the LOG and OUTPUT windows?

rasmuslarsen
Obsidian | Level 7

 

Thanks. But on my machine F5 does focus on the results viewer.

 

These are my keys, maybe something is wrong in them:

 

Udklip.PNG

ballardw
Super User

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.

SAS Innovate 2025: Register Now

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!

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
  • 9 replies
  • 3080 views
  • 2 likes
  • 6 in conversation