DATA Step, Macro, Functions and more

Get SAS to avoid jumping to the results viewer when i run some code

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Get SAS to avoid jumping to the results viewer when i run some code

 

 

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?

 

 

 


Accepted Solutions
Solution
‎04-14-2016 05:51 AM
Trusted Advisor
Posts: 1,115

Re: Get SAS to avoid jumping to the results viewer when i run some code

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.

 

 

View solution in original post


All Replies
Super User
Super User
Posts: 7,392

Re: Get SAS to avoid jumping to the results viewer when i run some code

Hi,

 

Try:

ods noresults;

 

Occasional Contributor
Posts: 14

Re: Get SAS to avoid jumping to the results viewer when i run some code

[ Edited ]

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

Solution
‎04-14-2016 05:51 AM
Trusted Advisor
Posts: 1,115

Re: Get SAS to avoid jumping to the results viewer when i run some code

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.

 

 

Occasional Contributor
Posts: 14

Re: Get SAS to avoid jumping to the results viewer when i run some code

 

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. 

 

Trusted Advisor
Posts: 1,115

Re: Get SAS to avoid jumping to the results viewer when i run some code


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.

SAS Super FREQ
Posts: 682

Re: Get SAS to avoid jumping to the results viewer when i run some code

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

Super User
Super User
Posts: 6,498

Re: Get SAS to avoid jumping to the results viewer when i run some code

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

Occasional Contributor
Posts: 14

Re: Get SAS to avoid jumping to the results viewer when i run some code

 

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

 

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

 

Udklip.PNG

Super User
Posts: 10,483

Re: Get SAS to avoid jumping to the results viewer when i run some code

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 9 replies
  • 466 views
  • 1 like
  • 6 in conversation