IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to mask the phone number


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kumarinfy

New User


Joined: 30 Mar 2017
Posts: 2
Location: india

PostPosted: Mon Apr 03, 2017 5:23 pm
Reply with quote

Hi ,
could you please help me to prepare a select query to mask the phone no
my requirement is to mask the phone no except last 4 digits
please note that phone nos are not fixed length
Table column(PHONE_NO) having values like below
94758365494
0438278475859574
8428746857733774443

expected output should be like below
xxxxxxx5494
xxxxxxxxxxxx9574
xxxxxxxxxxxxxxx4443

Thanks in advance icon_smile.gif
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 869
Location: The Universe

PostPosted: Mon Apr 03, 2017 5:50 pm
Reply with quote

Do not post the same request in multiple forums.

It won't do you any good. For the most part the people willing to respond to your request visit the same forums, and if they see identical requests they will not respond to any of the requests.

This request has been in the beginners forum for nearly a week and there have been no responses. This means one of two things.
  1. It is not possible. OR
  2. It is facetious. If you do not want to display the phone number why is it in the data base to begin with?
It may be a better solution can be found in the agent displaying the contents of the data base
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10712
Location: italy

PostPosted: Mon Apr 03, 2017 6:09 pm
Reply with quote

a telephone number is NOT a credit card number ...
showing the last four digits of a credit/debit card is a courtesy for the owner of the card


all over the world and for ages for telephone numbers it has been the other way around ...
mask the extension ( 3/4 digits )

irrelevant for 'private' numbers ,
most useful for business numbers where pass-trhu calls are not welcome

and remember ..

we reply on our own time and free of charge

if nobody replies it means that
nobody has an in depth knowledge of the topic
nobody is interested in answering
nobody likes You icon_biggrin.gif
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Apr 03, 2017 6:19 pm
Reply with quote

Code:
concat(repeat('*',length(trim(tel))-4),right(trim(tel),4))
Back to top
View user's profile Send private message
kumarinfy

New User


Joined: 30 Mar 2017
Posts: 2
Location: india

PostPosted: Tue Apr 04, 2017 12:50 pm
Reply with quote

Thank you so much
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Sort to construct single record from ... SYNCSORT 3
No new posts count the number of records from diff... CA Products 4
No new posts The Test under Mask (TM) Instruction PL/I & Assembler 7
No new posts Add week number to a file name or rep... JCL & VSAM 2
No new posts How to count the number of times key ... DFSORT/ICETOOL 14
Search our Forums:

Back to Top