BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
NKormanik
Barite | Level 11

SAS 9.4

 

When current SAS code completes, the last window open, on top, is the "Results" window.

User wants SAS to return to the "Log" window, programmatically.

The answer, via searching, seems to be:

/* Command to switch to the Log window and maximize it */
dm 'log; wmaximize;';

Unfortunately, that doesn't seem to work.  Seems to be entirely ignored.  Top window continues to be "Results".  Even though the above command does appear in the log window (when user manually returns there, by way of mouse click on log 'tab').

 

Suggestions greatly appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@NKormanik wrote:

I prefer to drag my SAS scripts from Windows Desktop (or Explorer) to the SAS Log window.

 

One after another.

 

That's why I would prefer PC SAS to end up with the Log window on top at the end of running a script.  Just one less hassle.

 


So change your Preferences.  Unclick this box in the Results panel.

Tom_0-1718327564531.png

 

View solution in original post

16 REPLIES 16
whymath
Lapis Lazuli | Level 10
DM statement only take effects in windowing environment, not in EG. Are you using EG(Enterprise Guide)? If so, you may need to use your mouse, there is a switch in: Tools > Options > Result
SASKiwi
PROC Star

Defining a function key that both runs the code, then goes to the LOG window works for me: submit;log

yabwon
Onyx | Level 15

As @whymath wrote the DM statement works only in Display Manager environment, i.e., this one:

yabwon_0-1718177002155.png

and as you can see in the help window, documentation confirms the fact.

 

If your code is executed in SAS Enterprise Guide, SAS Studio, or even Visual Studio Code with SAS extension, the DM wont do a thing, it will be ignored.

 

Bart

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



NKormanik
Barite | Level 11

"DM statement works only in Display Manager environment..."

 

What we have to do, then, is define Display Manager environment.

Aren't all the SAS 9.4 'windows' included?

 

If we run a script in SAS 9.4, are we running that script in the DM environment?

 

 

 

 

SASKiwi
PROC Star

There are three SAS-supplied development interfaces to SAS 9.4:

You can run SAS scripts in any of these interfaces and also from operating system command lines as a batch job.

DM statements (short for Display Manager) only work in the first interface, not the other two. I suggest you explore the above links to find out more about each interface.

 

NKormanik
Barite | Level 11

Yep, SAS 9.4, what I said at the outset should work, but doesn't.

/* Command to switch to the Log window and maximize it */
dm 'log; wmaximize;';

 

Perhaps give it a try in some script.  Put it at the end of the script.

The objective is to end up with the 'Log' window on top, maximized.

 

Maybe DM commands do not work from scripts?

 

yabwon
Onyx | Level 15

The <DM> statement is IDE/GUI dependent. 

 

If your program runs in Batch (hard to call it IDE, I know), SAS Enterprise Guide or SAS Studio the <DM> won't work.

If your program runs in SAS Windowing Environment (aka SAS Display Manager aka SASDM) then <DM> will work.

 

So unless the user/customer you're writing about works in SASDM then the <DM> statement won't help.

 

Bart

 

 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Quentin
Super User

How are you running SAS?  Which application do you open when you submit SAS code?  Are you using SAS Enterprise Guide?  Or SAS Studio?  Or visual studio code (unlikely)? Or "PC SAS"?

If you don't know, can you post a screen shot of your SAS interface, as it looks when you are viewing the log, and include all of the menus and windows on the screen?  If it looks like the picture that @yabwon posted, then DM commands should work.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
NKormanik
Barite | Level 11

I prefer to drag my SAS scripts from Windows Desktop (or Explorer) to the SAS Log window.

 

One after another.

 

That's why I would prefer PC SAS to end up with the Log window on top at the end of running a script.  Just one less hassle.

 

Quentin
Super User

@NKormanik wrote:

I prefer to drag my SAS scripts from Windows Desktop (or Explorer) to the SAS Log window.

 

One after another.

 

That's why I would prefer PC SAS to end up with the Log window on top at the end of running a script.  Just one less hassle.

 


Ahh, I missed this post.  I've been using PC SAS for 25 years.  Never knew until today that if you drag a .sas file into the log window it submits the code.  That's wild.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
NKormanik
Barite | Level 11

Or even a .txt file.

 

Easy peasy.

 

Tom
Super User Tom
Super User

@NKormanik wrote:

I prefer to drag my SAS scripts from Windows Desktop (or Explorer) to the SAS Log window.

 

One after another.

 

That's why I would prefer PC SAS to end up with the Log window on top at the end of running a script.  Just one less hassle.

 


So change your Preferences.  Unclick this box in the Results panel.

Tom_0-1718327564531.png

 

SASKiwi
PROC Star

@NKormanik - Looks like you haven't read my workaround above using a function key defined as submit;log. I tried it myself and it worked.

NKormanik
Barite | Level 11

I did indeed.  Works nicely.  Thank you!

However, I'd still prefer PC SAS end up with the Log window top-most.

 

Such a simple request.

 

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
  • 16 replies
  • 1647 views
  • 7 likes
  • 6 in conversation