打开 SAS 数据集以便从 .sas 程序中查看
有没有办法从 .sas 文件中打开 SAS 数据集进行查看(即在“ViewTable”窗口中)?
Is there a way to open a SAS dataset for viewing (i.e., in the "ViewTable" window) from within a .sas file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为这将满足您的要求:
dm log "vt sashelp.air";
只需将
"sashelp.air"
部分更改为您的lib.table< /代码> 组合。
I think this will do what you want:
dm log "vt sashelp.air";
Just change the
"sashelp.air"
part to yourlib.table
combo.dw.mackie 的答案是正确的。 从 SAS 编辑器窗口提交时效果非常好。
但我只是想提醒您,如果您尝试以批处理模式(即让 SAS 使用 -sysin 选项直接从命令行运行 .sas 程序),请务必小心。 它确实会在执行时尝试弹出交互式 SAS 窗口环境。
但是,如果您的批处理代码还尝试构建一些图形/图表,则您将需要使用 -noterminal 选项。 并且 -noterminal 选项与 dm 命令不兼容。 您会立即在日志中发现它,但我只是想提醒您一下。
dw.mackie's answer is right on the money. That works great when submitted from the SAS editor window.
But I just want to caution you to be careful if you attempt it in batch mode (that is, having SAS run a .sas program directly from command-line using the -sysin option). It will indeed attempt to pop open the interactive SAS window environment upon execution.
But, if your batch code also attempts to build some graphs/charts, you'll be required to use the -noterminal option. And the -noterminal option isn't compatible with the dm command. You'd spot it right away in the log, but I just wanted to give you a heads-up.
由于我的一些数据集的大小,我只做了一个简单的过程打印,并将输出限制为仅 50 个观察值。 我经常这样做,因此我创建了以下宏,将输出转储到 html 文件。
数据集测试的示例调用如下所示
Because of the size of some of my datasets I just do a simple proc print and limit the output to only 50 observations. I do this so often that I created the following macro that dumps the output to a html file.
Sample call for dataset test looks like