Hi All,
how to mask single and double quotes from my password.
proc pwen code is not working if my password has single and double quotes.
even if I use %str.
%let d=%nrstr(,3xc'wqm_W");
proc pwencode in= ",3xc'wqm_W""; run;
Thanks,
SS
Have you tried the usual way? Within double quotes refer to a double quote with an extra double quote character:
proc pwencode in= ",3xc'wqm_W""";
run;
Have you tried the usual way? Within double quotes refer to a double quote with an extra double quote character:
proc pwencode in= ",3xc'wqm_W""";
run;
I tried this but I doubt, will SAS take extra double Quote as a letter or will it mask ",3xc'wqm_W"""
SAS uses this syntax everywhere else within the software. There's now reason why PWENCODE should be different.
Within double quotes, consecutive double quotes get treated as a single double quote character. With three double quotes in a row, the first two combined get treated as a double quote character, and the third one ends the quoted string.
Please show the actual code since what you show is not using the macro variable you created.
Did you use %STR() or %NRSTR()? I would think you would want %STR() or %BQUOTE() since you have no need to remove the macro quoting.
But it is much easier to use normal quoting instead of macro quoting. Just double the embedded quotes. So either of these should work.
",3xc'wqm_W"""
',3xc''wqm_W"'
Or just use the QUOTE() function to add the quotes.
%let d=%bquote(,3xc'wqm_W");
proc pwencode in=%qsysfunc(quote(%superq(d)));
run;
getting below error
28 %let d=%bquote(,3xc'wqm_W");
29 proc pwencode in=%qsysfunc(quote(%superq(d)));
NOTE: Line generated by the macro function "QSYSFUNC".
29 ",3xc'wqm_W"""
_
22
76
ERROR 22-322: Expecting a quoted string.
ERROR 76-322: Syntax error, statement will be ignored.
30 run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.