What are the challenges you face when working across database platforms? Take the survey

Is it possable to mask the last two digits of a zip code

We have a need to mask only a portion of a zip code so we can retain information about geographic location.


  • Options
    Hi @RobGeorge thank you for your post!

    I would recommend using a row-internal sync rule to achieve what you're looking to do rather than a standard masking rule.
    Your options would be:

    1) Use a de-identified first few digits of a zip code and concatenate them together with the retained real last 2 characters 
    2) Just generate a string of characters for the first part of the Zip and retain the last 2

    I would guess the 2nd option is probably the preferred approach so if you were targeting the ZipCode column the replacement value clause might look something like:

    DMSPARAM1 + RIGHT(ZipCode, 2) 

    Where DMSPARAM1 is either the set "Text, Alpha-Numeric (Formatted)" (with the format string set to %n%n%n to generate a random 3 digit number as text) or "Numbers, Integer, Random (As Text)" (with the low value set to 100 and the high set to 999).

    I hope this helps, let me know if you have any other questions!
Sign In or Register to comment.