Architecting, installing and maintaining your SAS environment

Opening a SAS file

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Opening a SAS file

The people I'm supporting are typically running SAS 9.2 under Windows 7, both 64 and 32 bit

Prior to SAS being bundled with Enterprise Guide, a user could double click on a .sas file the file would open and not execute in SAS. Now that installations come with Enterprise Guide when a user double clicks on a .sas file the file opens in EG. I have been asked how one can open the file in SAS (not EG) with a double click.

Personally I right click on the .sas file and choose 'open with SAS 9.2' from the context menu. My users, being older academics, reject my simple solution. I have tried re-associating the .sas type file to sas.exe instead of EG and also uninstalling EG. Both of these resulted in a double click executing the .sas file and not just opening it.

This sounds like a Windows thing and I think it is, but I think it's a registry issue. If anyone has any good ideas I would appreciate the help.

Thanks.


Accepted Solutions
Solution
‎08-17-2017 01:17 PM
SAS Employee
Posts: 9

Opening a SAS file

File type associations on Windows 7 can be tricky. Two common issues are:  1. Double click a .sas file and it batch submits. 2. Double click a .sas file and it opens in SAS Enterprise Guide when the user expects it to open in the SAS display manager.   See below for some suggestions.

1. Double click a .sas file and it batch submits:

Check to see if you have a UserChoice key set in your Windows registry. If this is set then you can certainly have problems.  This gets set when you use the Windows operating system methods to associate a file type with an application. For example choosing to associate the .sas file type with sas.exe will result in batch submiting a .sas file when you double click it.

Click start and in the search box type regedit and enter.

Navigate to:

HKEY_current_user ► Software ► Microsoft ► Windows ► Current Version ► Explorer ► Fileexts ►  .sas

Look for a key named UserChoice.

If UserChoice exists right click the key and choose export. This will save the key should you need to add it back to your Windows registry.

After you export and save the UserChoice key delete it from your Windows registry by right clicking and choosing to delete.

Warning: Always backup your Windows registry before making changes.

Next test by double clicking a .sas file.  If it still batch submits or opens in SAS Enterprise Guide you should run the Manage SAS File Types utility. The utility allows you to associate file types with either SAS or SAS Entperprise Guide.

SAS 9.2: Go to Start -> Programs -> SAS -> SAS 9.2 License Renewal and Utilities -> Manage SAS File Types

SAS 9.3: Go to Start -> Programs -> SAS -> Utilities -> Manage SAS File Types

For Windows Vista, Windows 7 or Windows Server 2008 it is important that you  "right click" the utility and "run as administrator" even if you are the administrator.

Next re-test by double clicking a .sas file.

2. Double click a .sas file and it opens in SAS Enterprise Guide:

File types can only be associated with one application at a time. While some users might want a .sas file to open in SAS Enterprise Guide, some users might want .sas files to open in the SAS display manager. To associate your file types with either SAS Foundation or SAS Entperprise Guide use the Manage SAS File Types utility.

SAS 9.2: Go to Start -> Programs -> SAS -> SAS 9.2 License Renewal and Utilities -> Manage SAS File Types

SAS 9.3: Go to Start -> Programs -> SAS -> Utilities -> Manage SAS File Types

Remember to right click on the utility and run as administrator.

I hope this helps.

View solution in original post


All Replies
Super User
Super User
Posts: 7,076

Opening a SAS file

It is a Windows thing.  From Windows Explorer select Tools -> Folder Options. Then select File Types tab.  Look for the the .sas files in the registered file types list and highlight it.  Hit the ADVANCED button.   You should now see all of the actions associated with the file.

You can try just changing which one is marked as the default, but I have in the past found that some windows actions insist on calling the one that is named "open".  You can just rename them or re-create them with different names.

How this works on different versions of Windows I am not sure.  We are still running XP.

Occasional Contributor
Posts: 7

Opening a SAS file

Yeah, wasn't it great the way you used to be able to do that. Unfortunately Win 7 isn't that easy. I've looked around for these options in Win 7, but I haven't found them yet.

SAS Employee
Posts: 29

Opening a SAS file

Hi there,

I was curious if you have tried or knew about the Manage SAS File Types utility? If you click on Start>Programs>SAS>SAS 9.2 License and Renewal Utilities> Manage SAS File Types - you can select either

SAS Foundation 9.2 or SAS Enterprise Guide from the menu, then select All and click OK.

Best Regards!

Occasional Contributor
Posts: 7

Opening a SAS file

Posted in reply to Sunshine_sas

Sunshine,

That looks like a nice utility that could do the trick, i.e. uncheck .sas in EG and check in SAS. It has to be run as an administrator under Win 7 to not throw an exception, but checking and unchecking do nothing. Re-entering the utility shows all checks in place and no change.

Bob

SAS Employee
Posts: 29

Opening a SAS file

Hi Bob, Your correct, you need to have admin priviledges to run this - in some cases you might only have to right click and select Run as administrator for Windows 7.

When you make the changes in the tool and then exit, they should work in Windows Explorer. However, going back into the tool, it does look like nothing has happened. So the key is to make your changes and then click Ok in the utility and close it. then got to Windows Explorer and test it there.

Take care!

Occasional Contributor
Posts: 7

Opening a SAS file

Posted in reply to Sunshine_sas

Sunshine,

Sorry I forgot to mention that. I did think that something might have happened even though it didn't look like it.I tried going right to the file and double click it - opened up in EG. Then I logged off and logged back on and tried again. Same results - opened in EG.

I did see that one of the times I tried it as not administrator, the pop-up exception complained about writing to HKEY_CLASSES_ROOT/.egp. I looked in the registry at that location and it does reference 'SASEguide.Project.2' for that file type and /.sas references 'SAS.Program.701' for that file type. That's apparently where changes are attempting to be made.

The bottom line is I don't want to necessarily change the file/application association, I just don't want the SAS script to run when SAS is the application. I want SAS to open the script in an edit window like it did before EG.

Thanks.

Bob

Super User
Super User
Posts: 7,076

Opening a SAS file

Here is the Microsoft page on associating actions (or verbs).

http://msdn.microsoft.com/en-us/library/cc144175%28v=vs.85%29.aspx

It really seems that Microsoft has made this much more difficult to manage.

New Contributor
Posts: 3

Opening a SAS file

My organization (including myself) is having the same issue, and we are seeking the same result: to be able to double-click on a SAS program (in Windows 7) and have it open the program in SAS 9.2 editor (like it has in the other versions of Windows), as opposed to the SAS job running without opening, like a batch job.

We know how to make this change in Windows XP, but the options have changed in 7.

Any ideas, in additon to what has been posted above?

Thanks,

Brian

SAS Employee
Posts: 29

Opening a SAS file

Hi Brian,

The first thing you can try is to use the Manage File Type Utility.

To do this click Start>Programs>SAS>SAS 9.2 License and Renewal Utilities>Manage File types

When it opens highlight SAS Foundation 9.2 - click Select All and OK.

Now go into Windows Explorer and try this again.

http://support.sas.com/kb/32/464.html

You might need to reference this in rare cases, especially is the UserChoice has been set.

Always backup registry before making these kinds of changes though.

Have an awesome day!

New Contributor
Posts: 3

Re: Opening a SAS file

Posted in reply to Sunshine_sas

Sunshine,

I followed your steps (running the Manage File types as an admin) it ran successfully, but the same issue still occurs.

I need to be able to choose "Open with SAS 9.2" instead it seems that it is opening in "Batch Submit with SAS 9.2"

(This screen shot is from XP, and I want to duplicate it in Windows 7, though this option does not exist in the same fashion in Windows 7)

Edit File Type.jpg

Any other ideas?

I appreciate the effort.

-Brian

Occasional Contributor
Posts: 7

Re: Opening a SAS file

Brian,

Thanks for keeping this thread alive. I'm still hoping for a solution to this issue. However, most of my users have decided to use my original suggestion of using the right-click context menu to pick off Open with SAS 9.2.

Bob

New Contributor
Posts: 3

Re: Opening a SAS file

Bob,

When I right-click context menu to pick Open with SAS 9.2, it still batch submits my programs and does not opening them in editor.

Windows 7 lacks some XP options that were really useful.

-Brian

Occasional Contributor
Posts: 7

Re: Opening a SAS file

Brian,

I have SAS 9.2 64-bit installed on Win 7 Enterprise O/S. I didn't do anything out of the ordinary and I get the following right-click context menu.

sas.jpg

I know that doesn't really help, but I've done several similar installs with the same results. This particular system has had Enterprise Guide uninstalled and reinstalled and the menu subtracted and then added the EG 4 entries you see.

Bob

New User
Posts: 1

Re: Opening a SAS file

I had the same issue. After I accidently selected V8.2 as an open with program, it worked somehow??

If you installed v8.2, EG, and v9.2, you may try the below steps.

- Go to Control Panel, Programs, and click Make a file type always open in a specific program.

- Choose the .sas extension, and click Change Program.

- Select V8.2 program (icon) from the list of programs available or in the section of Other Programs

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 35 replies
  • 24640 views
  • 5 likes
  • 13 in conversation