BookmarkSubscribeRSS Feed
sam1231
Obsidian | Level 7

Hi EVERYONE

 

I want to protect my sas code with password. So no one can open sas code without password.

 

I know we can protect sas dataset with password. But i am not sure how can i add password to my sas program.

 

Thanks,

11 REPLIES 11
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

You should confirm with your company if the practice is allowed.  In some cases that action could result in disciplinary actions because the company owns your work.

 

sam1231
Obsidian | Level 7

its allowed in company! i want to save my sas program with password protection in folder.

 

Thanks,

Reeza
Super User

You'll need to use OS tools. I'm curious as to why this is needed? Is it to maintain a 'source of truth' or backups? If so, this is definitely not the best approach. 

 


@sam1231 wrote:

its allowed in company! i want to save my sas program with password protection in folder.

 

Thanks,


 

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

there are better ways to do what you are asking.  Talk to you Admin have them setup a specific location that only allows authorized users access.  That is their job not yours.  What happens if you die and the company needs to run the process????  I would hate to have to follow behind that practice.

SASKiwi
PROC Star

The only way I know of doing this using SAS is to store your SAS program as a SOURCE entry in a SAS catalog then you can password-protect that.

 

What type of protection do you have in mind? If it is simply to stop others changing your software then using a version-control tool is a much better option.

sam1231
Obsidian | Level 7

Hi saskiwi,

 

i want to save my sas program in folder with password protection. so if anyone one to open it they need password to read/write sas program

 

I hope it helps to clear my question.

 

Thanks

ChrisNZ
Tourmaline | Level 20

>i want to save my sas program in folder with password protection

You can use a ZIP file then.

ScottBass
Rhodochrosite | Level 12

i want to save my sas program in folder with password protection. so if anyone one to open it they need password to read/write sas program

 

Why don't you just use operating system security?  Either Windows or *nix makes this trivial to configure.

 

so if anyone one to open it they need password

 

Does it matter when someone shares the password with others?

 

Another option is compiled macros.  Users could execute your macros, but would not be able to alter them.  With proper options within the macro they won't even be able to see the code in the log.  Hit the doc for details.


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
Patrick
Opal | Level 21

@sam1231 

The use cases to read protect SAS code via a password and not just on OS folder level are rather rare. That's why you get so much "resistance".

What would help: Share with us your use case. Explain WHY you want to protect the source code this way. May be there are other/"better" ways with less negative impact to achieve what you need.

SASKiwi
PROC Star

It would help us give you the best answer if you explained why you want to password-protect your SAS programs. You have clearly explained what you want, but not why.

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

the basic who, what, when, where, why questions that need to be answered to preformed and supply the final product.

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 11 replies
  • 3275 views
  • 4 likes
  • 7 in conversation