首页 > 解决方案 > 如何编写 SAS 代码来打开 Viewtable 窗口?

问题描述

我想编写 SAS 代码来打开(和关闭)包含数据集的可视化窗口。你知道这样做的方法吗?

最好的

标签: sas

解决方案


DM语句将以编程方式发出显示管理器命令。您的程序将发出的命令是

  • viewtable打开可视化窗口
  • next使窗口处于活动状态
  • end根据活动窗口执行各种操作:
    • 可视化,关闭窗口
    • 编辑,提交代码
    • 记录,切换到编辑器

示例代码

假设 viewtable 是打开的,后续代码将重建正在查看的数据集。如果窗口未关闭,则重建将由于视图表锁定而失败。

* close the window presumed to be open, releasing the lock;
dm 'next viewtable; end;';  

* rebuild the data set;
data work.have;
  set sashelp.cars(obs=10);
run;

* what hath I wrought ?;
* open a viewtable window and bring it to the top;
dm 'viewtable work.have' viewtable;

推荐阅读