2017年12月1日 星期五

SAS DMKEY

問題:快速清除log與output
解決:使用 DMKEY
ref: Shortcuts to Save Time While Working with SAS
Back Up with Each Submit and Save Your Sanity
SAS Display Manager Commands

先按F9來編輯快速鍵,可以指定 F3 為
log; clear; output; clear; wpgm; submit;

它的意思依序是,跳到log視窗-->清除log-->跳output-->清除output-->跳editor-->執行你的code

當然也可以在program裡面,直接引用,方法如下:
dm "log;clear;out;clear; wpgm; submit;" ;

也有相同做用,只是做用的機制不同。

其他用法,持續補充:

  • include "某program",但要加submit
    include "某program";submit;
  • 在program editor以語法來設定F9裡面的keys
    dm "keydef F6 'log;clear;'";
    dm "keydef 'SHF F12' 'log;cle;output;cle;wpgm;end;wpgm;cle;'";
  • 重覆執行,可以關閉 view table
    dm 'next VIEWTABLE:; end;';
  • save the log to a permanent file, overwriting if necessary
    dm 'log; file "C:\My files\log 1 &sysdate9..log" replace';

SAS HELP有一點點相關的說明:
List of SAS Windows and Window Commands