- %macro ConvertToASCII16(string);
- %local ASCII16;
- %do i=1 %to %sysfunc(length(&string));
- %let loopvar=%sysfunc(substr(&string,&i,1));
- %let ASCII16= &ASCII16%nrbquote(%)%sysfunc(putc(&loopvar,hex2.));
- %end;
- %put &ASCII16;
- %mend;
- %ConvertToASCII16(string=mypassword);
- %let pw=%sysfunc(urldecode(%6D%79%70%61%73%73%77%6F%72%64));
- %put &pw;
这个主要是为了连接数据库的时候不会明码连接,日志如下
25 %macro ConvertToASCII16(string);
26 %local ASCII16;
27 %do i=1 %to %sysfunc(length(&string));
28 %let loopvar=%sysfunc(substr(&string,&i,1));
29 %let ASCII16= &ASCII16%nrbquote(%)%sysfunc(putc(&loopvar,hex2.));
30 %end;
31 %put &ASCII16;
32 %mend;
33 %ConvertToASCII16(string=mypassword);
%6D%79%70%61%73%73%77%6F%72%64
34
35 %let pw=%sysfunc(urldecode(%6D%79%70%61%73%73%77%6F%72%64));
36 %put &pw;
mypassword