BookmarkSubscribeRSS Feed
katies
Calcite | Level 5

I want to encode my password for a database and use it in a libname statement on another library.

 

I'm using the code below, but I'm having trouble with the filepath portion. How do I write to a file that is not accessible to everyone on the server. 

 

filename pwfile 'filepath';

proc pwencode in='password';
run;
2 REPLIES 2
Patrick
Opal | Level 21

@katies 

If it's SAS tables then security needs to be applied on OS level. You don't need a password but you just store the SAS tables (files) in a folder which is only readable by defined users/groups.

If it's a database then use an authentication domain defined in SAS Metadata and apply SAS metadata security on this domain so that that only defined users/groups can use it.

SASKiwi
PROC Star

If you leave out the filename the encrypted password is written to the SAS log where you can copy and paste it wherever you like.

 

Please bear in mind, that leaving even encrypted passwords in files is not secure. For example, anyone can copy this password into their own SAS programs and providing they also know the user name can access databases without unencrypting the password string.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 335 views
  • 0 likes
  • 3 in conversation