DM Statement

Submits SAS Program Editor, Log, Procedure Output or text editor commands as SAS statements.
Valid in: Anywhere
Category: Program Control

Syntax

Arguments

window
specifies the active window.
Default:If you omit the window name, SAS uses the Program Editor window as the default.
'command(s)'
can be any windowing command or text editor command and must be enclosed in single quotation marks. If you want to issue several commands, separate them with semicolons.
CONTINUE
causes SAS to execute any SAS statements that follow the DM statement in the Program Editor window and, if a windowing command in the DM statement called a window, makes that window active.
Note:For example, if you specify Log as the active window and have other SAS statements that follow the DM statement (for example, in an autoexec file), those statements are not submitted to SAS until control returns to the SAS interface.
Tip:Any windows that are activated by the SAS statements (such as the Output window) appear before the window that is to be made active.

Details

Execution occurs when the DM statement is submitted to SAS. You can use this statement to modify the windowing environment:
  • Change SAS interface features during a SAS session.
  • Change SAS interface features at the beginning of each SAS session by placing the DM statement in an autoexec file.
  • Perform utility functions in windowing applications, such as saving a file with the FILE command or clearing a window with the CLEAR command.
Window placement affects the outcome of the statement:
  • If you name a window before the commands, those commands apply to that window.
  • If you name a window after the commands, SAS executes the commands and then makes that window the active window. The active window is opened and contains the cursor.

Examples

Example 1: Using the DM Statement

  • dm 'color text cyan; color command red';
  • dm log 'clear; pgm; color numbers green' 
       output;
  • dm 'caps on';
  • dm log 'clear' output;

Example 2: Using the CONTINUE Option with SAS Statements That Do Not Activate a Window

This example causes SAS to display the first window of the SAS/AF application, executes the DATA step, moves the cursor to the first field of the SAS/AF application window, and makes that window active.
dm 'af c=your-program' continue;
data temp;
   . . . more SAS statements . . .
run;

Example 3: Using the CONTINUE Option with SAS Statements That Activate a Window

This example displays the first window of the SAS/AF application and executes the PROC PRINT step, which activates the OUTPUT window. Closing the OUTPUT window moves the cursor to the last active window..
dm 'af c=your-program' continue;
proc print data=temp;
run;