Joined: 29 Oct 2010 Posts: 202 Location: Toronto, ON, Canada
Is there a way to change all non-blank characters within a field to a single character (such as a 'X') to achieve data masking? So
"John Smith "
would become
"XXXX XXXXX "
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
As Dick said already you might need a series of IFTHEN statements to scan each position in the field for NON-SPACE characters and replace it with 'X', rather than an ALTSEQ.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
jerryte,
It seems you missed a few and also you have quite a few repetitions.(5c is repeated thrice)
I have come up with a total of 97 characters. They are
1. Capital A - Z = 26
2. Small a - z = 26
3. numerics 0 - 9 = 10
4. Spl char (~`!@#$%¢&*()_-+={}¬¦|/\:;'"?><,.[] space) = 35
Here are the equivalent control cards
Code:
//SYSIN DD *
SORT FIELDS=COPY
INREC FINDREP=(STARTPOS=11,ENDPOS=30,
IN=(C'A',C'B',C'C',C'D',C'E',C'F',C'G',C'H',C'I', $ A - I
C'J',C'K',C'L',C'M',C'N',C'O',C'P',C'Q',C'R', $ J - R
C'S',C'T',C'U',C'V',C'W',C'X',C'Y',C'Z', $ S - Z
C'a',C'b',C'c',C'd',C'e',C'f',C'g',C'h',C'i', $ a - i
C'j',C'k',C'l',C'm',C'n',C'o',C'p',C'q',C'r', $ j - r
C's',C't',C'u',C'v',C'w',C'x',C'y',C'z', $ s - z
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Kolusu,
I thought if we use IFTHEN to check for NE C' ', there is nt a chance of any non-SPACE values getting missed. But the other way requires the knowledge of all possible non-SPACE values that might come in the input.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Arun Raj wrote:
Kolusu,
I thought if we use IFTHEN to check for NE C' ', there is nt a chance of any non-SPACE values getting missed. But the other way requires the knowledge of all possible non-SPACE values that might come in the input.
Agreed , but the overhead involved in validating each single byte using IFTHEN with a HITNEXT is not justifiable when compared to a simple translation of specified characters.
Joined: 29 Oct 2010 Posts: 202 Location: Toronto, ON, Canada
Skolusu wrote:
jerryte,
It seems you missed a few and also you have quite a few repetitions.(5c is repeated thrice)
I have come up with a total of 97 characters. They are
1. Capital A - Z = 26
2. Small a - z = 26
3. numerics 0 - 9 = 10
4. Spl char (~`!@#$%¢&*()_-+={}¬¦|/\:;'"?><,.[] space) = 35
Thanks for the list. I modified it to remove the space character since the objective was to mask all non-blank.
Code:
//SYSIN DD *
SORT FIELDS=COPY
INREC FINDREP=(STARTPOS=11,ENDPOS=30,
IN=(C'A',C'B',C'C',C'D',C'E',C'F',C'G',C'H',C'I', $ A - I
C'J',C'K',C'L',C'M',C'N',C'O',C'P',C'Q',C'R', $ J - R
C'S',C'T',C'U',C'V',C'W',C'X',C'Y',C'Z', $ S - Z
C'a',C'b',C'c',C'd',C'e',C'f',C'g',C'h',C'i', $ a - i
C'j',C'k',C'l',C'm',C'n',C'o',C'p',C'q',C'r', $ j - r
C's',C't',C'u',C'v',C'w',C'x',C'y',C'z', $ s - z