October 11, 2006, 11:15 AM
funsuttonMasking Characters
I know this is simple and the mask function is simple, but actual implementation is beyond me at the moment. I simply want to mask a ID field to the last 4 digits.
Report:
TABLE FILE TOT_AWRD
BY SPRIDEN_LAST_NAME NOPRINT
BY SPRIDEN_FIRST_NAME NOPRINT
BY SPRIDEN_ID [B]<<<--------I WANT TO MASK THIS TO BE XXXXX6789[/B]
BY SPRIDEN_LAST_NAME
BY SPRIDEN_FIRST_NAME
BY RNVAND1_GROSS_NEED
BY RNVAND1_UNMET_NEED
BY TOTAL_AWARD
WHERE SPRIDEN_CHANGE_IND EQ MISSING
WHERE RNVAND1_AIDY_CODE EQ '&AID_YEAR.(FIND ROBINST_AIDY_CODE IN ROBINST).AID_YEAR.'
ON TABLE PCHOLD FORMAT EXL2K
END
How do you mask a "by field"
October 11, 2006, 11:24 AM
susannahBrian,
my reading of the doc says that MASK is a Maintain-only function.
EDIT would be the equivalent function in the reporting world.
I would just create a new variable
SPRIDEN_ID2/A4=EDIT(SPRIDEN_ID,'$$$$$9999');
and if i wanted to display it with X's
then
SPRIDEN_ID2/A9='XXXXX' | EDIT(SPRIDEN_ID,'$$$$$9999');
October 11, 2006, 11:30 AM
GlendaBrian,
There may be an easier way, but I'd just make a defined field. Hold by the original field (noprint) and then by the defined field.
DEFINE FILE ELGEMP
SSNID/A9 = 'XXXXX'||EDIT(EESSNO, '$$$$$9999');
END
TABLE FILE ELGEMP
PRINT
EEFNAM
EELNAM
EEEFDT
BY EESSNO NOPRINT
BY SSNID
ON TABLE PCHOLD FORMAT EXL2K
END
-EXIT
October 11, 2006, 11:36 AM
Jim_at_LMDEFINE FILE FILE TOT_AWRD
XSPRIDEN_ID/A4 =EDIT(SPRIDEN_ID,’$$$$$9999’);
END
:
BY XSPRIDEN_ID
October 11, 2006, 12:34 PM
LeahYou may be able to use special characters to create the edit mask properly. Came across it recently in issues we were having with student id. We were having issues with the define mask using the first four rather than the last four characters. So if you want nine characters in all then you need to do the special edit otherwise if four will do, Jim_at_LM suggestion is good. If you want the 'X' then do an edit
EDIT(ID,'$$$$$XXXXX9999') and it will print five 'X' and the last four numbers.
October 11, 2006, 01:17 PM
funsuttonThanks everyone for your input.
I used Susannah's define with the pipe command and it works great.
October 11, 2006, 06:13 PM
susannahquote:
EDIT(ID,'$$$$$XXXXX9999'
i just tried Leah's trick. That is SLICK!!!
Brian, do what Leah suggested.