Jump to content

Whats the best way to MASK characters, in this case the sou...


Douglas Lee 2

Recommended Posts

I usually dont expose PIIs to end users. Edit the field in the Master file so its always masked. For instance, they dont need to know someones DOB, hide that field and give them a DEFINE in the master for AGE. Same thing with PIN, SSN, et cetera. In my considered opinion , the end users should neither have to deal with this type of stuff nor have access to the real values anyway.
Link to comment
Share on other sites

Whats the best way to MASK characters, in this case the source has PIN as an A9

CODE:

-* replace positions 5-7 with x

DEFINE FILE EMPDATA

MASKTEST/A9 = EDIT(PIN,9999$$$xxx99)

END

TABLE FILE EMPDATA PRINT MASKTEST PIN

END

OUTPUT:

0000xxx80 000000380

0000xxx90 000000390

0000xxx00 000000400

imho: this is complex for the end-users.

Link to comment
Share on other sites

NYCBabak / NYCBabak,

I agree with both aspects of these solutions. However, There is some PII that needs to be exposed by/for some of the Advanced Users and not for others, such as recipients. Thus, the PII needs to be exposed AND maskable (via DEFINE or COMPUTE.

I recall something like this used to work: MASKTEST/A9 = EDIT(PIN,9999xxx99), which would display as 0000xxx80.

Link to comment
Share on other sites

Actually, I dont think my example on CAR is doing what you want either. Its just inserting the * into the value. It isnt replacing the values its masking. Sorry for the confusion. Aside from using Substring and a whole lot of editing, I cant think of an easy way for an InfoAssist user to do this.

This is what you need:

 

TABLE FILE CAR

PRINT CAR

COMPUTE MASKED_TEST/A10=EDIT(EDIT(CAR,999$$$999),999***999);

BY CAR

END

Link to comment
Share on other sites

Thanks for posting that (retraction) it did clear up some confusion. So, the follow DEFINE / COMPUTE code is needed or SUBSTRING with concatenations.

SET PAGE = NOLEAD

DEFINE FILE CAR

D_MASK34/A10=EDIT(COUNTRY,99$$**99999);

END

TABLE FILE CAR

PRINT D_MASK34

COMPUTE C_MASK34/A10=EDIT(COUNTRY,99$$**99999);

BY COUNTRY

Using: EDIT(COUNTRY,999$$**9999)

To hide the 3rd and 4th characters"

END

Still not intuitive to the users Time for The Walters

Link to comment
Share on other sites

Still not intuitive to the users

Not sure what you might be looking for, but heres an idea. You can define a function called MASK. In InfoAssist the user could mask character positions 3 and 4 of the PIN field in the define or compute by coding:

MASK(PIN,34)

 

No quotes required for the second parameter making it a little easier on the user. Of course this concept is only workable for masking any of the first 9 characters. You would work out a way to get the DEFINE FUNCTION code to be executed on the InfoAssist users behalf, in a profile, master file, or business view. The DEFINE FUNCTION code:

DEFINE FUNCTION MASK(Field/A50, Mask/I9)

CH1/A2 = IF EDIT(Mask) CONTAINS '1' THEN '$*' ELSE '9';

CH2/A2 = IF EDIT(Mask) CONTAINS '2' THEN '$*' ELSE '9';

CH3/A2 = IF EDIT(Mask) CONTAINS '3' THEN '$*' ELSE '9';

CH4/A2 = IF EDIT(Mask) CONTAINS '4' THEN '$*' ELSE '9';

CH5/A2 = IF EDIT(Mask) CONTAINS '5' THEN '$*' ELSE '9';

CH6/A2 = IF EDIT(Mask) CONTAINS '6' THEN '$*' ELSE '9';

CH7/A2 = IF EDIT(Mask) CONTAINS '7' THEN '$*' ELSE '9';

CH8/A2 = IF EDIT(Mask) CONTAINS '8' THEN '$*' ELSE '9';

CH9/A2 = IF EDIT(Mask) CONTAINS '9' THEN '$*' ELSE '9';

MASK/A9 = EDIT(Field,CH1||CH2||CH3||CH4||CH5||CH6||CH7||CH8||CH9);

END

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...