在新实例中打开SAS程序 [英] Open SAS program in new instance

查看:194
本文介绍了在新实例中打开SAS程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出一种方法,默认情况下单击该方法即可在增强编辑器的新实例中打开SAS程序.

I'm trying to figure out a way to open SAS programs in new instances of the Enhanced Editor by default on click.

问题已经提出,但没有成功.

The question has been asked before but no luck.

本文描述了打开程序的方式使用增强型编辑器.完整的命令是:

This paper describes the way a program is opened with the Enhanced Editor. The full command is :

"C:\PROGRA~1\SASHome\SASFOU~1\9.3\core\sasexe\SASOACT.EXE" action=Open
datatype=SASFile filename="%1" progid=SAS.Application.903 

作者解释说:

sasoact.exe程序用于启动SAS的OLE自动化会话. 自动化 是一种机制 一个Windows应用程序可以以编程方式控制另一个应用程序.双击SAS文件时 键入sasoact.exe,以检查是否正在运行SAS的现有OLE自动化会话.如果不是,则调用 SAS的OLE自动化会话.一旦有活动 SAS自动化服务器会话,来自的任何进一步调用 sasoact.exe由现有的SAS会话而不是在新的SAS会话中处理 SAS会话.

The sasoact.exe program is used to launch an OLE automation session of SAS. Automation is a mechanism through which one Windows application can control another application programmatically. When you double-click a SAS file type, sasoact.exe checks to see if an existing OLE automation session of SAS is running. If not, it then invokes an OLE automation session of SAS. Once there is an active SAS automation server session, any further calls from sasoact.exe are handled by the existing SAS session instead of in a new SAS session.

我猜想只有一个OLE会话在某种程度上是有用的,但是当您每次要运行多个作业时都必须手动打开一个新的EE实例时,这确实很烦人.更不用说sasoact是针对第一个启动的会话的,并且如果该会话上已经有作业运行,则您的程序将不会打开.

I guess having only one OLE session is usefull in some way or another but it's really annoying when you have to manually open a new EE instance every time you want to run multiple jobs. Not to mention that sasoact targets the first session initiated and if a job is already running on that session well your program is not going to open.

是否可以直接请求OLE会话的新实例或技巧" sasoact.exe进入看不到打开的会话的方法?

Is there a way to directly request a new instance of the OLE session or perhaps "trick" sasoact.exe into not seeing the opened sessions ?

太可惜了,它被重复了,因为答案与其他问题大不相同.它还可能会帮助其他不想从批处理文件运行程序的人. 这是有效的注册表项:

Well too bad it's been closed as duplicate because the answer is substantially different than the other question's. Also it might help others who do not want to run their programs from a batch file. Here is the registry key that works:

"C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe" -initstmt "dm 'whost;include ''%1'' ';"  

我在HKEY_CLASSES_ROOT\SAS.Program.701\shell\Open New\command中添加了它,所以现在我的下拉菜单中有一个整洁的小额外选项,可以有效地在新会话中打开程序,点击:

I added it in HKEY_CLASSES_ROOT\SAS.Program.701\shell\Open New\command so now I have a neat little extra option in my drop-down menu that effectively opens programs in new sessions on click:

推荐答案

如果要在新会话中打开.sas程序,只需单击该程序即可,这里是操作方法:

您必须将一个条目添加到注册表.弄乱注册表文件时要小心,请始终备份您的条目.

You have to add an entry to the registry. Be careful when messing around with registry files, always back up your entries.

打开注册表编辑器(WIN + R> regedit).
在目录HKEY_CLASSES_ROOT\SAS.Program.701\shell\中,创建一个具有有意义名称的子目录(右键单击shell> New> Key).我将我的名字命名为"Open New".在这个新的子目录中,创建另一个名为command的子目录.现在,您应该具有如下所示的路径:
HKEY_CLASSES_ROOT\SAS.Program.701\shell\Open New\command
在此处,右键单击注册表文件上的文件>修改,然后在值数据"字段中添加以下内容(如果需要,请更改sas.exe的路径)

Open the registry editor (WIN+R > regedit).
In the directory HKEY_CLASSES_ROOT\SAS.Program.701\shell\ create a sub-directory with a meaningful name(right-click on shell > New > Key). I named mine "Open New". In this new sub-directory create another sub named command. You should now have a path that looks like:
HKEY_CLASSES_ROOT\SAS.Program.701\shell\Open New\command
In here, right-click on the file on the registry file on the right > Modify and add the following in the Value data field (change the path of sas.exe if needed)

"C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe" -NOTUTORIALDLG -initstmt "dm 'whost;include ''%1'' ';"

关闭编辑器.现在,您应该在.sas程序上单击鼠标右键的下拉菜单中指定新选项:

Close the editor. You should now have the new option specified in the drop-down menu of the right-click on a .sas program:

此选项将在新的SAS会话中使用增强型编辑器打开您的程序.

This option will open your program with the Enhanced Editor in a new SAS session.

现在,如果您希望它可以双击运行,我想您必须将Open子目录中的值替换为上面的一个.我还没有这样做,我也不推荐这样做,下拉菜单中的额外选项对我来说已经足够了.

Now if you want it to work for double-clicking I suppose you'd have to replace the value in the Open sub-directory with the one from above. I haven't done it and I don't recommend it, the extra option in the drop-down is enough for me.

这篇关于在新实例中打开SAS程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆