在 SASWorkspaceManager.WorkspaceManager 下调用 x 命令时不正确?

发布于 2024-09-18 12:12:58 字数 955 浏览 1 评论 0原文

我编写了一些通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

邮友 2024-09-25 12:12:58

默认情况下,由于潜在的安全风险,当通过使用集成技术的技术访问时,将禁用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文