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

When running a X command in SAS Interactive 9.4 1M3, if I have a windows explorer window open and not minimized it will cause the explorer window to come forward and shift SAS Interactive to the background, as though I ALT-TAB'd to Explorer. Is there a way to prevent this from occuring?

 

If I minimize the Windows Explorer window, or don't have one open at all, then no focus shift occurs.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

That's odd. Have you tried using the noxwait and noxsync options see if they make a difference?

View solution in original post

15 REPLIES 15
ChrisNZ
Tourmaline | Level 20

That's odd. Have you tried using the noxwait and noxsync options see if they make a difference?

asumsie
Obsidian | Level 7

This is on Windows 7 Professional.

 

The issue can be modulated with XSYNC/NOXSYNC.

 

Causes focus shift to Windows File Explorer and SAS Interactive to go to background focus:

options noxwait xsync;

x '"C:\Program Files\Microsoft Office\Office15\EXCEL.EXE"';

 

SAS Interactive stays in foreground:

options noxwait noxsync;

x '"C:\Program Files\Microsoft Office\Office15\EXCEL.EXE"';

ballardw
Super User
Does Excel open as well? I no longer have Office 15 installed but the equivalent code for my version opens Excel and shifts the focus to Excel, which is what I would expect to happen.
asumsie
Obsidian | Level 7

The focus shift happens when I issue any X command with option XSYNC.  Opening Excel is an example I can provide publically. Excel does indeed open but prior to Excel opening, SAS is shifted to the background, File Explorer shifts to the foreground, then Excel opens in the foreground.

Reeza
Super User

@asumsie wrote:

The focus shift happens when I issue any X command with option XSYNC.  Opening Excel is an example I can provide publically. Excel does indeed open but prior to Excel opening, SAS is shifted to the background, File Explorer shifts to the foreground, then Excel opens in the foreground.


That's what I would expect to happen.

asumsie
Obsidian | Level 7

Why would you expect Windows File Explorer to shift to the foreground?

Reeza
Super User

Sorry, just tested. No, it doesn't switch to Windows File Explorer, it switches off of SAS to the Microsoft Command interface which isn't shown, but is being used to execute the command. It's the black command line screen.

 

X command are really just any command you type into the Run interface and it switches to 'that'. 

 

If you close (not minimize) all windows explorer windows, it actually opens a windows explorer instance?

 

I tested this on Windows 7 Enterprise

 

 

 

 

asumsie
Obsidian | Level 7

Thanks, Chris - there's nothing in the documentation nor would I naturally anticipate a synchronization option to cause Windows File Explorer window to shift to foreground. I'll consider this a bug.

Reeza
Super User

I re-read your initial question, and that matches what I see. 

 

I'm going to guess the Windows command line tool and Windows Explorer are 'linked' and that this is actually on Windows side. Since you can execute a command from windows explorer by typing in cmd + Command. 

 

 

ChrisNZ
Tourmaline | Level 20

@asumsie

I am guessing that since you call the CLI window, SAS goes to the background, and since you choose not to display the CLI window, Windows defaults to the default "shell", i.e. Explorer. 

I can't test since I am stuck with EG, but this looks more like a Windows "feature" than a bug. 

I must admit I never paid attention to the sequence of what's displayed when I used SAS Desktop and the X command, and it also may well be different for different versions of Windows.

ballardw
Super User

Are you sure that the window isn't a command window?

Or perhaps you should show the specific X command you are issuing.

With 9.4.4 a basic X command on my system opens a command window.

Reeza
Super User

What does your code look like? Perhaps there's a mistake in your X command. 

 

What version of Windows are you using?

Reeza
Super User

Just an FYI - if you're using DDE in your code, you CANNOT use your computer while it's running and need to wait for it to finish. You'll get weird behaviours if you do. 
I've seen it dump the data into Outlook instead if I switched the 'focus' there instead.

asumsie
Obsidian | Level 7

There's no use of DDE in this example.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 1441 views
  • 2 likes
  • 5 in conversation