50174

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

  • Symfony2 Remove UTF-8 BOM from controller responses
  • ADAL for Windows Store SSO
  • Python : ImportError: No module named requests
  • Using a do-while to restart a game in java
  • How to Score on a new Data Set
  • Very strange error in my app from component
  • Enable PHP Firebird connection
  • Get parent element of caret in iframe design mode
  • Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package cal
  • How to determine 5 labels in a row of the same backcolor in a C# array?
  • EventLog Auditing AD Get User IP
  • System Error : Xamp installation dll file missing error
  • How can I install php on Windows
  • How to access data obtained by WebClient.DownloadDataAsync?
  • How to get User Ip address and check that user is online in Ionic\\Cordova
  • Tic Tac Toe C++ algorithm debugging help
  • FXML ClassNotFoundException
  • Opening a new window using window.open in Microsoft Edge isn't working
  • Python - Randomly select words to display in a quiz [duplicate]
  • Using Win32::OLE to execute macro in Access 2007
  • Simple guessing game in c
  • How to check few form fields are empty or not?
  • How can resolve R in Android?
  • Conda install pygmaps
  • Accepting Numbers from 1-9 TIC TAC TOE
  • Custom shaped text box in windows forms?
  • Stretching frames using grid layout in Python Tkinter
  • How to get Android screen height minus status bar in pixel?
  • How to identify if the child window has been closed in javascript?
  • how to capture the right click event using getMouse()
  • How to solve Error:apache shutdown unexceptedly?
  • Using snippets to make Class properties in VB.net. prop only gives “property () as ” Whats up?
  • PDF to txt in R
  • detect flash build verison
  • How to dock a footer menu to bottom in Appcelerator Titanium?
  • ManagementEventWatcher for Win32_ProcessStartTrace no longer working in Win 8.1
  • Angularjs binding value from async service
  • How to handle sub projects dependencies in Maven
  • Syntax Errors in QuizGame and Tips [closed]
  • Replace Program Files with Progra~1 in a shell script
  • Titanium JavaScript: How to pass data/values from one window to another window
  • Thread.Sleep() sleeps for longer
  • Exception in thread “main” java.lang.UnsatisfiedLinkError: … \\jzmq.dll: Can't find dependent
  • java - stealing bits from references
  • how to set the link at end of the columns in datagrid in winforms
  • Installing Jenkins Slave as Service on win8.1 and win10
  • Make a Div and it's Child Element's an Image in Javascript
  • SQL Count(*) on multiple tables
  • How to print ExtJS component?
  • Databinding with WinJS as powerful as with knockout?
  • captureStream() on dynamically created video element
  • Python-Scrypt doesn't install on Windows 7 64-bit
  • Design issues and implementing Enumerable.AsEnumerable
  • example of embarcadero WindowHandleToPlatform c++
  • “unable to load shared object” when loading the rJava library
  • Pyglet: Sprite.draw() and Batch.draw() don't work, but Image.blit does
  • jQuery jScrollpane's scrollToElement
  • Adding a sub query to an already giant query
  • Bootstrap dropdown doesnt work after ajax call (even after reinitializing)
  • Performance of behaviorally identical conditional checks [duplicate]
  • Im trying to install tensorflow on Anaconda that supports python 2.7 and I'm stuck
  • Login failed for user 'NT AUTHORITY\\ANONYMOUS LOGON' in SQL Server 2008
  • Kivy service stops when app is closed
  • Guice + Jersey integration injects null objects
  • Tic Tac Toe winning condition change when scalable board is larger than 4x4
  • How can I prevent console from printing in JavaScript game?
  • how to compile a windows 7 compatible binary on visusal studio 2015
  • Audio record in R
  • Can someone explain this statement? lpadded = win // 2 * [-1] + l + win // 2 * [-1]
  • Simple Interval Not Clearing
  • Cannot install plyfile in Anaconda
  • Liferay not working with MySQL
  • Magento 2 can't find css and js files
  • No connection could be made because the target machine actively refused it.127.0.0.1:1234
  • Tkinter textvariable not updated with MatplotLib
  • tkinter menubar and checkbox keep open
  • What is the purpose of GetPrivateProfileString? [closed]
  • How to Read XML Microsoft Event Logs with PHP
  • Get network operator name in Appcelerator Titanium
  • Session scoped managed bean not available in servlet when using another browser than IE
  • Javascript - fadein effect Uncaught SyntaxError: missing ) after argument list
  • If / Else / Switch returning the wrong results
  • An error occurred while trying to share D. Incorrect function.
  • How to click on onbeforeunload prompt in Watir test?
  • Issue with global variables
  • How to detect Windows is locked?
  • Adjust window size
  • Guess the number in C# with player chances
  • Accessing HTTP status code while using WCF client for accessing RESTful services
  • Multi-dimensional Array - Check for diagonal consecutive values
  • How can I extract a full path from the PATH environment variable?
  • Ext JS empty ItemSelector when loaded for the second time
  • Buttons and links keyboard triggers
  • How to install Matplotlib's basemap?
  • Closing OAuth 2.0 popup window after redirect
  • Failed to start the virtual machine 'MobyLinuxVM' because one of the Hyper-V components is
  • Using CreateInstance in Windows 10 Universal Apps
  • iPython Notebook in Windows - Error on Startup
  • Slice List of floats by value in Python
  • How to close “Microsoft Windows Malicious Software Removal Tool” tab when running Selenium webdriver
  • Can not create, modify text file into Program Files Folder of windows 7
  • What does version name 'cp27' or 'cp35' mean in Python?
  • different tcp packets captured on sender and receiver
  • Coexisting installation of visual studio 2010 &2008
  • NullPointerException loading fxml file from javafx applet
  • When running PyQt5 app in Spyder it always exits with -1
  • Paging control for windows application
  • .NET VSTO Add In for Excel 2007 not loading config. Issue on one machine only!
  • JsonConvert.DeserializeObject special characters Unterminated string. Expected delimiter:
  • SQL Server 2012 Management Studio for Windows XP [closed]
  • Backbone routing/history issue with Jekyll static pages
  • api-ms-win-core-libraryloader-l1-2-0.dll missing when d3dcompiler_47.dll is redistributed
  • Serialize XML data (Incremental storing) in Windows 8
  • Font problem in windows xp
  • Disabling QComboBox in pyqt
  • Access violation exception when use method Marshal.PtrToStructure in a loop
  • How do I figure out if Windows is currently playing any sounds?
  • Cocoa keyDown Event doesn't call
  • Firemonkey IFMXLoggingService Windows Event Log Location
  • Sponsor's Renewal function stops being called
  • Set column-width and word wrap properties while exporting data to excel/csv angularjs
  • Struggling to come up with a generic C# method that compares different types of numeric objects
  • The application was unable to start correctly 0xc150002
  • Why FileType works and BufRead,BufNewFile doesn't - VIM?
  • Where's error in implementation of minimax algorithm?
  • Uniform distribution in a small range to generate precise big probability
  • Print text of a QWebview, QPrintDialog doesn't appear
  • Should actors/services be split into multiple projects?
  • Vim and snipMate (plugin) - adding new snippet won't work
  • How do I give my windows service admin rights
  • Handling database constraint errors nicely
  • 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
  • Possible bug in Django 1.7a2 Migrations?
  • Is it safe to assign pos_type to uint64_t when dealing with large files (> 2GB)?
  • Keys.D1 = LButton | ShiftKey | Space?
  • can we rebase kernel32.dll ? such that load address is different for two processes
  • Save mail with subject as filename
  • WebView killing the whole activity — How can I debug this?
  • LINQ GroupBy Aggregation with AutoMapper
  • UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 14: invalid star
  • Spring Security OAuth2 correct Authorization Manager
  • Xcode can't find dylibs after switching to homebrew for OpenCV
  • Titanium refreshing TableView with new data
  • Problems with joining two tables
  • How to add texture (image) to SceneKit model so that it covers the model (mesh) uniformly?
  • Is it better to use mysql or files to store data?
  • Using textfile as stdin in python under windows 7
  • GitLab site is showing the plesk default page. What am i doing wrong?
  • IE and Edge flexbox bug?
  • how to permanently set environment variable for boot2docker
  • Single PHP Function To Replace Text With Emoticons Or Filter Words
  • How link obj file from NASM with link.exe in Win10
  • How to add some text in google piechart pieHole
  • How to call WCF service using jQuery ajax functions
  • Determining which screen a window is on (by checking where the most surfacearea is located)
  • Android: Why I am not receiving the BOOT_COMPLETED intent?
  • How to run IntelliJ and Maven on OS X?
  • Android sdk content loader error [duplicate]
  • Use SendInput to lock the computer
  • IE memory leak and eval with jQuery
  • Python email payload decoding
  • Windows Phone 7 sniffer
  • Why is this code not working? Hangman
  • How to determine location of a perl warning - Use of each() on hash after insertion
  • logging static methods in a parent class
  • Declare PtrSafe Compatibility in Excel
  • Finding the number of elements less than or equal to k in a multiset
  • Check all commands exit code within a bash script
  • How to count amount of elements in a row of a matrix in C
  • LINQ to Entities does not recognize the method 'System.Collections.Generic.Dictionary`2[System.
  • Implementing Oracle.Web.dll, Oracle.DataAccess.dll 64-bit failed on Windows Server 2008 with IIS 7.5
  • Add Windows Feature from C#
  • ConnectivityManager.CONNECTIVITY_ACTION deprecated
  • android Navigation Bar hiding and persantage of usable screen overlap
  • How to turn (A, B, C) into (AB, AC, BC) with Pig?
  • apply a javascript function to draggable copy
  • XSLT foreach repeating nodes to flat
  • Does Apple allow the usage of sysctl.h within iOS applications?
  • how do i write assembly code from c#?
  • Sending keystrokes/mouse clicks to a Java program with Autohotkey
  • Center align outputs in ipython notebook
  • Android changing fragment order inside FragmentPagerAdapter
  • How to add git credentials to the build so it would be able to be used within a shell code?
  • Get history of file changes from TFS to implement custom “blame”-behaviour of exceptions
  • Create DicomImage from scratch using Dcmtk
  • Groovy: Unexpected token “:”
  • How to run “Deployd” on port 80 instead of port 5000 in webserver.
  • How do I open a C file with a relative path?
  • Custom Tabgroup Appcelerator
  • Use of this Javascript
  • Linq Objects Group By & Sum
  • Spring Data JPA custom method causing PropertyReferenceException
  • Change JButton Shape while respecting Look And Feel
  • QLineEdit password safety
  • Nant, Vault & Windows Integrated Authentication
  • C# - Serializing and deserializing static member
  • Is there a amazon webstore API for customers?
  • Bug in WPF DataGrid
  • Sending data from AppleScript to FileMaker records
  • 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?