Tip: How to close all data sets in SAS Enterprise Guide

This post was kindly contributed by The SAS Dummy - go there to comment and to read the full post.

Have you seen this error when running a program in SAS Enterprise Guide?

ERROR: You cannot open WORK.YOURDATA.DATA for output access with member-level 
control because WORK.YOURDATA.DATA is in use by you in resource environment IOM 
ROOT COMP ENV.

It has a simple cause: the data set that your program is trying to write (or rewrite) is open in the data viewer. With regard to this data file, your program is in contention with the SAS Enterprise Guide application.

Usually SAS Enterprise Guide closes all open data sets before running a program or task, and that’s meant to help you avoid this error. But sometimes a data set file remains open for one reason or another, and the conflict results in the error message. Fortunately, there is a simple fix.

Close All data sets window

Select Tools->View Open Data Sets. The View Open Data Sets window shows the names of the data files that SAS Enterprise Guide has open. And it offers a convenient Close All button to clear the list. Closing the data doesn’t affect the contents of the file or its place in your project. It simply removes the lock that SAS Enterprise Guide is holding on the file.

If you are running multiple SAS Enterprise Guide sessions, it’s possible for one session to have a lock on a file that you’re trying to update in another session. The View Open Data Sets window shows only those data sets from your current session, so be sure to check your other projects if you’re multitasking.

The default behavior — close all data before running SAS programs — is controlled in Tools->Options->SAS Programs. If you don’t want SAS Enterprise Guide to close your data windows, clear that checkbox. (It’s difficult for me to imagine why you would do that…but hey, we have options for everything.)

tags: SAS Enterprise Guide

The post Tip: How to close all data sets in SAS Enterprise Guide appeared first on The SAS Dummy.

This post was kindly contributed by The SAS Dummy - go there to comment and to read the full post.