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

问题描述

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

这个问题已经.

如果您想在新会话中打开一个 .sas 程序,只需点击以下程序即可:

您必须向注册表添加一个条目.处理注册表文件时要小心,请务必备份您的条目.

打开注册表编辑器(WIN+R > regedit).
在目录 HKEY_CLASSES_ROOTSAS.Program.701shell 中创建一个具有有意义名称的子目录(右键单击 shell > New > Key).我将我的命名为Open New".在这个新的子目录中创建另一个名为 command 的子目录.你现在应该有一个看起来像这样的路径:
HKEY_CLASSES_ROOTSAS.Program.701shellOpen Newcommand
在这里,右键单击右侧注册表文件上的文件>修改并在Value data字段中添加以下内容(如果需要更改sas.exe的路径)

C:Program FilesSASSASFoundation9.2(32-bit)sas.exe"-NOTUTORIALDLG -initstmt "dm 'whost;include ''%1'' ';"

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

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

现在,如果您希望它可以双击,我想您必须将 Open 子目录中的值替换为上面的值.没做过也不推荐,下拉中的额外选项对我来说已经够用了.

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~1SASHomeSASFOU~19.3coresasexeSASOACT.EXE" action=Open
datatype=SASFile filename="%1" progid=SAS.Application.903

The author explains that:

The sasoact.exe program is used to launch an OLE automation session of SAS.Automationis a mechanism throughwhich one Windows application can control another application programmatically. When you double-click a SAS filetype, sasoact.exe checks to see if an existing OLE automation session of SAS is running. If not, it then invokes anOLE automation session of SAS. Once there is an activeSAS automation server session, any further calls fromsasoact.exe are handled by the existing SAS session instead of in a newSAS session.

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.

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 ?

[EDIT] 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 FilesSASSASFoundation9.2(32-bit)sas.exe" -initstmt "dm 'whost;include ''%1'' ';"

I added it in HKEY_CLASSES_ROOTSAS.Program.701shellOpen Newcommand so now I have a neat little extra option in my drop-down menu that effectively opens programs in new sessions on click:

解决方案

A similar thread showing the use of a batch file to open a SAS program in a new session is available here.

If you want to open a .sas program in a new session by simply clicking the program here is how to do it:

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

Open the registry editor (WIN+R > regedit).
In the directory HKEY_CLASSES_ROOTSAS.Program.701shell 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_ROOTSAS.Program.701shellOpen Newcommand
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 FilesSASSASFoundation9.2(32-bit)sas.exe" -NOTUTORIALDLG -initstmt "dm 'whost;include ''%1'' ';"

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

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

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 程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 08:20