Masking Fails encountering a leading space

  • 0
  • 1
  • Question
  • Updated 3 months ago
Hi there,
I am trying to mask lets say the post code column, while preserving the first two Chars. I am using Alpha-num segment mapping but it appears the masking fails when there is a leading space, I do have a work around to trim the leading space, but trying to understand why it would fail anyways. I do not want to Ltrim the data as cleansing of data is unacceptable.
so
"SW121 AT"  >  "SW454 GF"
" SW121 AT" >  " SG454 GF"
Photo of EnterpriseMan

EnterpriseMan

  • 630 Points 500 badge 2x thumb

Posted 3 months ago

  • 0
  • 1
Photo of John Hanratty

John Hanratty, Employee

  • 620 Points 500 badge 2x thumb
Madhu: Edit your segment mapping algorithm to ignore spaces in the Ignore Characters Separated by comma(,) section. The spaces will be ignore and replaced after masking.  
The trim option works well too, and will not write back any leading spaces.  
Thanks Jack 
Photo of EnterpriseMan

EnterpriseMan

  • 630 Points 500 badge 2x thumb
Hello John/Jack, That was one of the basic fix I tried, adding space as an ignored Character. It does not work. I tried LTrim a few weeks ago, Which is not ideal, as it inadvertently cleans the data after masking.
(Edited)
Photo of John Hanratty

John Hanratty, Employee

  • 620 Points 500 badge 2x thumb
Hello Madhu:
    Please post your ignore characters string here. 
Thanks Jack 
Photo of EnterpriseMan

EnterpriseMan

  • 630 Points 500 badge 2x thumb
±,!,@,£,$,%,^,&,*,),(,_, ,+,§,=,-,.,/,<,>,?,;,',\,[,],:,",|,{,},`,~
Also, there is a need to preserve the first two positions, where the space occurs.
(Edited)
Photo of John Hanratty

John Hanratty, Employee

  • 620 Points 500 badge 2x thumb
Thank-you, what version of the masking engine are running, also post your trim statement too. 
I'll test this out later today. 

Photo of EnterpriseMan

EnterpriseMan

  • 630 Points 500 badge 2x thumb
I have 5.2.6 but I have tested the same on 5.3 as well. There is no need to test trim statement, it works as expected.
Photo of John Hanratty

John Hanratty, Employee

  • 620 Points 500 badge 2x thumb
Hello Madhu:  I've run this test on versions 5.2.3.1 and 5.3.1.2 with a SM 4x4 alpha-numeric algorithm with the ignore string provided. 
 
My test case included spaces (front, middle, and 2 together), $ and ±.
Both tests are working as expected. 

Please contact me via email if you would like to review.
Thanks Jack 
jhanratty@delphix.com