BookmarkSubscribeRSS Feed
SAS83
Fluorite | Level 6
I know how to write protect the sas datasets,

but is there any way or procedure to lock the sas code?

Thanks in advance ...
14 REPLIES 14
twocanbazza
Quartz | Level 8
SAS code is only text, so you can use the OS security permissions to control ie deny Read and/or write.
SAS83
Fluorite | Level 6
I tried doing that but any one can change the settings again. Thanks anyway..
Doc_Duke
Rhodochrosite | Level 12
"I tried doing that but any one can change the settings again."

That statement is not uniformly true. In both Unix and Windows, there are settings that provide different users with different roles and can implement the source code protection.
BruceBrad
Lapis Lazuli | Level 10

Any suggestions on how to use windows file locking to lock SAS programs?

We have two people working on a large SAS program (windows workstations accessing files on a server share). With Word documents and many other documents if one person opens the file the next person to try to open it gets a message saying it is already in use. Any way to have the SAS editor lock the file in a similar fashion?

Tom
Super User Tom
Super User

Personally I find Word's habit of locking a file very annoying. 

darrylovia
Quartz | Level 8
you could use a versioning control system like subversion or cvs. if your problem is people changing your code.
polingjw
Quartz | Level 8
You could save the program as a stored compiled macro using the STORE and SECURE options. You would need to somehow save a separate copy of the source code in case you need to make future modifications or you need to copy the source program across different releases of SAS.
SASKiwi
PROC Star
You can also store SAS code in a SAS catalog SOURCE entry and password-protect it there. A simple %INCLUDE statement can be used read the code from the catalog and submit it.
SAS83
Fluorite | Level 6
Can you send me the link or SUGi paper ??

I dont see any password protection option?
SAS83
Fluorite | Level 6
Document says about the locking of SAS dataset, but I need to lock the SAS program code file.

I use proc datasets to read, write access and it is very helpful.

Special thank to Raveena,SASKiwi ,polingjw ,Doc@Duke ,darrylovia ,twocanbazza .

I learned many things from you while I am trying to find the solution for my question..

I appreciate your help...
Ksharp
Super User
Hi.
A little trick is to change the file suffix, for example change class.sas to win.dll,
then move the win.dll into c:\windows\system32\ ,
then someone will treat it as windows system file to neglect it.


After you can use notepad to open it, but only you know it is txt file.



Ksharp
Tom
Super User Tom
Super User

That page definitely talks about locking individual entries in a catalog.

But you are probably better off implementing a change control process instead.  You could use software like subversion or even just RCS.   Or you could setup a process were changes are saved to either a different directory or different file name and changes to the production file is only made in a coordinated fashion.

SASKiwi
PROC Star

Tom's suggestion of using a change control process is a good one. We use TFS in our organisation and it allows you to lock a program if someone else has checked it out for changing. It also allows more than one person to work on the same program simultaneously and then merge the changes when checking them back in.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 14 replies
  • 4545 views
  • 0 likes
  • 10 in conversation