在 SASWorkspaceManager.WorkspaceManager 下调用 x 命令时不正确?
我编写了一些通过 x 命令调用 R 的 SAS 代码(我使用的是 SAS 9.1.3,因此 R 没有本机 SAS 接口)。
OPTIONS XWAIT XSYNC;
X """&r_path."" --no-save --quiet < ""&out_code_folder.\code.r"" > ""&out_code_folder.\abba.log""";
当我在 SAS IDE 中运行该代码时,该代码可以正常工作,但当我尝试使用 VBA 运行相同的代码时(此处 strSAScode 包含上述 SAS 代码)。
Dim obWM As SASWorkspaceManager.WorkspaceManager
Dim temp_dispaly_alert As Boolean
Dim sm As SAS_Management
Debug.Print strSASCode
Set sm = New SAS_Management
'Set obServerDef = New SASWorkspaceManagerServerDef
Set obWM = New SASWorkspaceManager.WorkspaceManager
Set obSAS = obWM.Workspaces.CreateWorkspaceByServer("MyServerName", VisibilityProcess, Nothing, "", "", "")
Set sm.obLS = obSAS.LanguageService
temp_dispaly_alert = Application.DisplayAlerts
Application.DisplayAlerts = False
sm.obLS.Submit strSASCode
现在,除了 x 命令之外,所有其他代码都可以工作。请帮忙。
I have written some SAS code that calls R via the x command (I am using SAS 9.1.3 so there is no native SAS interface to R).
OPTIONS XWAIT XSYNC;
X """&r_path."" --no-save --quiet < ""&out_code_folder.\code.r"" > ""&out_code_folder.\abba.log""";
This code works correctly when I run it in the SAS IDE but when I try to run the same code in VBA using (here strSAScode contains the above mentioned SAS code).
Dim obWM As SASWorkspaceManager.WorkspaceManager
Dim temp_dispaly_alert As Boolean
Dim sm As SAS_Management
Debug.Print strSASCode
Set sm = New SAS_Management
'Set obServerDef = New SASWorkspaceManagerServerDef
Set obWM = New SASWorkspaceManager.WorkspaceManager
Set obSAS = obWM.Workspaces.CreateWorkspaceByServer("MyServerName", VisibilityProcess, Nothing, "", "", "")
Set sm.obLS = obSAS.LanguageService
temp_dispaly_alert = Application.DisplayAlerts
Application.DisplayAlerts = False
sm.obLS.Submit strSASCode
Now every other code works, except the x command. Please Help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,由于潜在的安全风险,当通过使用集成技术的技术访问时,将禁用 SYSTEM 和 X 命令。
您是否按照此使用说明中所述的 Windows 9.1.3 步骤进行操作?
它描述了如何在 SAS 服务器上启用此功能;您可能需要调整工作区(而不是存储过程)、服务器的描述。
By default, use of SYSTEM and X commands is disabled when accessed via techniques that use integration technologies due to potential security risks.
Have you followed the steps for 9.1.3 on Windows described in this usage note?
It describes how to enable this functionality on your SAS server; you may need to adapt what's described for the workspace, instead of the stored process, server.