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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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.

BASUG is hosting free webinars Next up: Don Henderson presenting on using hash functions (not hash tables!) to segment data on June 12. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
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.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 16 replies
  • 745 views
  • 7 likes
  • 6 in conversation