Automatic program execution


Dear Miss SAS Answers,
We recently upgraded to SAS 9.2 (PC Version) and now when I double click on the SAS icon on the desktop, the program automatically executes rather than simply opening in the program editor. How do I change this so that double-clicking the desktop icon equals open program in editor rather than run program?
Help us Miss SAS Answers! You're our only hope! ;-)

               Unwilling Runner


Dear Runner,
How frustrating for you!  I'm assuming that you have the SAS 9.2 icon on your desktop.

If so, right click the icon and choose Properties from the pop-up menu.  Select the Shortcut tab. Look for the Target field.  My value for the Target field is:

   "C:\Program Files\SAS\SASFoundation\9.2\sas.exe"       -CONFIG "C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG"

Your value for the same field probably has a space followed by a SAS program file name, something similar to:

&nbsp;&nbsp;&nbsp;"C:\Program Files\SAS\SASFoundation\9.2\sas.exe" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-CONFIG "C:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG" <strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"C:\workshop\"</strong>

Simply edit the Target field to remove the .sas file name.  Be sure to leave the path to the sas.exe file and the        -CONFIG option file path intact.

That should fix the problem.  Please let me know if it does not.

               Happy program editing,
               Miss SAS Answers


About Author

Miss SAS Answers

Technical Training Specialist

Linda Jolley has been a SAS software user since 1980. She has been an instructor for SAS since 1997, and is Base and Advanced SAS Programming certified and working on the Data Integration Developer certification. She has presented papers at several SAS user group venues on various SAS programming efficiency techniques and the SAS Scalable Performance Data Server.


  1. sounds like a change from the old SAS OLE Automation server action
    It becomes a bit subtle to control
    so I get lazy and for casual opening of code, I have selected default action NOTEPAD.exe

    For more serious action, like regular or ad-hoc occasional batch processes, I set up a special icon and folder for each of these SAS programs.
    For code development, I always have a SAS session (or 2) open so no need for a new session for each new program. SAS Viewer looks alternative is "smarter" but NOTEPAD is "lighter" and faster".

  2. I believe that you really need to no what is in the autoexec file as well as the config file. Either of those files has the ability to "execute" SAS code.

  3. A possible point of confusion here is what Unwilling Runner is actually doing that causes a SAS program to run. I suspect it may be double clicking the icon of a .sas file (a running man icon) that happens to reside on the desktop rather than the SAS application icon (the inverted triangle). If so, the the Windows file type mapping may be the problem. It has been for me in the past and not having admin privilege I had to resort to right clicking and picking the 9.2 for Windows entry vs. the 9.2 SAS entry for "open with ...". It is an annoying problem to have and can even lead to overwrites and the like that you do NOT want.

  4. Hi Michael,
    I had a similar situation. In an earilier release of SAS, if I had SAS already open and I'm working on code, if I navigated to Windows Explorer and double-clicked on a SAS program, it would open up in the same SAS editor window in which I was already working. It wouldn't execute as I gather happens with 9.2, but it did get in my way.

    I configured my desktop so that when I double-click on a SAS program, it will open in SAS Viewer so I can read and/or print it. This works out much better for me. The trade-off is that when I want to modify or execute a program in SAS, I have to start SAS and then deliberately open it.

    As I said, this works much better for me. I hope it helps.

    P.S. - You can use SAS Viewer to modify SAS code. However, I prefer not to. I prefer to keep SAS Viewer as a Viewer only. I also find that since I have modified my print settings in SAS for output, that it's really far more convenient to print programs with SAS Viewer so I don't have to keep changing my print settings in SAS.

    Good luck.

  5. Michael Hubbard on

    I tried your solution for stopping automatic program execution and it didn't help. My shortcut had the "C:\Program Files\SAS\SASFoundation\9.2\sas.exe"
    as sell as a config-, an -autoexec, and a -sasinitialfolder .

    Removing them didn't help. Is there a Plan B for just opening a program in SAS?

    • Miss SAS Answers

      Hi Michael,
      You can try creating your own shortcut on your desktop. In Windows Explorer, navigate to C:\Program Files\SAS\SASFoundation\9.2. Right click sas.exe and select Create Shortcut from the pop up menu. This will create a shortcut to the sas.exe file in the C:\Program Files\SAS\SASFoundation\9.2 folder which you can drag and drop onto your desktop to create a new SAS 9.2 icon. If you right click the new SAS 9.2 icon and select Properties from the pop up menu, you should see only the executable ("C:\Program Files\SAS\SASFoundation\9.2\sas.exe"). If you want to add your configuration file, add the following after the executable:
      [space]-CONFIG[space]"C:\Program Files\SAS\SASFoundation\9.2\nls\en\sasv9.cfg".
      (Replace [space] with the space bar from your keyboard.)

      Let me know if this works for you.

      Miss SAS Answers

Leave A Reply

Back to Top