BookmarkSubscribeRSS Feed
shwilliams4
Obsidian | Level 7

The programs I run often require a password which usually comes in the form of a macro variable that can then be printed to the log window. Log windows may be saved for audits.

We use SQL pass-through mostly for speed considerations.

I am wondering if SAS would consider puting an option on the %let statement to keep certain macro variables from printing.

It is done in SAS Stored procedures for variables named <something>_password.

Sumner

11 REPLIES 11
Peter_C
Rhodochrosite | Level 12

Before the statements revealing that mVar use statements

%let oldopts =

%sysfunc( getoption( mprint))

%sysfunc( getoption( Symbolgen))

%sysfunc( getoption( mLogic))

;

option NOmprint NOsymbolgen NOmlogic ;

After the statement that (no longer) reveals the password, use this statement to reinstate any macro debugging:

Option &oldopts ;

shwilliams4
Obsidian | Level 7

I need the symbolgen mlogic mprint on for the log files audits.

Symget was something I tried in the past and it didn't work.

I want a property to be on the macro variable that makes it so SAS knows the macro variable should not be printed versus using a different method of calling the macro variable. This may not be possible as macro variables are plain text with no real inherent properties.

Peter_C
Rhodochrosite | Level 12

shwilliams4

you wrote:

I need the symbolgen mlogic mprint on for the log files audits.

.

expecting this "need" I offered you two statements - one to retrieve the current settings before masking the password, and one to reinstate after.

You suggest something which might be possible. Create an IDEA.

peter.C

Fugue
Quartz | Level 8

Thanks for contribution, Reeza. I also linked a document by Carpenter dealing with the issue of masking passwords. Was hoping the OP would read it and see if there was anything useful there.

shwilliams4
Obsidian | Level 7

All great ideas I have aexplored. Peter C. lead me down the path of Creating an Idea which is more of what I needed.

Reeza
Super User

Proc pwencode comes fairly close to what you need for the moment, as it keeps your password from appearing in the log.

shwilliams4
Obsidian | Level 7

Not really. Having the encrypted password in the log does not make it secure.You are corect that one does not know the password, but they don't need to know the password in order to get into the system.

Internally we lock our databases down to protect PHI and Employee PHI. Having the encrypted password go into a log means someone without access to EPHI can use that login/encrypted password to see EPHI. This user would be internal to the company with access to every system.

While {sas02}A48sdgkjsdhkljer may seem secure because you can't see the original password, that encrypted password can still be used to get access to the system. A log file that says password = ********** is secure.

Tom
Super User Tom
Super User

There are methods to deal with this.

One is better coding to turn off MPRINT, SYMBOLGEN while dealing with the password.

.

Another is better methods of connecting using SAS BI tools so that passwords are not stored in macro variables.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 11 replies
  • 3229 views
  • 6 likes
  • 5 in conversation