I'd recommend setting up views of permanent views of permanent datasets and using them as sources of data. (Views have become the duct tape of database programming.) For example,
create view perm.vwdsn as
select * from perm.dsn
After creating the permanent view, you can thereafter use the view reference in lieu of the dataset reference in all but a few Data step programs and procedures (Exceptions include some direct access programs that could take longer to run and some programs that use indexes on permanent datasets.) Views require very little storage space and fractions of seconds of execution time. As a precaution, I'd also recreate the permanent view when recreating the permanent dataset.
From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of XXXX@XXXXX.COM
Sent: Friday, March 06, 2009 1:45 PM
Subject: Limit access to directories within a SAS program
I write several SAS programs a day to address various ad-hoc questions. I periodically have to create permanent datasets, but am constantly simply reading from a vast number of them, and a few times a year I space out and write something like
if missing( *** _type);
Replacing a huge data set with a one with one row, one variable, and a missing value for that.
This is of course embarrassing and time-consuming as I go knocking on doors with my hat in hand figuring out how to get the data recreated. If you just take my word for it that removing my write access to all of this data in the file system (UNIX, fwiw) is unfeasible and would create more problems, is there some option I can set in a given program that would simply prevent that particular program from writing to anything but the work directory?