/* */

SASTechies

Place to learn SAS and enhance your professional career...

The PWENCODE SAS procedure enables you to encode passwords that can be used in place of plain-text passwords in SAS programs that access relational database management systems (RDBMSs), SAS/SHARE servers, and SAS Integrated Object Model (IOM) servers (such as the SAS Metadata Server).

Syntax

PROC PWENCODE IN='password' <OUT=fileref> <METHOD=encoding-method>;

IN='password'
specifies the password to encode. password can have no more than 512 characters. password can contain letters, numerals, spaces, and special characters

OUT=fileref
specifies a fileref to which the output string is to be written. If the OUT= option is not specified, then the output string is written to the SAS log.
METHOD=encoding-method
specifies the encoding method to use. Currently, sas001 is the only supported encoding method and is the default if the METHOD= option is omitted.

When a password is encoded with PROC PWENCODE, the output string includes a tag that identifies the string as having been encoded. An example of a tag is {sas001}. The tag indicates the encoding method. SAS servers and SAS/ACCESS engines recognize the tag and decode the string before using it. Encoding a password enables you to write SAS programs without having to specify a password in plain text.



/* ENCODE the password and Write it to the Log*/

proc pwencode in='password';
run;





/* ENCODE the password and Save it to the ClipBoard*/

filename clip clipbrd;
proc pwencode in='password' out=clip; run;




/* ENCODE the password and Save it to the Text file C:\pass.txt */

filename pwfile 'C:\pass.txt';
proc pwencode in='password' out=pwfile; run;



/*Use the New password to connect to RDBMS, FTP or anywhere in SAS*/

/* Here's an FTP Example  

This example creates a file called test.dat in the \remote directory of the unix ftp server for the user ftpuser on the host unixserver:
*/


filename create ftp 'test.dat' cd='~'
         host='unixserver'
         user='ftpuser' pass='{sas001}cGFzc3dvcmQ=' recfm=v;

data _null_;
   file create;
   do i=1 to 10;
      put i=;
   end;
run;

0 comments:

Post a Comment





Technology Top Blogs Programming Blogs - BlogCatalog Blog Directory TopOfBlogs Blog Directory blogarama - the blog directory blog search directory Blog Directory - OnToplist.com hihera.com On our way to 1,000,000 rss feeds - millionrss.com Increase Page Rank