views:

775

answers:

7

The SAS display manager is a comamnd line interface to the SAS system, which remains in Base SAS as a legacy facility.

However the online documentation on how to use this facility is sparse at best, and google searches are less than fruitful.

A common DM command would be: CLEAR LOG; CLEAR OUTPUT; WPGM;

My question is - What other DM commands are out there?

+4  A: 

Some examples I have found useful (in open code format) are:

dm "vt &syslast"; * open a dataset ;
dm "keydef F2 'next VIEWTABLE:; end'"; * close ViewTable windows (credit cmjohns) ;
dm 'keydef f11 rsubmit'; * assigns the rsubmit command to the F11 key ;
dm "keydef F12 'cle log; cle output; submit'"; 
dm "next explorer; detail";  * applies detail view to explorer (credit to Liz);
dm "keydef F7 ""command focus;"""; * puts command bar in focus (credit to Trevor);
Bazil
+3  A: 

A couple of shortcuts I use (in addition to the cle <windowname>

  • fsv <datasetname> (opens a dataset using FS View)
  • vt <datasetmae> (opens a dataset using View Table)
  • subtop <N# of line> (submits the top N lines from the program editor)

One other useful feature.. Use the display manager menus to do the task that you want the command for. Then switch the commandline on and issue the ? command or (if necessary) a series of ? commands. This will retrieve back to the commandline the last command executed (even if that command was executed by the Display Manager menu system).

By looking at the previous commands executed, you can find a number of relatively obscure commands. I believe that EVERY display manager menu has its commandline equivalent which you can then use.

Jay Stevens
can you please expand on how the ? feature works? sounds very useful indeed!
Bazil
+4  A: 

Here are some links that have a large number of commands:

FSP Commands
Commands specific to Windows
AF Windowing Commands
Commands for the Program Editor (Scroll down to second paragraph)

cmjohns
+1  A: 

The link that cmjohns posted giving a list of commands is GREAT!

Some Additional Info about these commands...
You can set these commands as shortcuts in the SAS Display Manager.
Open DMKEYS (should be F2, or enter command 'keys'). DMKEYS shows you all of your default shortcuts, but you can modify it as you like.

For example:
I like to set F12=log;clear;pgm;submit; (This would 'clear all' from the Log Window and submit code from Program Editor)
You can also make it more intuitive with copy/paste...
Ctrl C=store
Ctrl V=paste

adam
+1  A: 

I set CTRL+F3 to 'rsubmit' - saves typing rsubmit / endrsubmit when developing code to go into remote production.

Chris J
I believe everyone who works in a complex system does something similar, regardless this is really great advice for someone who didnt know it :D +1
Fabio Prevedelli
+1  A: 

I like to close all view tables at once:

%macro closevts / cmd;

%local i;

%do i=1 %to 20;

next "viewtable:"; end;

%end;

%mend;

dm "keydef F12 '%NRSTR(%closevts);"; /**/

Chris
A: 

Some commands which open other useful windows include:

• assist - menu driven version of SAS
• dir - shows data sets in a library
• var - shows variables in a data set
• notepad - simple text window
• options - view and change system options
• filename - view current filename assignments
• help - interactive help system
• libname - view current libname assignments

Some useful display manager commands which work in any window include:

• clear - clear the contents of the window
• end - close the window
• endsas - end the sas session
• file "filename" - save contents of the window to filename
• prevcmd - recall previous display manager command

(extract from http://www.stat.berkeley.edu/classes/s100/sas.pdf )

Bazil