如何让 sas 同时登录外部位置和 sas 企业指南 [英] How to have sas log in both external location and sas enterprise guide
问题描述
我正在使用 sas,例如 5.1 版本.现在我正在将我的日志详细信息路由到一个外部文件(文本文档)以进行记录.但是在开发代码时,我希望错误日志也出现在 sas egp 日志窗口中,以便调试更快更容易
I am using sas eg 5.1 version. right now I am routing my log details to an external file(text document) for record keeping. But while developing a code, I want the error log to appear in the sas egp log window also, so that it makes debugging faster and easy
所以我的问题是如何在 sas egp 和外部文件中同时保存 sas 日志详细信息
我尝试搜索它,但无法获得详细信息.
I tried searching for it, but could not get the details.
提前致谢
推荐答案
没有会话中"可编程选项可将日志写入多个目标.然而,一个体面的hack"是简单地读取您的外部日志并写出您的会话日志,如下所示:
There is no 'in session' programmable option to write the log to multiple destinations. However a decent 'hack' is to simply read your external log and write out to your session log as follows:
/* write to external log */
filename tmp "C: empmylog.txt";
proc printto log=tmp; run;
/* now run your SAS code */
%put NOTE: processing lots of juicy SAS statements;
/* once done, return to normal logging */
proc printto log=log; run;
/* print previous log to current session */
data _null_;
infile tmp;
input; list;
run;
/* close filename */
filename tmp clear;
为确保您始终将日志写出/取回,您甚至可以将上述内容拆分为以下位置:
To ensure you always write the log out / get it back, you could even split the above into the following locations:
其他选项:
管理员可以启用日志记录 在应用程序(工作区)服务器上.这将捕获所有用户的所有日志 - 这确实会影响性能和存储!步骤如下:
An admin can enable logging on the application (workspace) server. This will capture all logs, from all users - which does have performance and storage implications! Steps as follows:
- 导航到:[sasconfig]Lev1SASAppWorkspaceServer
- 将 logconfig.xml 重命名为 logconfig.xml.orig
- 将 Logconfix.trace.xml 重命名为日志配置.xml
- 重启对象生成器
@Quentin/@Reeza 在此提出的另一种方法(非常相似)问题,是在SAS调用时使用-altlog
选项.
Another approach, as proposed by @Quentin / @Reeza in this (very similar) question, is to use the -altlog
option at SAS invocation.
最后,如果合适,您可以考虑启用 EG 项目日志.
Finally, if it suits, you could look at enabling the EG project log.
这篇关于如何让 sas 同时登录外部位置和 sas 企业指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!