Open SAS program in new instance

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

The author explains that:

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.

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 ?

<strong>[EDIT]</strong> 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'' ';"

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 <strong>on click</strong>:

<img src="https://i.stack.imgur.com/QMlUZ.png" alt="More sessions!">

Answer1:

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

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

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_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'' ';"

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

<img src="https://i.stack.imgur.com/QMlUZ.png" alt="enter image description here">

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.

人吐槽 人点赞

Recommend

  • Should actors/services be split into multiple projects?
  • How do I give my windows service admin rights
  • Youtube iframe api: 'onReady', 'onStateChange' not firing in IE 8
  • Java (Robot) screenshot beyond visible
  • Append data to middle line/row of a csv instead of the last line or row
  • Typing the command “cake” in console shows no output
  • Is it safe to assign pos_type to uint64_t when dealing with large files (> 2GB)?
  • Keys.D1 = LButton | ShiftKey | Space?
  • Save mail with subject as filename
  • LINQ GroupBy Aggregation with AutoMapper
  • UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 14: invalid star
  • Titanium refreshing TableView with new data
  • Using textfile as stdin in python under windows 7
  • How link obj file from NASM with link.exe in Win10
  • Determining which screen a window is on (by checking where the most surfacearea is located)
  • Android sdk content loader error [duplicate]
  • Use SendInput to lock the computer
  • Windows Phone 7 sniffer
  • Why is this code not working? Hangman
  • Declare PtrSafe Compatibility in Excel
  • Implementing Oracle.Web.dll, Oracle.DataAccess.dll 64-bit failed on Windows Server 2008 with IIS 7.5
  • Add Windows Feature from C#
  • Does Apple allow the usage of sysctl.h within iOS applications?
  • how do i write assembly code from c#?
  • How to add git credentials to the build so it would be able to be used within a shell code?
  • Create DicomImage from scratch using Dcmtk
  • Groovy: Unexpected token “:”
  • Custom Tabgroup Appcelerator
  • Is there a amazon webstore API for customers?
  • ActionScript 2 vs ActionScript 3 performance
  • jQuery tmpl and DataLink beta
  • How can I estimate amount of memory left with calling System.gc()?
  • Apache 2.4 - remove | delete | uninstall
  • Hibernate gives error error as “Access to DialectResolutionInfo cannot be null when 'hibernate.
  • How to format a variable of double type
  • How to include full .NET prerequisite for Wix Burn installer
  • Buffer size for converting unsigned long to string
  • Is it possible to post an object from jquery to bottle.py?
  • Comment

    用户名: 密码:
    验证码: 匿名发表

    你可以使用这些语言

    查看评论:Open SAS program in new instance