Search code examples
sessionsaswindowstartup

Managing windows when local SAS session starts


When a SAS session starts, there are 5 windows. (Result Viewer, Explorer, Log, Editor, Output).

My desired state is when the session starts:

  • No result viewer
  • No output window
  • No default explorer window
  • The useable explorer window default open(to clarify this i attached a picture) Good/Bad explorer window
  • Enchanced editor open
  • Log window open

So there will be 3 windows opened at session start, and i would like to resize them into 3 columns.

What i got so far:

  1. I know the task can be done, because i was able to do this on my working computer. Unfortunately they reinstalled my windows without a word, and i lost my setup. And i did not have my autoexec/sasv9cfg file backuped. :(
  2. I can close the output window with dm listing off command in my autoexec.
  3. I can resize the 3 windows if i have them, with dm wdef command as well.

My biggest issue is i cant find again a DM/ODS or any kind of command, which closes the Result Viewer, and the original Explorer, and opens the normal/usable Explorer. In my faded memories i needed only 1 DM/ODS/sth command to achieve these 3 steps at once. Of course, if we can find a solution in more steps, thats also completely fine.

Big thx for any kind of help


Solution

  • You do not want the DMSEXP docked windows (which includes ODS Results tab) at session start up. The only way to do this programmatically is to specify the SAS system option -nodmsexp in the sas.exe command line or config.sys.

    So, on my system, I set the target command on my SAS icon to be:

    "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe"
      -CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"
      -NODMSEXP
    

    Tweak the SAS DM session window states by placing this code in your autoexec.sas

    dm 'dmsexp;tree on;next;listing off;tile vert' ;
    

    You can also fiddle around with your session start up using the system options:

    • initstmt=
    • initcmd