Hi,
I'm using below code to encrypt my passwords. It was working fine until several jobs started to use the same .txt file and It gave me error saying that the .txt file is in use.
Can someone suggest if there is a way in proc pwencode where I can create a macro variable with encrypted value without writing it to the .txt files?
%let uid = ididid;
%let pid = ididid;
filename pwfile '/uhyy/xx/pwd.txt';
filename ppw '/uhyy/xx/ppw.txt';
proc pwencode in='My_pwd' out=pwfile;
run;
proc pwencode in='My_pwd' out=ppw;
run;
options symbolgen;
%macro readpwd(filename,var);
data _null_;
infile &filename obs=1 length=l;
input @;
input @1 line $varying1024. l;
call symput("&var",substr(line,1,l));
run;
%mend;
%readpwd(pwfile,pwd);
%readpwd(ppw,ppwd);
Use the PATHNAME() function to get the filename. Or the FILENAME= option on the INFILE statement.
For EG there must be a method for downloading files, but if not then just read it into a dataset and download that.
Use the TEMP filename engine to insure that you get a unique file created. The file will be created in the WORK directory.
filename pwfile temp;
proc pwencode in='My_pwd' out=pwfile;
run;
Thank you!
Is there a way I can see the filename? and In EG how do i access work folder to see this file?
Use the PATHNAME() function to get the filename. Or the FILENAME= option on the INFILE statement.
For EG there must be a method for downloading files, but if not then just read it into a dataset and download that.
Thank you!
alternatively,
eliminate contention for a data file by writing it into a SAS catalog in your WORK library.
It is similar to the TEMP filename engine but persists a bit longer.
filename encrp temp lrecl=2048 ;
Creates a reference to a new file that will be lost when the filename encrp is closed with something like:
filename encrp ;
filename encry catalog 'work.work.work.source' lrecl=2048 ;
defines the reference encry, pointing to the source-type catalog entry work.source in the SAS catalog work.work. The source entry will persist until the end of the SAS session (or someone deletes it or deletes the catalog)
It can be used as if it is a plain text file.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.