Hi All,
Do we have any function in SAS to mask the numbers?
i Have a variable name Ph_num like below:
Input:
Ph_Num:
9876543210
required Output:
98765xxxxx
What are the rules for masking as:
want=cats(substr(ph_num,1,5),repeat('x',lengthn(ph_num)-5));
Should work for your given example. Or you could loop over the string etc.
Hello,
I'm not very at ease with picture formats but i think this works :
proc format;
picture mask
0-9999999999 ='99999XXXXX' (mult=0.00001);
run;
data _null_;
format a b mask.;
a=9876543210;
b=0012345678;
put a= b=;
run;
The only thing I would say there is that it doesn't change the underlying data, take the format away and the number displays as before.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.