views:

489

answers:

3

Is there a way to password protect SAS CODE within SAS? Or, if not, what is the easiest / quickest way to apply some kind of password protection?

I am referring to scripts run from local Windows PCs (ie not batch). The scripts are stored on a standard network drive...

(Ideally the solution would not involve a Microsoft product such as Word or Excel!!)

A: 

As our organisation does not permit password protection on folders, we are thinking of going with a third party program:

http://www.tropsoft.com/privateencryptor/prodinfo.htm

Probably overkill, but gives us something to write about on the CSA returns...

unless anyone has any better ideas? (PrivateEncryptor chosen simply as it appears on our list of available installs)

Bazil
+1  A: 

You could try using SCL code copied with the NOSOURCE and NOEDIT options. This approach of course relies on you having SAS/AF installed.

Like this:

  1. Create a new local SCL Entry. Your INIT section asks for or checks a password. If the password is correct, control is handed to another label with the LINK command, if not, do something else.
  2. Put your SAS code in the label you linked to in step 1, if it's BASE SAS, put it in a submit block, in which case you'll also want to set the NOSOURCE and NOSOURCE2 options to prevent your program to show up in the SAS log.
  3. Compile, save and close your SCL entry.
  4. Copy your SCL to its final destination using PROC COPY with the NOSOURCE and NOEDIT options.

Users can now start a SAS session that calls the SCL. If the correct password is provided, the SCL code runs the embedded SAS code. Users can't snoop the password, nor the program code essentials from the program due to the NOSOURCE option.

Note that this is not state of the art, high security password protection!

It's a quick and dirty way to keep the "wrong" people from running a specific piece of hidden SAS code.

Martin Bøgelund
+1  A: 

I think the answer to your question is "no".

SAS doesn't have a good solution for this. Windows doesn't have a good solution for this.

3rd party software for password protection may be your only option.

AFHood