BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Linda_V
Obsidian | Level 7

From our Linux server, we are using SAS PC File Server and pass our credentials using serveruser= and serverpass= options when executing PROC IMPORT and PROC EXPORT code.

 

We use a %INCLUDE statement to read our pw.sas program that contains the user's credentials.  This process works fine when the actual password is entered into the pw.sas program.  

 

What we are trying to do is use the encrypted password from the proc pwencode into our pw.sas program.  It seems the serverpass= option can't interpret the encrypted password?  Is this true?  Is there a way to use an encrypted password so that the password is not shown in the log files?

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
LeonidBatkhan
Lapis Lazuli | Level 10

SAS documentation for PROC PWENCODE says: The METHOD= option supports the SAS003, SAS004, and SAS005 values, but only if you have SAS/SECURE.  SAS002 does not require SAS/SECURE license.

View solution in original post

6 REPLIES 6
LeonidBatkhan
Lapis Lazuli | Level 10

Hi Linda_V, are you including your encrypted pw in quotes?

Linda_V
Obsidian | Level 7

Hi,

The results of proc pwencode is provided with quotes.  Example:  "{SAS004}098098DFASFDS09809DAFSDFSA"   

At first I thought I had a set of two quotes since I had quotes in the pw.sas program AND  quotes around my macro I was using in the serverpass=.  So, I removed the quotes around the macro and left the quotes in the pw.sas program.  Neither version was successful.

 

Original code when using plain text in pw.sas program:

serverpass="&userPW."

 

Code when using the proc pwencode results in pw.sas program:

serverpass= &userPW.

 

LeonidBatkhan
Lapis Lazuli | Level 10

I am not sure how you get PROC PWENCODE to provide your pw in quotes. You can run

 

proc pwencode in='your_actual_pw' method=SAS004;
run;

and get your encrypted pw in the log as

{SAS004}78BCBA30084F0A72B401D0DEEC630EF8967005CA77A26DB5

 

Then assign its value (without quotes):

%let userPW={SAS004}78BCBA30084F0A72B401D0DEEC630EF8967005CA77A26DB5;

Then use in PROC IMPORT as serverpass="&userPW" .

 

Check out the following track https://communities.sas.com/t5/SAS-Programming/SAS-PC-File-Formats-Error-importing-or-exporting-from...

to see if you have configuration issue.

Hope this helps.

 

 

Linda_V
Obsidian | Level 7

Hi, 

 

Thank you for your feedback.  What I have found is that method=sas002 will work, however method=sas004 does not.

I had copied the encrypted pw from my sasv9.cfg file and that's where I got the quotes from.  Sorry about that detail.

I will use method=sas002 in the future.

 

Thanks again!

 

 

LeonidBatkhan
Lapis Lazuli | Level 10

SAS documentation for PROC PWENCODE says: The METHOD= option supports the SAS003, SAS004, and SAS005 values, but only if you have SAS/SECURE.  SAS002 does not require SAS/SECURE license.

SASKiwi
PROC Star

@Linda_V  - What is your SAS maintenance level? Often the more advanced encryption methods have only been implemented in recent maintenance releases.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 6 replies
  • 2285 views
  • 1 like
  • 3 in conversation