如何抑制 SAS proc sql 执行语句中的错误消息
我使用 SAS proc sql 执行语句来运行 sql 并访问 Oracle 服务器上的表。为了让脚本自动运行,我通常在创建表或索引之前删除它们。然而,有时,当 drop sql 代码运行时,表或索引不存在。 SAS 中将记录一条有关删除不存在的内容的错误消息。但由于 SAS 代码在删除后会继续运行,因此这种错误消息根本不重要。我想抑制这些错误消息,阻止 SAS 记录它们,因为我不关心它们。我怎样才能在 proc sql 中做到这一点?
感谢您的任何帮助。
I use SAS proc sql execute statement to run sql and access tables on Oracle server. In order to let the script run automatically, I normally drop tables or indice before creating them. Sometimes however, when the drop sql code runs, the table or index doesn't exist. An error message will be logged in SAS about dropping something that doesn't exist. But since the SAS code will continue after the drops, this kind of error message doesn't matter at all. I want to suppress these error messages, stop SAS from logging them because I don't care about them. How can I do this in proc sql?
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道有什么选项可以抑制这种单一类型的错误。不过有几个选择。
最好的办法是清理代码,以便在尝试对其进行操作之前检查数据集是否存在:
%if %sysfunc(exist(&name_of_data_set)) %then %do;
您还可以在这些步骤中重定向所有日志记录,在这些步骤中您会通过 proc printto 收到您不想要的消息,但您可能会丢失有价值的信息。
I'm not aware of an option to supress this single type of error. There are a couple of options though.
The best bet is to clean up your code so you check to see if the data set exists before trying to act on it:
%if %sysfunc(exist(&name_of_data_set)) %then %do;
You could also redirect all logging during these steps where you get messages you don't want with
proc printto
, but you would potentially lose valuable information.