0

很长一段时间以来,我一直有兴趣在 SAS 中寻找 UI 的替代方案。我们在我们的服务器而不是我们的桌面上授权 SAS,因此我们还必须启动一个远程桌面应用程序来执行代码。

我能够使用 Telnet 连接来远程连接到服务器,并批量执行 SAS 程序。然后我感兴趣的是是否可以制作一个python脚本来远程连接,并批量执行代码,并且这个脚本可以在jEdit中作为一个BeanShell脚本执行。

到目前为止,我有成功打开和关闭 Telnet 连接的 Python 代码。它可以执行基本的 shell 功能,例如调用“dir”。但是,当我使用 Python 中的 telnet 连接通过远程服务器上的命令提示符执行 SAS 所用的完全相同的行时,什么也没有发生。

服务器是否有可能阻止我从脚本执行代码?在运行任何代码之前,我对提示使用“read_until”语句。

4

2 回答 2

0

Here's a few ideas...

The issue you are having above may be related to Local Security Policy settings in Windows (if it is running on a windows server). I'm far from an expert on that stuff but I remember older SAS/Intranet installations required some rumaging around in there to get them working.

As an alternative to the approach you are trying above you could also setup a SAS session on the server that listens for incoming socket requests as per this article:

http://analytics.ncsu.edu/sesug/2000/p-1003.pdf

And finally... Not sure if this helps or not by I remotely execute SAS jobs using PSEXEC. A description of how I set it all up can be found here:

http://www.runsubmit.com/questions/260/hide-sas-batch-jobs-winxp

Good luck

于 2011-12-12T04:55:47.117 回答
0

本文概述了如何使用 Python 脚本通过 SSH 连接到 Unix 服务器,将本地编写的 SAS 程序复制到服务器上,批量提交,然后将结果下载回本地机器,所有这些都使用 BeanShell 宏脚本j编辑。

于 2013-11-20T18:45:46.910 回答