Hello all,
Can anybody provide me a routine to validate e-mail address. I want to check the following condition to validate e-mail(xxxx@xxx.xxx).
Thanx in advance.
-Yamini
Validating E-mail
Moderators: chulett, rschirm, roy
I would use the pattern matching of DataStage BASIC for a rough filter of valid e-mail addresses. I would use the MATCHES function and the pattern you might use is "0X'@'0X'.com'" or "0X'@'0X'.'3X" if all of the expected addresses are to ".com"s or 3-digit suffixes. If this isn't sufficient then at least you have somewhere to start .
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Beware, though, that not all email addresses have a three digit suffix. We've had .co.uk (and other countries) since day 1, and now .info and .name (and .tv and the like) are becoming more popular.
If you need to use the MATCHES operator against a list of possibilities, there's a cute trick using a multi-valued list of match patterns. For example:Put the most likely candidate at the head of the list and the least likely candidate at the end of the list.
If you need to use the MATCHES operator against a list of possibilities, there's a cute trick using a multi-valued list of match patterns. For example:
Code: Select all
Email.Address MATCHES "0X'@'0X'.'3A" : @VM : "0X'@'0X'.'2A'" : @VM : "0X'@'0X'.'4A'"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Validating E-mail
Hello all,
Thank you very much for ur help.
-Yamini
Thank you very much for ur help.
-Yamini
Validating E-mail
Hello Ray,
I know its too long to ask a question regarding this posting but I have a small problem in implementing the logic. When I am trying to validate an e-mail your condition is working fine for all conditions except when the email-id is in the following format:
abcdef@yahoo.
Can you help me in re-coding the Mathces statement?
Thank you very much in advance.
-Yamini
I know its too long to ask a question regarding this posting but I have a small problem in implementing the logic. When I am trying to validate an e-mail your condition is working fine for all conditions except when the email-id is in the following format:
abcdef@yahoo.
Can you help me in re-coding the Mathces statement?
Thank you very much in advance.
-Yamini
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Is that really a valid email address??
would handle just the yahoo case in a non-case-sensitive manner. I suspect you don't want to handle all possible string@string. addresses since most of these will be erroneous.
Code: Select all
Upcase(Email.Address) MATCHES "0X'@'0X'.'3A" : @VM : "0X'@'0X'.'2A'" : @VM : "0X'@'0X'.'4A'" : @VM : "0X'@YAHOO.'"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.