NYCBabak . Posted January 19, 2021 Share Posted January 19, 2021 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 More sharing options...
Douglas Lee 2 Posted January 19, 2021 Author Share Posted January 19, 2021 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 More sharing options...
Warren Hinchliffe Posted January 20, 2021 Share Posted January 20, 2021 Doing the masking in the master file is a great idea, effectively a business view. Link to comment Share on other sites More sharing options...
Douglas Lee 2 Posted January 20, 2021 Author Share Posted January 20, 2021 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 More sharing options...
Charles Morris 2 Posted January 20, 2021 Share Posted January 20, 2021 standard masking - 9 includes the character, $ skips the character, any other value is included. So the 9999xxx99 should work fine Link to comment Share on other sites More sharing options...
NYCBabak . Posted January 20, 2021 Share Posted January 20, 2021 DEFINE FILE CAR MASKED_TEXT/A50=EDIT(COUNTRY,999xxx999); END TABLE FILE CAR PRINT MASKED_TEXT BY CAR END Link to comment Share on other sites More sharing options...
Douglas Lee 2 Posted January 20, 2021 Author Share Posted January 20, 2021 Thanks Charles Morris, The operative word is Should But it doesnt 9999***99 'should work as well NYCBabak, Weird, MASKED_TEXT/A50=EDIT(COUNTRY,999xxx999); does work. Maybe it DB Specific, using DB2 This works as well (CAR File): NEWFIELD/A4 = EDIT(WHOLE_FLD,99$99); Link to comment Share on other sites More sharing options...
Charles Morris 2 Posted January 20, 2021 Share Posted January 20, 2021 Does it work if you move it to a COMPUTE and take it out of the DB and onto the WF Server Link to comment Share on other sites More sharing options...
NYCBabak . Posted January 20, 2021 Share Posted January 20, 2021 This works for me in 8207. DEFINE FILE CAR MASKED_TEXT/A50=EDIT(COUNTRY,'999***999'); END TABLE FILE CAR PRINT MASKED_TEXT COMPUTE COMPUTE_MSK/A50=EDIT(CAR,'999***999'); BY CAR END Link to comment Share on other sites More sharing options...
Douglas Lee 2 Posted January 20, 2021 Author Share Posted January 20, 2021 Charles Morris: Will check soon NYCBabak: Yep that works, DEFINE and COMPUTE, but CAR is not DB2. Link to comment Share on other sites More sharing options...
NYCBabak . Posted January 20, 2021 Share Posted January 20, 2021 What does the SQL trace show I dont have access to DB2 to test. Link to comment Share on other sites More sharing options...
Douglas Lee 2 Posted January 20, 2021 Author Share Posted January 20, 2021 Ill get the SQL trace when I get back to DB2 Link to comment Share on other sites More sharing options...
NYCBabak . Posted January 20, 2021 Share Posted January 20, 2021 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 More sharing options...
Douglas Lee 2 Posted January 20, 2021 Author Share Posted January 20, 2021 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 More sharing options...
David Beagan Posted January 22, 2021 Share Posted January 22, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now