Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assign Encoded Password To Macro Variable

Status
Not open for further replies.

mmignot

Programmer
Jul 16, 2001
44
0
0
US
Hello all,

Does anyone know how to use the "PROC PWENCODE" procedure to create an encoded password and pass the value to a macro variable? Here is the code I tried:


proc pwencode in='&usrPWD' out='&e_PWD';
run;

When I run this code I get the following error:

22
200

ERROR 22-322: Expecting a name.

ERROR 200-322: The symbol is not recognized and will be
ignored.

Any help would be greatly appreciated!!

 
There's an example of how to do this on the documentation for PWENCODE.
Looks like you have to write it out to a file, then read that file in and put the read in data into a macro variable.
Code:
filename pwfile 'external-filename';

options symbolgen;

data _null_;
   infile pwfile obs=1 length=l; 
   input @;
   input @1 line $varying1024. l; 
   call symput('dbpass',substr(line,1,l)); 
run;

libname x odbc dsn=SQLServer user=testuser password="&dbpass";
V9 SAS doco is here

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Thanks Chris,

I've seen this example before, I was just hoping there was a way to do this without having to write the encoded password out to a file. After some research it appears that this is the only option for now.

Thanks again,
M :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top