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:
- 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.
- 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.
- Compile, save and close your SCL entry.
- 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.